chillerlan-QRCode-Decoder-Binarizer.html 53 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Source+Sans+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/search.js"></script>
  22. <script defer src="js/searchIndex.js"></script>
  23. </head>
  24. <body id="top">
  25. <header class="phpdocumentor-header phpdocumentor-section">
  26. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  27. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  28. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  29. <i class="fas fa-bars"></i>
  30. </label>
  31. <section data-search-form class="phpdocumentor-search">
  32. <label>
  33. <span class="visually-hidden">Search for</span>
  34. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  35. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  36. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  37. </svg>
  38. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  39. </label>
  40. </section>
  41. <nav class="phpdocumentor-topnav">
  42. <ul class="phpdocumentor-topnav__menu">
  43. <li class="phpdocumentor-topnav__menu-item -menu">
  44. <a href="https://php-qrcode.readthedocs.io">
  45. <span>
  46. User Manual
  47. </span>
  48. </a>
  49. </li>
  50. <li class="phpdocumentor-topnav__menu-item -social">
  51. <a href="https://github.com/chillerlan/php-qrcode">
  52. <span>
  53. <i class="fab fa-github"></i>
  54. </span>
  55. </a>
  56. </li>
  57. </ul>
  58. </nav>
  59. </header>
  60. <main class="phpdocumentor">
  61. <div class="phpdocumentor-section">
  62. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  63. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  64. Menu
  65. </label>
  66. <aside class="phpdocumentor-column -four phpdocumentor-sidebar">
  67. <section class="phpdocumentor-sidebar__category">
  68. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  69. <h4 class="phpdocumentor-sidebar__root-namespace">
  70. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  71. </h4>
  72. <ul class="phpdocumentor-list">
  73. <li>
  74. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  75. </li>
  76. <li>
  77. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  78. </li>
  79. </ul>
  80. </section>
  81. <section class="phpdocumentor-sidebar__category">
  82. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  83. <h4 class="phpdocumentor-sidebar__root-namespace">
  84. <a href="packages/Application.html" class="">Application</a>
  85. </h4>
  86. </section>
  87. <section class="phpdocumentor-sidebar__category">
  88. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  89. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  90. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  91. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  92. </section>
  93. <section class="phpdocumentor-sidebar__category">
  94. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  95. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  96. </section>
  97. </aside>
  98. <div class="phpdocumentor-column -eight phpdocumentor-content">
  99. <ul class="phpdocumentor-breadcrumbs">
  100. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  101. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  102. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-decoder.html">Decoder</a></li>
  103. </ul>
  104. <article class="phpdocumentor-element -class">
  105. <h2 class="phpdocumentor-content__title">
  106. Binarizer
  107. <div class="phpdocumentor-element__package">
  108. in package
  109. <ul class="phpdocumentor-breadcrumbs">
  110. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  111. </ul>
  112. </div>
  113. </h2>
  114. <aside class="phpdocumentor-element-found-in">
  115. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  116. :
  117. <span class="phpdocumentor-element-found-in__line">34</span>
  118. </aside>
  119. <p class="phpdocumentor-summary">This class implements a local thresholding algorithm, which while slower than the
  120. GlobalHistogramBinarizer, is fairly efficient for what it does. It is designed for
  121. high frequency images of barcodes with black data on white backgrounds. For this application,
  122. it does a much better job than a global blackpoint with severe shadows and gradients.</p>
  123. <section class="phpdocumentor-description"><p>However, it tends to produce artifacts on lower frequency images and is therefore not
  124. a good general purpose binarizer for uses outside ZXing.</p>
  125. <p>This class extends GlobalHistogramBinarizer, using the older histogram approach for 1D readers,
  126. and the newer local approach for 2D readers. 1D decoding using a per-row histogram is already
  127. inherently local, and only fails for horizontal gradients. We can revisit that problem later,
  128. but for now it was not a win to use local blocks for 1D.</p>
  129. <p>This Binarizer is the default for the unit tests and the recommended class for library users.</p>
  130. </section>
  131. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  132. Tags
  133. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  134. </h5>
  135. <dl class="phpdocumentor-tag-list">
  136. <dt class="phpdocumentor-tag-list__entry">
  137. <span class="phpdocumentor-tag__name">author</span>
  138. </dt>
  139. <dd class="phpdocumentor-tag-list__definition">
  140. <section class="phpdocumentor-description"><p>dswitkin@google.com (Daniel Switkin)</p>
  141. </section>
  142. </dd>
  143. </dl>
  144. <h3 id="toc">
  145. Table of Contents
  146. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  147. </h3>
  148. <dl class="phpdocumentor-table-of-contents">
  149. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  150. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE">BLOCK_SIZE</a>
  151. <span>
  152. &nbsp;= 8 </span>
  153. </dt>
  154. <dd></dd>
  155. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  156. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_MASK">BLOCK_SIZE_MASK</a>
  157. <span>
  158. &nbsp;= 7 </span>
  159. </dt>
  160. <dd></dd>
  161. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  162. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_POWER">BLOCK_SIZE_POWER</a>
  163. <span>
  164. &nbsp;= 3 </span>
  165. </dt>
  166. <dd></dd>
  167. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  168. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_BUCKETS">LUMINANCE_BUCKETS</a>
  169. <span>
  170. &nbsp;= 32 </span>
  171. </dt>
  172. <dd></dd>
  173. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  174. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_SHIFT">LUMINANCE_SHIFT</a>
  175. <span>
  176. &nbsp;= 3 </span>
  177. </dt>
  178. <dd></dd>
  179. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  180. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MIN_DYNAMIC_RANGE">MIN_DYNAMIC_RANGE</a>
  181. <span>
  182. &nbsp;= 24 </span>
  183. </dt>
  184. <dd></dd>
  185. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  186. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MINIMUM_DIMENSION">MINIMUM_DIMENSION</a>
  187. <span>
  188. &nbsp;= 40 </span>
  189. </dt>
  190. <dd></dd>
  191. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  192. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_luminances">$luminances</a>
  193. <span>
  194. &nbsp;: array&lt;string|int, mixed&gt; </span>
  195. </dt>
  196. <dd></dd>
  197. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  198. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_source">$source</a>
  199. <span>
  200. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Decoder\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a> </span>
  201. </dt>
  202. <dd></dd>
  203. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  204. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method___construct">__construct()</a>
  205. <span>
  206. &nbsp;: mixed </span>
  207. </dt>
  208. <dd></dd>
  209. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  210. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getBlackMatrix">getBlackMatrix()</a>
  211. <span>
  212. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  213. </dt>
  214. <dd>Calculates the final BitMatrix once for all requests. This could be called once from the
  215. constructor instead, but there are some advantages to doing it lazily, such as making
  216. profiling easier, and not doing heavy lifting when callers don&#039;t expect it.</dd>
  217. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  218. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints">calculateBlackPoints()</a>
  219. <span>
  220. &nbsp;: array&lt;string|int, mixed&gt; </span>
  221. </dt>
  222. <dd>Calculates a single black point for each block of pixels and saves it away.</dd>
  223. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  224. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateThresholdForBlock">calculateThresholdForBlock()</a>
  225. <span>
  226. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  227. </dt>
  228. <dd>For each block in the image, calculate the average black point using a 5x5 grid
  229. of the surrounding blocks. Also handles the corner cases (fractional blocks are computed based
  230. on the last pixels in the row/column which are also used in the previous block).</dd>
  231. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  232. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_cap">cap()</a>
  233. <span>
  234. &nbsp;: int </span>
  235. </dt>
  236. <dd></dd>
  237. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  238. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_estimateBlackPoint">estimateBlackPoint()</a>
  239. <span>
  240. &nbsp;: int </span>
  241. </dt>
  242. <dd></dd>
  243. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  244. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getHistogramBlackMatrix">getHistogramBlackMatrix()</a>
  245. <span>
  246. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  247. </dt>
  248. <dd></dd>
  249. </dl>
  250. <section class="phpdocumentor-constants">
  251. <h3 class="phpdocumentor-elements__header" id="constants">
  252. Constants
  253. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  254. </h3>
  255. <article class="phpdocumentor-element -constant -private ">
  256. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE">
  257. BLOCK_SIZE
  258. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE" class="headerlink"><i class="fas fa-link"></i></a>
  259. </h4>
  260. <aside class="phpdocumentor-element-found-in">
  261. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  262. :
  263. <span class="phpdocumentor-element-found-in__line">39</span>
  264. </aside>
  265. <code class="phpdocumentor-signature phpdocumentor-code ">
  266. <span class="phpdocumentor-signature__visibility">private</span>
  267. <span class="phpdocumentor-signature__type">mixed</span>
  268. <span class="phpdocumentor-signature__name">BLOCK_SIZE</span>
  269. = <span class="phpdocumentor-signature__default-value">8</span>
  270. </code>
  271. <section class="phpdocumentor-description"></section>
  272. <section class="phpdocumentor-description"></section>
  273. </article>
  274. <article class="phpdocumentor-element -constant -private ">
  275. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE_MASK">
  276. BLOCK_SIZE_MASK
  277. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_MASK" class="headerlink"><i class="fas fa-link"></i></a>
  278. </h4>
  279. <aside class="phpdocumentor-element-found-in">
  280. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  281. :
  282. <span class="phpdocumentor-element-found-in__line">40</span>
  283. </aside>
  284. <code class="phpdocumentor-signature phpdocumentor-code ">
  285. <span class="phpdocumentor-signature__visibility">private</span>
  286. <span class="phpdocumentor-signature__type">mixed</span>
  287. <span class="phpdocumentor-signature__name">BLOCK_SIZE_MASK</span>
  288. = <span class="phpdocumentor-signature__default-value">7</span>
  289. </code>
  290. <section class="phpdocumentor-description"></section>
  291. <section class="phpdocumentor-description"></section>
  292. </article>
  293. <article class="phpdocumentor-element -constant -private ">
  294. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE_POWER">
  295. BLOCK_SIZE_POWER
  296. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_POWER" class="headerlink"><i class="fas fa-link"></i></a>
  297. </h4>
  298. <aside class="phpdocumentor-element-found-in">
  299. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  300. :
  301. <span class="phpdocumentor-element-found-in__line">38</span>
  302. </aside>
  303. <code class="phpdocumentor-signature phpdocumentor-code ">
  304. <span class="phpdocumentor-signature__visibility">private</span>
  305. <span class="phpdocumentor-signature__type">mixed</span>
  306. <span class="phpdocumentor-signature__name">BLOCK_SIZE_POWER</span>
  307. = <span class="phpdocumentor-signature__default-value">3</span>
  308. </code>
  309. <section class="phpdocumentor-description"></section>
  310. <section class="phpdocumentor-description"></section>
  311. </article>
  312. <article class="phpdocumentor-element -constant -private ">
  313. <h4 class="phpdocumentor-element__name" id="constant_LUMINANCE_BUCKETS">
  314. LUMINANCE_BUCKETS
  315. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_BUCKETS" class="headerlink"><i class="fas fa-link"></i></a>
  316. </h4>
  317. <aside class="phpdocumentor-element-found-in">
  318. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  319. :
  320. <span class="phpdocumentor-element-found-in__line">46</span>
  321. </aside>
  322. <code class="phpdocumentor-signature phpdocumentor-code ">
  323. <span class="phpdocumentor-signature__visibility">private</span>
  324. <span class="phpdocumentor-signature__type">mixed</span>
  325. <span class="phpdocumentor-signature__name">LUMINANCE_BUCKETS</span>
  326. = <span class="phpdocumentor-signature__default-value">32</span>
  327. </code>
  328. <section class="phpdocumentor-description"></section>
  329. <section class="phpdocumentor-description"></section>
  330. </article>
  331. <article class="phpdocumentor-element -constant -private ">
  332. <h4 class="phpdocumentor-element__name" id="constant_LUMINANCE_SHIFT">
  333. LUMINANCE_SHIFT
  334. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_SHIFT" class="headerlink"><i class="fas fa-link"></i></a>
  335. </h4>
  336. <aside class="phpdocumentor-element-found-in">
  337. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  338. :
  339. <span class="phpdocumentor-element-found-in__line">45</span>
  340. </aside>
  341. <code class="phpdocumentor-signature phpdocumentor-code ">
  342. <span class="phpdocumentor-signature__visibility">private</span>
  343. <span class="phpdocumentor-signature__type">mixed</span>
  344. <span class="phpdocumentor-signature__name">LUMINANCE_SHIFT</span>
  345. = <span class="phpdocumentor-signature__default-value">3</span>
  346. </code>
  347. <section class="phpdocumentor-description"></section>
  348. <section class="phpdocumentor-description"></section>
  349. </article>
  350. <article class="phpdocumentor-element -constant -private ">
  351. <h4 class="phpdocumentor-element__name" id="constant_MIN_DYNAMIC_RANGE">
  352. MIN_DYNAMIC_RANGE
  353. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MIN_DYNAMIC_RANGE" class="headerlink"><i class="fas fa-link"></i></a>
  354. </h4>
  355. <aside class="phpdocumentor-element-found-in">
  356. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  357. :
  358. <span class="phpdocumentor-element-found-in__line">42</span>
  359. </aside>
  360. <code class="phpdocumentor-signature phpdocumentor-code ">
  361. <span class="phpdocumentor-signature__visibility">private</span>
  362. <span class="phpdocumentor-signature__type">mixed</span>
  363. <span class="phpdocumentor-signature__name">MIN_DYNAMIC_RANGE</span>
  364. = <span class="phpdocumentor-signature__default-value">24</span>
  365. </code>
  366. <section class="phpdocumentor-description"></section>
  367. <section class="phpdocumentor-description"></section>
  368. </article>
  369. <article class="phpdocumentor-element -constant -private ">
  370. <h4 class="phpdocumentor-element__name" id="constant_MINIMUM_DIMENSION">
  371. MINIMUM_DIMENSION
  372. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MINIMUM_DIMENSION" class="headerlink"><i class="fas fa-link"></i></a>
  373. </h4>
  374. <aside class="phpdocumentor-element-found-in">
  375. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  376. :
  377. <span class="phpdocumentor-element-found-in__line">41</span>
  378. </aside>
  379. <code class="phpdocumentor-signature phpdocumentor-code ">
  380. <span class="phpdocumentor-signature__visibility">private</span>
  381. <span class="phpdocumentor-signature__type">mixed</span>
  382. <span class="phpdocumentor-signature__name">MINIMUM_DIMENSION</span>
  383. = <span class="phpdocumentor-signature__default-value">40</span>
  384. </code>
  385. <section class="phpdocumentor-description"></section>
  386. <section class="phpdocumentor-description"></section>
  387. </article>
  388. </section>
  389. <section class="phpdocumentor-properties">
  390. <h3 class="phpdocumentor-elements__header" id="properties">
  391. Properties
  392. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  393. </h3>
  394. <article
  395. class="
  396. phpdocumentor-element
  397. -property
  398. -private
  399. "
  400. >
  401. <h4 class="phpdocumentor-element__name" id="property_luminances">
  402. $luminances
  403. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_luminances" class="headerlink"><i class="fas fa-link"></i></a>
  404. <span class="phpdocumentor-element__modifiers">
  405. </span>
  406. </h4>
  407. <aside class="phpdocumentor-element-found-in">
  408. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  409. :
  410. <span class="phpdocumentor-element-found-in__line">49</span>
  411. </aside>
  412. <code class="phpdocumentor-code phpdocumentor-signature ">
  413. <span class="phpdocumentor-signature__visibility">private</span>
  414. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  415. <span class="phpdocumentor-signature__name">$luminances</span>
  416. </code>
  417. <section class="phpdocumentor-description"></section>
  418. <section class="phpdocumentor-description"></section>
  419. </article>
  420. <article
  421. class="
  422. phpdocumentor-element
  423. -property
  424. -private
  425. "
  426. >
  427. <h4 class="phpdocumentor-element__name" id="property_source">
  428. $source
  429. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_source" class="headerlink"><i class="fas fa-link"></i></a>
  430. <span class="phpdocumentor-element__modifiers">
  431. </span>
  432. </h4>
  433. <aside class="phpdocumentor-element-found-in">
  434. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  435. :
  436. <span class="phpdocumentor-element-found-in__line">48</span>
  437. </aside>
  438. <code class="phpdocumentor-code phpdocumentor-signature ">
  439. <span class="phpdocumentor-signature__visibility">private</span>
  440. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Decoder-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Decoder\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a></span>
  441. <span class="phpdocumentor-signature__name">$source</span>
  442. </code>
  443. <section class="phpdocumentor-description"></section>
  444. <section class="phpdocumentor-description"></section>
  445. </article>
  446. </section>
  447. <section class="phpdocumentor-methods">
  448. <h3 class="phpdocumentor-elements__header" id="methods">
  449. Methods
  450. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  451. </h3>
  452. <article
  453. class="phpdocumentor-element
  454. -method
  455. -public
  456. "
  457. >
  458. <h4 class="phpdocumentor-element__name" id="method___construct">
  459. __construct()
  460. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  461. </h4>
  462. <aside class="phpdocumentor-element-found-in">
  463. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  464. :
  465. <span class="phpdocumentor-element-found-in__line">54</span>
  466. </aside>
  467. <code class="phpdocumentor-code phpdocumentor-signature ">
  468. <span class="phpdocumentor-signature__visibility">public</span>
  469. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Decoder-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Decoder\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$source</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  470. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  471. <dl class="phpdocumentor-argument-list">
  472. <dt class="phpdocumentor-argument-list__entry">
  473. <span class="phpdocumentor-signature__argument__name">$source</span>
  474. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Decoder-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Decoder\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a></span>
  475. </dt>
  476. <dd class="phpdocumentor-argument-list__definition">
  477. <section class="phpdocumentor-description"></section>
  478. </dd>
  479. </dl>
  480. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  481. <span class="phpdocumentor-signature__response_type">mixed</span>
  482. &mdash;
  483. </article>
  484. <article
  485. class="phpdocumentor-element
  486. -method
  487. -public
  488. "
  489. >
  490. <h4 class="phpdocumentor-element__name" id="method_getBlackMatrix">
  491. getBlackMatrix()
  492. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getBlackMatrix" class="headerlink"><i class="fas fa-link"></i></a>
  493. </h4>
  494. <aside class="phpdocumentor-element-found-in">
  495. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  496. :
  497. <span class="phpdocumentor-element-found-in__line">138</span>
  498. </aside>
  499. <p class="phpdocumentor-summary">Calculates the final BitMatrix once for all requests. This could be called once from the
  500. constructor instead, but there are some advantages to doing it lazily, such as making
  501. profiling easier, and not doing heavy lifting when callers don&#039;t expect it.</p>
  502. <code class="phpdocumentor-code phpdocumentor-signature ">
  503. <span class="phpdocumentor-signature__visibility">public</span>
  504. <span class="phpdocumentor-signature__name">getBlackMatrix</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span></code>
  505. <section class="phpdocumentor-description"><p>Converts a 2D array of luminance data to 1 bit data. As above, assume this method is expensive
  506. and do not call it repeatedly. This method is intended for decoding 2D barcodes and may or
  507. may not apply sharpening. Therefore, a row from this matrix may not be identical to one
  508. fetched using getBlackRow(), so don't mix and match between them.</p>
  509. </section>
  510. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  511. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  512. &mdash;
  513. <section class="phpdocumentor-description"><p>The 2D array of bits for the image (true means black).</p>
  514. </section>
  515. </article>
  516. <article
  517. class="phpdocumentor-element
  518. -method
  519. -private
  520. "
  521. >
  522. <h4 class="phpdocumentor-element__name" id="method_calculateBlackPoints">
  523. calculateBlackPoints()
  524. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints" class="headerlink"><i class="fas fa-link"></i></a>
  525. </h4>
  526. <aside class="phpdocumentor-element-found-in">
  527. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  528. :
  529. <span class="phpdocumentor-element-found-in__line">207</span>
  530. </aside>
  531. <p class="phpdocumentor-summary">Calculates a single black point for each block of pixels and saves it away.</p>
  532. <code class="phpdocumentor-code phpdocumentor-signature ">
  533. <span class="phpdocumentor-signature__visibility">private</span>
  534. <span class="phpdocumentor-signature__name">calculateBlackPoints</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$subWidth</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$subHeight</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$width</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$height</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span></code>
  535. <section class="phpdocumentor-description"><p>See the following thread for a discussion of this algorithm:</p>
  536. </section>
  537. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  538. <dl class="phpdocumentor-argument-list">
  539. <dt class="phpdocumentor-argument-list__entry">
  540. <span class="phpdocumentor-signature__argument__name">$subWidth</span>
  541. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  542. </dt>
  543. <dd class="phpdocumentor-argument-list__definition">
  544. <section class="phpdocumentor-description"></section>
  545. </dd>
  546. <dt class="phpdocumentor-argument-list__entry">
  547. <span class="phpdocumentor-signature__argument__name">$subHeight</span>
  548. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  549. </dt>
  550. <dd class="phpdocumentor-argument-list__definition">
  551. <section class="phpdocumentor-description"></section>
  552. </dd>
  553. <dt class="phpdocumentor-argument-list__entry">
  554. <span class="phpdocumentor-signature__argument__name">$width</span>
  555. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  556. </dt>
  557. <dd class="phpdocumentor-argument-list__definition">
  558. <section class="phpdocumentor-description"></section>
  559. </dd>
  560. <dt class="phpdocumentor-argument-list__entry">
  561. <span class="phpdocumentor-signature__argument__name">$height</span>
  562. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  563. </dt>
  564. <dd class="phpdocumentor-argument-list__definition">
  565. <section class="phpdocumentor-description"></section>
  566. </dd>
  567. </dl>
  568. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  569. Tags
  570. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  571. </h5>
  572. <dl class="phpdocumentor-tag-list">
  573. <dt class="phpdocumentor-tag-list__entry">
  574. <span class="phpdocumentor-tag__name">see</span>
  575. </dt>
  576. <dd class="phpdocumentor-tag-list__definition">
  577. <span class="phpdocumentor-tag-link"><a href="http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0"><abbr title="http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0">http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0</abbr></a></span>
  578. </dd>
  579. </dl>
  580. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  581. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  582. &mdash;
  583. </article>
  584. <article
  585. class="phpdocumentor-element
  586. -method
  587. -private
  588. "
  589. >
  590. <h4 class="phpdocumentor-element__name" id="method_calculateThresholdForBlock">
  591. calculateThresholdForBlock()
  592. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateThresholdForBlock" class="headerlink"><i class="fas fa-link"></i></a>
  593. </h4>
  594. <aside class="phpdocumentor-element-found-in">
  595. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  596. :
  597. <span class="phpdocumentor-element-found-in__line">298</span>
  598. </aside>
  599. <p class="phpdocumentor-summary">For each block in the image, calculate the average black point using a 5x5 grid
  600. of the surrounding blocks. Also handles the corner cases (fractional blocks are computed based
  601. on the last pixels in the row/column which are also used in the previous block).</p>
  602. <code class="phpdocumentor-code phpdocumentor-signature ">
  603. <span class="phpdocumentor-signature__visibility">private</span>
  604. <span class="phpdocumentor-signature__name">calculateThresholdForBlock</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$subWidth</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$subHeight</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$width</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$height</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span></code>
  605. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  606. <dl class="phpdocumentor-argument-list">
  607. <dt class="phpdocumentor-argument-list__entry">
  608. <span class="phpdocumentor-signature__argument__name">$subWidth</span>
  609. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  610. </dt>
  611. <dd class="phpdocumentor-argument-list__definition">
  612. <section class="phpdocumentor-description"></section>
  613. </dd>
  614. <dt class="phpdocumentor-argument-list__entry">
  615. <span class="phpdocumentor-signature__argument__name">$subHeight</span>
  616. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  617. </dt>
  618. <dd class="phpdocumentor-argument-list__definition">
  619. <section class="phpdocumentor-description"></section>
  620. </dd>
  621. <dt class="phpdocumentor-argument-list__entry">
  622. <span class="phpdocumentor-signature__argument__name">$width</span>
  623. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  624. </dt>
  625. <dd class="phpdocumentor-argument-list__definition">
  626. <section class="phpdocumentor-description"></section>
  627. </dd>
  628. <dt class="phpdocumentor-argument-list__entry">
  629. <span class="phpdocumentor-signature__argument__name">$height</span>
  630. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  631. </dt>
  632. <dd class="phpdocumentor-argument-list__definition">
  633. <section class="phpdocumentor-description"></section>
  634. </dd>
  635. </dl>
  636. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  637. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  638. &mdash;
  639. </article>
  640. <article
  641. class="phpdocumentor-element
  642. -method
  643. -private
  644. "
  645. >
  646. <h4 class="phpdocumentor-element__name" id="method_cap">
  647. cap()
  648. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_cap" class="headerlink"><i class="fas fa-link"></i></a>
  649. </h4>
  650. <aside class="phpdocumentor-element-found-in">
  651. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  652. :
  653. <span class="phpdocumentor-element-found-in__line">347</span>
  654. </aside>
  655. <code class="phpdocumentor-code phpdocumentor-signature ">
  656. <span class="phpdocumentor-signature__visibility">private</span>
  657. <span class="phpdocumentor-signature__name">cap</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$value</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$min</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$max</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  658. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  659. <dl class="phpdocumentor-argument-list">
  660. <dt class="phpdocumentor-argument-list__entry">
  661. <span class="phpdocumentor-signature__argument__name">$value</span>
  662. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  663. </dt>
  664. <dd class="phpdocumentor-argument-list__definition">
  665. <section class="phpdocumentor-description"></section>
  666. </dd>
  667. <dt class="phpdocumentor-argument-list__entry">
  668. <span class="phpdocumentor-signature__argument__name">$min</span>
  669. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  670. </dt>
  671. <dd class="phpdocumentor-argument-list__definition">
  672. <section class="phpdocumentor-description"></section>
  673. </dd>
  674. <dt class="phpdocumentor-argument-list__entry">
  675. <span class="phpdocumentor-signature__argument__name">$max</span>
  676. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  677. </dt>
  678. <dd class="phpdocumentor-argument-list__definition">
  679. <section class="phpdocumentor-description"></section>
  680. </dd>
  681. </dl>
  682. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  683. Tags
  684. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  685. </h5>
  686. <dl class="phpdocumentor-tag-list">
  687. <dt class="phpdocumentor-tag-list__entry">
  688. <span class="phpdocumentor-tag__name">noinspection</span>
  689. </dt>
  690. <dd class="phpdocumentor-tag-list__definition">
  691. <section class="phpdocumentor-description"><p>PhpSameParameterValueInspection</p>
  692. </section>
  693. </dd>
  694. </dl>
  695. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  696. <span class="phpdocumentor-signature__response_type">int</span>
  697. &mdash;
  698. </article>
  699. <article
  700. class="phpdocumentor-element
  701. -method
  702. -private
  703. "
  704. >
  705. <h4 class="phpdocumentor-element__name" id="method_estimateBlackPoint">
  706. estimateBlackPoint()
  707. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_estimateBlackPoint" class="headerlink"><i class="fas fa-link"></i></a>
  708. </h4>
  709. <aside class="phpdocumentor-element-found-in">
  710. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  711. :
  712. <span class="phpdocumentor-element-found-in__line">62</span>
  713. </aside>
  714. <code class="phpdocumentor-code phpdocumentor-signature ">
  715. <span class="phpdocumentor-signature__visibility">private</span>
  716. <span class="phpdocumentor-signature__name">estimateBlackPoint</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$buckets</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  717. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  718. <dl class="phpdocumentor-argument-list">
  719. <dt class="phpdocumentor-argument-list__entry">
  720. <span class="phpdocumentor-signature__argument__name">$buckets</span>
  721. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  722. </dt>
  723. <dd class="phpdocumentor-argument-list__definition">
  724. <section class="phpdocumentor-description"></section>
  725. </dd>
  726. </dl>
  727. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  728. Tags
  729. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  730. </h5>
  731. <dl class="phpdocumentor-tag-list">
  732. <dt class="phpdocumentor-tag-list__entry">
  733. <span class="phpdocumentor-tag__name">throws</span>
  734. </dt>
  735. <dd class="phpdocumentor-tag-list__definition">
  736. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Decoder-QRCodeDecoderException.html"><abbr title="\chillerlan\QRCode\Decoder\QRCodeDecoderException">QRCodeDecoderException</abbr></a></span>
  737. </dd>
  738. </dl>
  739. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  740. <span class="phpdocumentor-signature__response_type">int</span>
  741. &mdash;
  742. </article>
  743. <article
  744. class="phpdocumentor-element
  745. -method
  746. -private
  747. "
  748. >
  749. <h4 class="phpdocumentor-element__name" id="method_getHistogramBlackMatrix">
  750. getHistogramBlackMatrix()
  751. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getHistogramBlackMatrix" class="headerlink"><i class="fas fa-link"></i></a>
  752. </h4>
  753. <aside class="phpdocumentor-element-found-in">
  754. <abbr class="phpdocumentor-element-found-in__file" title="src/Decoder/Binarizer.php"><a href="files/src-decoder-binarizer.html"><abbr title="src/Decoder/Binarizer.php">Binarizer.php</abbr></a></abbr>
  755. :
  756. <span class="phpdocumentor-element-found-in__line">165</span>
  757. </aside>
  758. <code class="phpdocumentor-code phpdocumentor-signature ">
  759. <span class="phpdocumentor-signature__visibility">private</span>
  760. <span class="phpdocumentor-signature__name">getHistogramBlackMatrix</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$width</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$height</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span></code>
  761. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  762. <dl class="phpdocumentor-argument-list">
  763. <dt class="phpdocumentor-argument-list__entry">
  764. <span class="phpdocumentor-signature__argument__name">$width</span>
  765. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  766. </dt>
  767. <dd class="phpdocumentor-argument-list__definition">
  768. <section class="phpdocumentor-description"></section>
  769. </dd>
  770. <dt class="phpdocumentor-argument-list__entry">
  771. <span class="phpdocumentor-signature__argument__name">$height</span>
  772. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  773. </dt>
  774. <dd class="phpdocumentor-argument-list__definition">
  775. <section class="phpdocumentor-description"></section>
  776. </dd>
  777. </dl>
  778. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  779. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  780. &mdash;
  781. </article>
  782. </section>
  783. <script type="text/javascript">
  784. function loadExternalCodeSnippets(line) {
  785. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  786. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  787. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  788. var language = 'php';
  789. var code = document.createElement('code');
  790. code.className = 'language-' + language;
  791. pre.textContent = '';
  792. pre.setAttribute('data-line', line)
  793. code.textContent = 'Loading…';
  794. pre.appendChild(code);
  795. var xhr = new XMLHttpRequest();
  796. xhr.open('GET', src, true);
  797. xhr.onreadystatechange = function () {
  798. if (xhr.readyState == 4) {
  799. if (xhr.status < 400 && xhr.responseText) {
  800. code.textContent = xhr.responseText;
  801. Prism.highlightElement(code);
  802. }
  803. else if (xhr.status >= 400) {
  804. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  805. }
  806. else {
  807. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  808. }
  809. }
  810. };
  811. xhr.send(null);
  812. });
  813. }
  814. var modals = document.querySelectorAll("[data-modal]");
  815. modals.forEach(function (trigger) {
  816. trigger.addEventListener("click", function (event) {
  817. //event.preventDefault();
  818. const modal = document.getElementById(trigger.dataset.modal);
  819. modal.classList.add("phpdocumentor-modal__open");
  820. loadExternalCodeSnippets(trigger.dataset.line)
  821. const exits = modal.querySelectorAll("[data-exit-button]");
  822. exits.forEach(function (exit) {
  823. exit.addEventListener("click", function (event) {
  824. event.preventDefault();
  825. modal.classList.remove("phpdocumentor-modal__open");
  826. });
  827. });
  828. });
  829. });
  830. </script>
  831. </article>
  832. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  833. <section class="phpdocumentor-search-results__dialog">
  834. <header class="phpdocumentor-search-results__header">
  835. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  836. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  837. </header>
  838. <section class="phpdocumentor-search-results__body">
  839. <ul class="phpdocumentor-search-results__entries"></ul>
  840. </section>
  841. </section>
  842. </section>
  843. </div>
  844. </div>
  845. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  846. </main>
  847. <script>
  848. cssVars({});
  849. </script>
  850. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  851. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  852. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  853. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  854. </body>
  855. </html>