chillerlan-QRCode-Decoder-Binarizer.html 51 KB

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