chillerlan-QRCode-Decoder-Binarizer.html 59 KB

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