chillerlan-QRCode-Decoder-Binarizer.html 51 KB

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