chillerlan-QRCode-Decoder-Binarizer.html 60 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255
  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=Open+Sans:wght@100;200;300;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/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. <li class="phpdocumentor-topnav__menu-item -social">
  59. <a href="https://github.com/chillerlan/php-qrcode/discussions">
  60. <span>
  61. <i class="fas fa-envelope-open-text"></i>
  62. </span>
  63. </a>
  64. </li>
  65. </ul>
  66. </nav>
  67. </header>
  68. <main class="phpdocumentor">
  69. <div class="phpdocumentor-section">
  70. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  71. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  72. Menu
  73. </label>
  74. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  75. <section class="phpdocumentor-sidebar__category -namespaces">
  76. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  77. <h4 class="phpdocumentor-sidebar__root-namespace">
  78. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  79. </h4>
  80. <ul class="phpdocumentor-list">
  81. <li>
  82. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  83. </li>
  84. <li>
  85. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  86. </li>
  87. </ul>
  88. <h4 class="phpdocumentor-sidebar__root-namespace">
  89. <a href="namespaces/output.html" class="">Output</a>
  90. </h4>
  91. </section>
  92. <section class="phpdocumentor-sidebar__category -packages">
  93. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  94. <h4 class="phpdocumentor-sidebar__root-namespace">
  95. <a href="packages/Application.html" class="">Application</a>
  96. </h4>
  97. </section>
  98. <section class="phpdocumentor-sidebar__category -reports">
  99. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  100. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  101. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  102. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  103. </section>
  104. <section class="phpdocumentor-sidebar__category -indices">
  105. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  106. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  107. </section>
  108. </aside>
  109. <div class="phpdocumentor-column -nine phpdocumentor-content">
  110. <section>
  111. <ul class="phpdocumentor-breadcrumbs">
  112. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  113. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  114. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-decoder.html">Decoder</a></li>
  115. </ul>
  116. <article class="phpdocumentor-element -class">
  117. <h2 class="phpdocumentor-content__title">
  118. Binarizer
  119. <div class="phpdocumentor-element__package">
  120. in package
  121. <ul class="phpdocumentor-breadcrumbs">
  122. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  123. </ul>
  124. </div>
  125. </h2>
  126. <div class="phpdocumentor-label-line">
  127. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  128. </div>
  129. <aside class="phpdocumentor-element-found-in">
  130. <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>
  131. :
  132. <span class="phpdocumentor-element-found-in__line">35</span>
  133. </aside>
  134. <p class="phpdocumentor-summary">This class implements a local thresholding algorithm, which while slower than the
  135. GlobalHistogramBinarizer, is fairly efficient for what it does. It is designed for
  136. high frequency images of barcodes with black data on white backgrounds. For this application,
  137. it does a much better job than a global blackpoint with severe shadows and gradients.</p>
  138. <section class="phpdocumentor-description"><p>However, it tends to produce artifacts on lower frequency images and is therefore not
  139. a good general purpose binarizer for uses outside ZXing.</p>
  140. <p>This class extends GlobalHistogramBinarizer, using the older histogram approach for 1D readers,
  141. and the newer local approach for 2D readers. 1D decoding using a per-row histogram is already
  142. inherently local, and only fails for horizontal gradients. We can revisit that problem later,
  143. but for now it was not a win to use local blocks for 1D.</p>
  144. <p>This Binarizer is the default for the unit tests and the recommended class for library users.</p>
  145. </section>
  146. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  147. Tags
  148. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  149. </h5>
  150. <dl class="phpdocumentor-tag-list">
  151. <dt class="phpdocumentor-tag-list__entry">
  152. <span class="phpdocumentor-tag__name">author</span>
  153. </dt>
  154. <dd class="phpdocumentor-tag-list__definition">
  155. <section class="phpdocumentor-description"><p>dswitkin@google.com (Daniel Switkin)</p>
  156. </section>
  157. </dd>
  158. </dl>
  159. <h3 id="toc">
  160. Table of Contents
  161. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  162. </h3>
  163. <h4 id="toc-constants">
  164. Constants
  165. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-constants" class="headerlink"><i class="fas fa-link"></i></a>
  166. </h4>
  167. <dl class="phpdocumentor-table-of-contents">
  168. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  169. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE">BLOCK_SIZE</a>
  170. <span>
  171. &nbsp;= 8 </span>
  172. </dt>
  173. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  174. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_MASK">BLOCK_SIZE_MASK</a>
  175. <span>
  176. &nbsp;= 7 </span>
  177. </dt>
  178. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  179. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_POWER">BLOCK_SIZE_POWER</a>
  180. <span>
  181. &nbsp;= 3 </span>
  182. </dt>
  183. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  184. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_BUCKETS">LUMINANCE_BUCKETS</a>
  185. <span>
  186. &nbsp;= 32 </span>
  187. </dt>
  188. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  189. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_SHIFT">LUMINANCE_SHIFT</a>
  190. <span>
  191. &nbsp;= 3 </span>
  192. </dt>
  193. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  194. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MIN_DYNAMIC_RANGE">MIN_DYNAMIC_RANGE</a>
  195. <span>
  196. &nbsp;= 24 </span>
  197. </dt>
  198. <dt class="phpdocumentor-table-of-contents__entry -constant -private">
  199. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MINIMUM_DIMENSION">MINIMUM_DIMENSION</a>
  200. <span>
  201. &nbsp;= 40 </span>
  202. </dt>
  203. </dl>
  204. <h4 id="toc-properties">
  205. Properties
  206. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  207. </h4>
  208. <dl class="phpdocumentor-table-of-contents">
  209. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  210. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_luminances">$luminances</a>
  211. <span>
  212. &nbsp;: array&lt;string|int, mixed&gt; </span>
  213. </dt>
  214. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  215. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_source">$source</a>
  216. <span>
  217. &nbsp;: <a href="classes/chillerlan-QRCode-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a> </span>
  218. </dt>
  219. </dl>
  220. <h4 id="toc-methods">
  221. Methods
  222. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  223. </h4>
  224. <dl class="phpdocumentor-table-of-contents">
  225. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  226. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method___construct">__construct()</a>
  227. <span>
  228. &nbsp;: mixed </span>
  229. </dt>
  230. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  231. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getBlackMatrix">getBlackMatrix()</a>
  232. <span>
  233. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  234. </dt>
  235. <dd>Calculates the final BitMatrix once for all requests. This could be called once from the
  236. constructor instead, but there are some advantages to doing it lazily, such as making
  237. profiling easier, and not doing heavy lifting when callers don&#039;t expect it.</dd>
  238. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  239. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints">calculateBlackPoints()</a>
  240. <span>
  241. &nbsp;: array&lt;string|int, mixed&gt; </span>
  242. </dt>
  243. <dd>Calculates a single black point for each block of pixels and saves it away.</dd>
  244. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  245. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateThresholdForBlock">calculateThresholdForBlock()</a>
  246. <span>
  247. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  248. </dt>
  249. <dd>For each block in the image, calculate the average black point using a 5x5 grid
  250. of the surrounding blocks. Also handles the corner cases (fractional blocks are computed based
  251. on the last pixels in the row/column which are also used in the previous block).</dd>
  252. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  253. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_cap">cap()</a>
  254. <span>
  255. &nbsp;: int </span>
  256. </dt>
  257. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  258. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_estimateBlackPoint">estimateBlackPoint()</a>
  259. <span>
  260. &nbsp;: int </span>
  261. </dt>
  262. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  263. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getHistogramBlackMatrix">getHistogramBlackMatrix()</a>
  264. <span>
  265. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  266. </dt>
  267. </dl>
  268. <section class="phpdocumentor-constants">
  269. <h3 class="phpdocumentor-elements__header" id="constants">
  270. Constants
  271. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  272. </h3>
  273. <article class="phpdocumentor-element -constant -private ">
  274. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE">
  275. BLOCK_SIZE
  276. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE" class="headerlink"><i class="fas fa-link"></i></a>
  277. </h4>
  278. <aside class="phpdocumentor-element-found-in">
  279. <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>
  280. :
  281. <span class="phpdocumentor-element-found-in__line">40</span>
  282. </aside>
  283. <code class="phpdocumentor-signature phpdocumentor-code ">
  284. <span class="phpdocumentor-signature__visibility">private</span>
  285. <span class="phpdocumentor-signature__type">mixed</span>
  286. <span class="phpdocumentor-signature__name">BLOCK_SIZE</span>
  287. = <span class="phpdocumentor-signature__default-value">8</span>
  288. </code>
  289. </article>
  290. <article class="phpdocumentor-element -constant -private ">
  291. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE_MASK">
  292. BLOCK_SIZE_MASK
  293. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_MASK" class="headerlink"><i class="fas fa-link"></i></a>
  294. </h4>
  295. <aside class="phpdocumentor-element-found-in">
  296. <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>
  297. :
  298. <span class="phpdocumentor-element-found-in__line">41</span>
  299. </aside>
  300. <code class="phpdocumentor-signature phpdocumentor-code ">
  301. <span class="phpdocumentor-signature__visibility">private</span>
  302. <span class="phpdocumentor-signature__type">mixed</span>
  303. <span class="phpdocumentor-signature__name">BLOCK_SIZE_MASK</span>
  304. = <span class="phpdocumentor-signature__default-value">7</span>
  305. </code>
  306. </article>
  307. <article class="phpdocumentor-element -constant -private ">
  308. <h4 class="phpdocumentor-element__name" id="constant_BLOCK_SIZE_POWER">
  309. BLOCK_SIZE_POWER
  310. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_POWER" 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">39</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">BLOCK_SIZE_POWER</span>
  321. = <span class="phpdocumentor-signature__default-value">3</span>
  322. </code>
  323. </article>
  324. <article class="phpdocumentor-element -constant -private ">
  325. <h4 class="phpdocumentor-element__name" id="constant_LUMINANCE_BUCKETS">
  326. LUMINANCE_BUCKETS
  327. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_BUCKETS" class="headerlink"><i class="fas fa-link"></i></a>
  328. </h4>
  329. <aside class="phpdocumentor-element-found-in">
  330. <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>
  331. :
  332. <span class="phpdocumentor-element-found-in__line">47</span>
  333. </aside>
  334. <code class="phpdocumentor-signature phpdocumentor-code ">
  335. <span class="phpdocumentor-signature__visibility">private</span>
  336. <span class="phpdocumentor-signature__type">mixed</span>
  337. <span class="phpdocumentor-signature__name">LUMINANCE_BUCKETS</span>
  338. = <span class="phpdocumentor-signature__default-value">32</span>
  339. </code>
  340. </article>
  341. <article class="phpdocumentor-element -constant -private ">
  342. <h4 class="phpdocumentor-element__name" id="constant_LUMINANCE_SHIFT">
  343. LUMINANCE_SHIFT
  344. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_SHIFT" class="headerlink"><i class="fas fa-link"></i></a>
  345. </h4>
  346. <aside class="phpdocumentor-element-found-in">
  347. <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>
  348. :
  349. <span class="phpdocumentor-element-found-in__line">46</span>
  350. </aside>
  351. <code class="phpdocumentor-signature phpdocumentor-code ">
  352. <span class="phpdocumentor-signature__visibility">private</span>
  353. <span class="phpdocumentor-signature__type">mixed</span>
  354. <span class="phpdocumentor-signature__name">LUMINANCE_SHIFT</span>
  355. = <span class="phpdocumentor-signature__default-value">3</span>
  356. </code>
  357. </article>
  358. <article class="phpdocumentor-element -constant -private ">
  359. <h4 class="phpdocumentor-element__name" id="constant_MIN_DYNAMIC_RANGE">
  360. MIN_DYNAMIC_RANGE
  361. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MIN_DYNAMIC_RANGE" class="headerlink"><i class="fas fa-link"></i></a>
  362. </h4>
  363. <aside class="phpdocumentor-element-found-in">
  364. <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>
  365. :
  366. <span class="phpdocumentor-element-found-in__line">43</span>
  367. </aside>
  368. <code class="phpdocumentor-signature phpdocumentor-code ">
  369. <span class="phpdocumentor-signature__visibility">private</span>
  370. <span class="phpdocumentor-signature__type">mixed</span>
  371. <span class="phpdocumentor-signature__name">MIN_DYNAMIC_RANGE</span>
  372. = <span class="phpdocumentor-signature__default-value">24</span>
  373. </code>
  374. </article>
  375. <article class="phpdocumentor-element -constant -private ">
  376. <h4 class="phpdocumentor-element__name" id="constant_MINIMUM_DIMENSION">
  377. MINIMUM_DIMENSION
  378. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MINIMUM_DIMENSION" class="headerlink"><i class="fas fa-link"></i></a>
  379. </h4>
  380. <aside class="phpdocumentor-element-found-in">
  381. <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>
  382. :
  383. <span class="phpdocumentor-element-found-in__line">42</span>
  384. </aside>
  385. <code class="phpdocumentor-signature phpdocumentor-code ">
  386. <span class="phpdocumentor-signature__visibility">private</span>
  387. <span class="phpdocumentor-signature__type">mixed</span>
  388. <span class="phpdocumentor-signature__name">MINIMUM_DIMENSION</span>
  389. = <span class="phpdocumentor-signature__default-value">40</span>
  390. </code>
  391. </article>
  392. </section>
  393. <section class="phpdocumentor-properties">
  394. <h3 class="phpdocumentor-elements__header" id="properties">
  395. Properties
  396. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  397. </h3>
  398. <article
  399. class="
  400. phpdocumentor-element
  401. -property
  402. -private
  403. "
  404. >
  405. <h4 class="phpdocumentor-element__name" id="property_luminances">
  406. $luminances
  407. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_luminances" class="headerlink"><i class="fas fa-link"></i></a>
  408. <span class="phpdocumentor-element__modifiers">
  409. </span>
  410. </h4>
  411. <aside class="phpdocumentor-element-found-in">
  412. <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>
  413. :
  414. <span class="phpdocumentor-element-found-in__line">50</span>
  415. </aside>
  416. <code class="phpdocumentor-code phpdocumentor-signature ">
  417. <span class="phpdocumentor-signature__visibility">private</span>
  418. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  419. <span class="phpdocumentor-signature__name">$luminances</span>
  420. </code>
  421. </article>
  422. <article
  423. class="
  424. phpdocumentor-element
  425. -property
  426. -private
  427. "
  428. >
  429. <h4 class="phpdocumentor-element__name" id="property_source">
  430. $source
  431. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_source" class="headerlink"><i class="fas fa-link"></i></a>
  432. <span class="phpdocumentor-element__modifiers">
  433. </span>
  434. </h4>
  435. <aside class="phpdocumentor-element-found-in">
  436. <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>
  437. :
  438. <span class="phpdocumentor-element-found-in__line">49</span>
  439. </aside>
  440. <code class="phpdocumentor-code phpdocumentor-signature ">
  441. <span class="phpdocumentor-signature__visibility">private</span>
  442. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a></span>
  443. <span class="phpdocumentor-signature__name">$source</span>
  444. </code>
  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">55</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-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\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. <div class="phpdocumentor-label-line">
  471. </div>
  472. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  473. <dl class="phpdocumentor-argument-list">
  474. <dt class="phpdocumentor-argument-list__entry">
  475. <span class="phpdocumentor-signature__argument__name">$source</span>
  476. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a></span>
  477. </dt>
  478. <dd class="phpdocumentor-argument-list__definition">
  479. </dd>
  480. </dl>
  481. </article>
  482. <article
  483. class="phpdocumentor-element
  484. -method
  485. -public
  486. "
  487. >
  488. <h4 class="phpdocumentor-element__name" id="method_getBlackMatrix">
  489. getBlackMatrix()
  490. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getBlackMatrix" class="headerlink"><i class="fas fa-link"></i></a>
  491. </h4>
  492. <aside class="phpdocumentor-element-found-in">
  493. <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>
  494. :
  495. <span class="phpdocumentor-element-found-in__line">139</span>
  496. </aside>
  497. <p class="phpdocumentor-summary">Calculates the final BitMatrix once for all requests. This could be called once from the
  498. constructor instead, but there are some advantages to doing it lazily, such as making
  499. profiling easier, and not doing heavy lifting when callers don&#039;t expect it.</p>
  500. <code class="phpdocumentor-code phpdocumentor-signature ">
  501. <span class="phpdocumentor-signature__visibility">public</span>
  502. <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>
  503. <div class="phpdocumentor-label-line">
  504. </div>
  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. <section>
  511. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  512. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  513. &mdash;
  514. <section class="phpdocumentor-description"><p>The 2D array of bits for the image (true means black).</p>
  515. </section>
  516. </section>
  517. </article>
  518. <article
  519. class="phpdocumentor-element
  520. -method
  521. -private
  522. "
  523. >
  524. <h4 class="phpdocumentor-element__name" id="method_calculateBlackPoints">
  525. calculateBlackPoints()
  526. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints" class="headerlink"><i class="fas fa-link"></i></a>
  527. </h4>
  528. <aside class="phpdocumentor-element-found-in">
  529. <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>
  530. :
  531. <span class="phpdocumentor-element-found-in__line">208</span>
  532. </aside>
  533. <p class="phpdocumentor-summary">Calculates a single black point for each block of pixels and saves it away.</p>
  534. <code class="phpdocumentor-code phpdocumentor-signature ">
  535. <span class="phpdocumentor-signature__visibility">private</span>
  536. <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>
  537. <div class="phpdocumentor-label-line">
  538. </div>
  539. <section class="phpdocumentor-description"><p>See the following thread for a discussion of this algorithm:</p>
  540. </section>
  541. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  542. <dl class="phpdocumentor-argument-list">
  543. <dt class="phpdocumentor-argument-list__entry">
  544. <span class="phpdocumentor-signature__argument__name">$subWidth</span>
  545. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  546. </dt>
  547. <dd class="phpdocumentor-argument-list__definition">
  548. </dd>
  549. <dt class="phpdocumentor-argument-list__entry">
  550. <span class="phpdocumentor-signature__argument__name">$subHeight</span>
  551. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  552. </dt>
  553. <dd class="phpdocumentor-argument-list__definition">
  554. </dd>
  555. <dt class="phpdocumentor-argument-list__entry">
  556. <span class="phpdocumentor-signature__argument__name">$width</span>
  557. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  558. </dt>
  559. <dd class="phpdocumentor-argument-list__definition">
  560. </dd>
  561. <dt class="phpdocumentor-argument-list__entry">
  562. <span class="phpdocumentor-signature__argument__name">$height</span>
  563. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  564. </dt>
  565. <dd class="phpdocumentor-argument-list__definition">
  566. </dd>
  567. </dl>
  568. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  569. Tags
  570. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints#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">http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0</a></span>
  578. </dd>
  579. </dl>
  580. <section>
  581. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  582. <span class="phpdocumentor-signature__response_type">array&lt;string|int, mixed&gt;</span>
  583. </section>
  584. </article>
  585. <article
  586. class="phpdocumentor-element
  587. -method
  588. -private
  589. "
  590. >
  591. <h4 class="phpdocumentor-element__name" id="method_calculateThresholdForBlock">
  592. calculateThresholdForBlock()
  593. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateThresholdForBlock" class="headerlink"><i class="fas fa-link"></i></a>
  594. </h4>
  595. <aside class="phpdocumentor-element-found-in">
  596. <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>
  597. :
  598. <span class="phpdocumentor-element-found-in__line">299</span>
  599. </aside>
  600. <p class="phpdocumentor-summary">For each block in the image, calculate the average black point using a 5x5 grid
  601. of the surrounding blocks. Also handles the corner cases (fractional blocks are computed based
  602. on the last pixels in the row/column which are also used in the previous block).</p>
  603. <code class="phpdocumentor-code phpdocumentor-signature ">
  604. <span class="phpdocumentor-signature__visibility">private</span>
  605. <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>
  606. <div class="phpdocumentor-label-line">
  607. </div>
  608. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  609. <dl class="phpdocumentor-argument-list">
  610. <dt class="phpdocumentor-argument-list__entry">
  611. <span class="phpdocumentor-signature__argument__name">$subWidth</span>
  612. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  613. </dt>
  614. <dd class="phpdocumentor-argument-list__definition">
  615. </dd>
  616. <dt class="phpdocumentor-argument-list__entry">
  617. <span class="phpdocumentor-signature__argument__name">$subHeight</span>
  618. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  619. </dt>
  620. <dd class="phpdocumentor-argument-list__definition">
  621. </dd>
  622. <dt class="phpdocumentor-argument-list__entry">
  623. <span class="phpdocumentor-signature__argument__name">$width</span>
  624. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  625. </dt>
  626. <dd class="phpdocumentor-argument-list__definition">
  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. </dd>
  634. </dl>
  635. <section>
  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. </section>
  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">348</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. <div class="phpdocumentor-label-line">
  659. </div>
  660. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  661. <dl class="phpdocumentor-argument-list">
  662. <dt class="phpdocumentor-argument-list__entry">
  663. <span class="phpdocumentor-signature__argument__name">$value</span>
  664. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  665. </dt>
  666. <dd class="phpdocumentor-argument-list__definition">
  667. </dd>
  668. <dt class="phpdocumentor-argument-list__entry">
  669. <span class="phpdocumentor-signature__argument__name">$min</span>
  670. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  671. </dt>
  672. <dd class="phpdocumentor-argument-list__definition">
  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. </dd>
  680. </dl>
  681. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  682. Tags
  683. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_cap#tags" class="headerlink"><i class="fas fa-link"></i></a>
  684. </h5>
  685. <dl class="phpdocumentor-tag-list">
  686. <dt class="phpdocumentor-tag-list__entry">
  687. <span class="phpdocumentor-tag__name">noinspection</span>
  688. </dt>
  689. <dd class="phpdocumentor-tag-list__definition">
  690. <section class="phpdocumentor-description"><p>PhpSameParameterValueInspection</p>
  691. </section>
  692. </dd>
  693. </dl>
  694. <section>
  695. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  696. <span class="phpdocumentor-signature__response_type">int</span>
  697. </section>
  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">63</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. <div class="phpdocumentor-label-line">
  718. </div>
  719. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  720. <dl class="phpdocumentor-argument-list">
  721. <dt class="phpdocumentor-argument-list__entry">
  722. <span class="phpdocumentor-signature__argument__name">$buckets</span>
  723. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  724. </dt>
  725. <dd class="phpdocumentor-argument-list__definition">
  726. </dd>
  727. </dl>
  728. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  729. Tags
  730. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_estimateBlackPoint#tags" class="headerlink"><i class="fas fa-link"></i></a>
  731. </h5>
  732. <dl class="phpdocumentor-tag-list">
  733. <dt class="phpdocumentor-tag-list__entry">
  734. <span class="phpdocumentor-tag__name">throws</span>
  735. </dt>
  736. <dd class="phpdocumentor-tag-list__definition">
  737. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Decoder-QRCodeDecoderException.html"><abbr title="\chillerlan\QRCode\Decoder\QRCodeDecoderException">QRCodeDecoderException</abbr></a></span>
  738. </dd>
  739. </dl>
  740. <section>
  741. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  742. <span class="phpdocumentor-signature__response_type">int</span>
  743. </section>
  744. </article>
  745. <article
  746. class="phpdocumentor-element
  747. -method
  748. -private
  749. "
  750. >
  751. <h4 class="phpdocumentor-element__name" id="method_getHistogramBlackMatrix">
  752. getHistogramBlackMatrix()
  753. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getHistogramBlackMatrix" class="headerlink"><i class="fas fa-link"></i></a>
  754. </h4>
  755. <aside class="phpdocumentor-element-found-in">
  756. <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>
  757. :
  758. <span class="phpdocumentor-element-found-in__line">166</span>
  759. </aside>
  760. <code class="phpdocumentor-code phpdocumentor-signature ">
  761. <span class="phpdocumentor-signature__visibility">private</span>
  762. <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>
  763. <div class="phpdocumentor-label-line">
  764. </div>
  765. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  766. <dl class="phpdocumentor-argument-list">
  767. <dt class="phpdocumentor-argument-list__entry">
  768. <span class="phpdocumentor-signature__argument__name">$width</span>
  769. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  770. </dt>
  771. <dd class="phpdocumentor-argument-list__definition">
  772. </dd>
  773. <dt class="phpdocumentor-argument-list__entry">
  774. <span class="phpdocumentor-signature__argument__name">$height</span>
  775. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  776. </dt>
  777. <dd class="phpdocumentor-argument-list__definition">
  778. </dd>
  779. </dl>
  780. <section>
  781. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  782. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  783. </section>
  784. </article>
  785. </section>
  786. <div class="phpdocumentor-modal" id="source-view">
  787. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  788. <div class="phpdocumentor-modal-container">
  789. <div class="phpdocumentor-modal-content">
  790. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Decoder/Binarizer.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  791. </div>
  792. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  793. </div>
  794. </div>
  795. <script type="text/javascript">
  796. (function () {
  797. function loadExternalCodeSnippet(el, url, line) {
  798. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  799. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  800. const language = 'php';
  801. const code = document.createElement('code');
  802. code.className = 'language-' + language;
  803. pre.textContent = '';
  804. pre.setAttribute('data-line', line)
  805. code.textContent = 'Loading…';
  806. pre.appendChild(code);
  807. var xhr = new XMLHttpRequest();
  808. xhr.open('GET', src, true);
  809. xhr.onreadystatechange = function () {
  810. if (xhr.readyState !== 4) {
  811. return;
  812. }
  813. if (xhr.status < 400 && xhr.responseText) {
  814. code.textContent = xhr.responseText;
  815. Prism.highlightElement(code);
  816. return;
  817. }
  818. if (xhr.status === 404) {
  819. code.textContent = '✖ Error: File could not be found';
  820. return;
  821. }
  822. if (xhr.status >= 400) {
  823. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  824. return;
  825. }
  826. code.textContent = '✖ Error: An unknown error occurred';
  827. };
  828. xhr.send(null);
  829. });
  830. }
  831. const modalButtons = document.querySelectorAll("[data-modal]");
  832. const openedAsLocalFile = window.location.protocol === 'file:';
  833. if (modalButtons.length > 0 && openedAsLocalFile) {
  834. console.warn(
  835. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  836. 'browsers block XHR requests when a page is opened this way'
  837. );
  838. }
  839. modalButtons.forEach(function (trigger) {
  840. if (openedAsLocalFile) {
  841. trigger.setAttribute("hidden", "hidden");
  842. }
  843. trigger.addEventListener("click", function (event) {
  844. event.preventDefault();
  845. const modal = document.getElementById(trigger.dataset.modal);
  846. if (!modal) {
  847. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  848. return;
  849. }
  850. modal.classList.add("phpdocumentor-modal__open");
  851. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  852. const exits = modal.querySelectorAll("[data-exit-button]");
  853. exits.forEach(function (exit) {
  854. exit.addEventListener("click", function (event) {
  855. event.preventDefault();
  856. modal.classList.remove("phpdocumentor-modal__open");
  857. });
  858. });
  859. });
  860. });
  861. })();
  862. </script>
  863. </article>
  864. </section>
  865. <section class="phpdocumentor-on-this-page__sidebar">
  866. <section class="phpdocumentor-on-this-page__content">
  867. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  868. <ul class="phpdocumentor-list -clean">
  869. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  870. <li>
  871. <ul class="phpdocumentor-list -clean">
  872. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-constants">Constants</a></li>
  873. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-properties">Properties</a></li>
  874. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#toc-methods">Methods</a></li>
  875. </ul>
  876. </li>
  877. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  878. <li>
  879. <ul class="phpdocumentor-list -clean">
  880. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE">BLOCK_SIZE</a></li>
  881. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_MASK">BLOCK_SIZE_MASK</a></li>
  882. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_BLOCK_SIZE_POWER">BLOCK_SIZE_POWER</a></li>
  883. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_BUCKETS">LUMINANCE_BUCKETS</a></li>
  884. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_LUMINANCE_SHIFT">LUMINANCE_SHIFT</a></li>
  885. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MIN_DYNAMIC_RANGE">MIN_DYNAMIC_RANGE</a></li>
  886. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#constant_MINIMUM_DIMENSION">MINIMUM_DIMENSION</a></li>
  887. </ul>
  888. </li>
  889. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  890. <li>
  891. <ul class="phpdocumentor-list -clean">
  892. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_luminances">$luminances<a href="classes/chillerlan-QRCode-Decoder-Binarizer.html"></li>
  893. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#property_source">$source<a href="classes/chillerlan-QRCode-Decoder-Binarizer.html"></li>
  894. </ul>
  895. </li>
  896. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  897. <li>
  898. <ul class="phpdocumentor-list -clean">
  899. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method___construct">__construct()</a></li>
  900. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getBlackMatrix">getBlackMatrix()</a></li>
  901. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateBlackPoints">calculateBlackPoints()</a></li>
  902. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_calculateThresholdForBlock">calculateThresholdForBlock()</a></li>
  903. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_cap">cap()</a></li>
  904. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_estimateBlackPoint">estimateBlackPoint()</a></li>
  905. <li><a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#method_getHistogramBlackMatrix">getHistogramBlackMatrix()</a></li>
  906. </ul>
  907. </li>
  908. </ul>
  909. </section>
  910. </section>
  911. </div>
  912. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  913. <section class="phpdocumentor-search-results__dialog">
  914. <header class="phpdocumentor-search-results__header">
  915. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  916. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  917. </header>
  918. <section class="phpdocumentor-search-results__body">
  919. <ul class="phpdocumentor-search-results__entries"></ul>
  920. </section>
  921. </section>
  922. </section>
  923. </div>
  924. <a href="classes/chillerlan-QRCode-Decoder-Binarizer.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  925. </main>
  926. <script>
  927. cssVars({});
  928. </script>
  929. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  930. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  931. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  932. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  933. </body>
  934. </html>