chillerlan-QRCode-Detector-Detector.html 62 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. <li class="phpdocumentor-topnav__menu-item -social">
  59. <a href="https://github.com/chillerlan/php-qrcode/discussions">
  60. <span>
  61. <i class="fas fa-envelope-open-text"></i>
  62. </span>
  63. </a>
  64. </li>
  65. </ul>
  66. </nav>
  67. </header>
  68. <main class="phpdocumentor">
  69. <div class="phpdocumentor-section">
  70. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  71. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  72. Menu
  73. </label>
  74. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  75. <section class="phpdocumentor-sidebar__category -namespaces">
  76. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  77. <h4 class="phpdocumentor-sidebar__root-namespace">
  78. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  79. </h4>
  80. <ul class="phpdocumentor-list">
  81. <li>
  82. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  83. </li>
  84. <li>
  85. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  86. </li>
  87. </ul>
  88. <h4 class="phpdocumentor-sidebar__root-namespace">
  89. <a href="namespaces/output.html" class="">Output</a>
  90. </h4>
  91. </section>
  92. <section class="phpdocumentor-sidebar__category -packages">
  93. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  94. <h4 class="phpdocumentor-sidebar__root-namespace">
  95. <a href="packages/Application.html" class="">Application</a>
  96. </h4>
  97. </section>
  98. <section class="phpdocumentor-sidebar__category -reports">
  99. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  100. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  101. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  102. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  103. </section>
  104. <section class="phpdocumentor-sidebar__category -indices">
  105. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  106. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  107. </section>
  108. </aside>
  109. <div class="phpdocumentor-column -nine phpdocumentor-content">
  110. <section>
  111. <ul class="phpdocumentor-breadcrumbs">
  112. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  113. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  114. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-detector.html">Detector</a></li>
  115. </ul>
  116. <article class="phpdocumentor-element -class">
  117. <h2 class="phpdocumentor-content__title">
  118. Detector
  119. <div class="phpdocumentor-element__package">
  120. in package
  121. <ul class="phpdocumentor-breadcrumbs">
  122. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  123. </ul>
  124. </div>
  125. </h2>
  126. <div class="phpdocumentor-label-line">
  127. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  128. </div>
  129. <aside class="phpdocumentor-element-found-in">
  130. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  131. :
  132. <span class="phpdocumentor-element-found-in__line">25</span>
  133. </aside>
  134. <p class="phpdocumentor-summary">Encapsulates logic that can detect a QR Code in an image, even if the QR Code
  135. is rotated or skewed, or partially obscured.</p>
  136. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  137. Tags
  138. <a href="classes/chillerlan-QRCode-Detector-Detector.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  139. </h5>
  140. <dl class="phpdocumentor-tag-list">
  141. <dt class="phpdocumentor-tag-list__entry">
  142. <span class="phpdocumentor-tag__name">author</span>
  143. </dt>
  144. <dd class="phpdocumentor-tag-list__definition">
  145. <section class="phpdocumentor-description"><p>Sean Owen</p>
  146. </section>
  147. </dd>
  148. </dl>
  149. <h3 id="toc">
  150. Table of Contents
  151. <a href="classes/chillerlan-QRCode-Detector-Detector.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  152. </h3>
  153. <h4 id="toc-properties">
  154. Properties
  155. <a href="classes/chillerlan-QRCode-Detector-Detector.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h4>
  157. <dl class="phpdocumentor-table-of-contents">
  158. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  159. <a href="classes/chillerlan-QRCode-Detector-Detector.html#property_matrix">$matrix</a>
  160. <span>
  161. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  162. </dt>
  163. </dl>
  164. <h4 id="toc-methods">
  165. Methods
  166. <a href="classes/chillerlan-QRCode-Detector-Detector.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  167. </h4>
  168. <dl class="phpdocumentor-table-of-contents">
  169. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  170. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method___construct">__construct()</a>
  171. <span>
  172. &nbsp;: mixed </span>
  173. </dt>
  174. <dd>Detector constructor.</dd>
  175. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  176. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_detect">detect()</a>
  177. <span>
  178. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  179. </dt>
  180. <dd>Detects a QR Code in an image.</dd>
  181. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  182. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSize">calculateModuleSize()</a>
  183. <span>
  184. &nbsp;: float </span>
  185. </dt>
  186. <dd>Computes an average estimated module size based on estimated derived from the positions
  187. of the three finder patterns.</dd>
  188. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  189. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSizeOneWay">calculateModuleSizeOneWay()</a>
  190. <span>
  191. &nbsp;: float </span>
  192. </dt>
  193. <dd>Estimates module size based on two finder patterns -- it uses
  194. #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int) to figure the
  195. width of each, measuring along the axis between their centers.</dd>
  196. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  197. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_computeDimension">computeDimension()</a>
  198. <span>
  199. &nbsp;: int </span>
  200. </dt>
  201. <dd>Computes the dimension (number of modules on a size) of the QR Code based on the position
  202. of the finder patterns and estimated module size.</dd>
  203. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  204. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_createTransform">createTransform()</a>
  205. <span>
  206. &nbsp;: <a href="classes/chillerlan-QRCode-Detector-PerspectiveTransform.html"><abbr title="\chillerlan\QRCode\Detector\PerspectiveTransform">PerspectiveTransform</abbr></a> </span>
  207. </dt>
  208. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  209. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_findAlignmentInRegion">findAlignmentInRegion()</a>
  210. <span>
  211. &nbsp;: <a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null </span>
  212. </dt>
  213. <dd>Attempts to locate an alignment pattern in a limited region of the image, which is
  214. guessed to contain it.</dd>
  215. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  216. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRun">sizeOfBlackWhiteBlackRun()</a>
  217. <span>
  218. &nbsp;: float </span>
  219. </dt>
  220. <dd>This method traces a line from a po$in the image, in the direction towards another point.</dd>
  221. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  222. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRunBothWays">sizeOfBlackWhiteBlackRunBothWays()</a>
  223. <span>
  224. &nbsp;: float </span>
  225. </dt>
  226. <dd>See #sizeOfBlackWhiteBlackRun(int, int, int, int); computes the total width of
  227. a finder pattern by looking for a black-white-black run from the center in the direction
  228. of another po$(another finder pattern center), and in the opposite direction too.</dd>
  229. </dl>
  230. <section class="phpdocumentor-properties">
  231. <h3 class="phpdocumentor-elements__header" id="properties">
  232. Properties
  233. <a href="classes/chillerlan-QRCode-Detector-Detector.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  234. </h3>
  235. <article
  236. class="
  237. phpdocumentor-element
  238. -property
  239. -private
  240. "
  241. >
  242. <h4 class="phpdocumentor-element__name" id="property_matrix">
  243. $matrix
  244. <a href="classes/chillerlan-QRCode-Detector-Detector.html#property_matrix" class="headerlink"><i class="fas fa-link"></i></a>
  245. <span class="phpdocumentor-element__modifiers">
  246. </span>
  247. </h4>
  248. <aside class="phpdocumentor-element-found-in">
  249. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  250. :
  251. <span class="phpdocumentor-element-found-in__line">27</span>
  252. </aside>
  253. <code class="phpdocumentor-code phpdocumentor-signature ">
  254. <span class="phpdocumentor-signature__visibility">private</span>
  255. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  256. <span class="phpdocumentor-signature__name">$matrix</span>
  257. </code>
  258. </article>
  259. </section>
  260. <section class="phpdocumentor-methods">
  261. <h3 class="phpdocumentor-elements__header" id="methods">
  262. Methods
  263. <a href="classes/chillerlan-QRCode-Detector-Detector.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  264. </h3>
  265. <article
  266. class="phpdocumentor-element
  267. -method
  268. -public
  269. "
  270. >
  271. <h4 class="phpdocumentor-element__name" id="method___construct">
  272. __construct()
  273. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  274. </h4>
  275. <aside class="phpdocumentor-element-found-in">
  276. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  277. :
  278. <span class="phpdocumentor-element-found-in__line">32</span>
  279. </aside>
  280. <p class="phpdocumentor-summary">Detector constructor.</p>
  281. <code class="phpdocumentor-code phpdocumentor-signature ">
  282. <span class="phpdocumentor-signature__visibility">public</span>
  283. <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>
  284. <div class="phpdocumentor-label-line">
  285. </div>
  286. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  287. <dl class="phpdocumentor-argument-list">
  288. <dt class="phpdocumentor-argument-list__entry">
  289. <span class="phpdocumentor-signature__argument__name">$source</span>
  290. : <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>
  291. </dt>
  292. <dd class="phpdocumentor-argument-list__definition">
  293. </dd>
  294. </dl>
  295. </article>
  296. <article
  297. class="phpdocumentor-element
  298. -method
  299. -public
  300. "
  301. >
  302. <h4 class="phpdocumentor-element__name" id="method_detect">
  303. detect()
  304. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_detect" class="headerlink"><i class="fas fa-link"></i></a>
  305. </h4>
  306. <aside class="phpdocumentor-element-found-in">
  307. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  308. :
  309. <span class="phpdocumentor-element-found-in__line">39</span>
  310. </aside>
  311. <p class="phpdocumentor-summary">Detects a QR Code in an image.</p>
  312. <code class="phpdocumentor-code phpdocumentor-signature ">
  313. <span class="phpdocumentor-signature__visibility">public</span>
  314. <span class="phpdocumentor-signature__name">detect</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>
  315. <div class="phpdocumentor-label-line">
  316. </div>
  317. <section>
  318. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  319. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  320. </section>
  321. </article>
  322. <article
  323. class="phpdocumentor-element
  324. -method
  325. -private
  326. "
  327. >
  328. <h4 class="phpdocumentor-element__name" id="method_calculateModuleSize">
  329. calculateModuleSize()
  330. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSize" class="headerlink"><i class="fas fa-link"></i></a>
  331. </h4>
  332. <aside class="phpdocumentor-element-found-in">
  333. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  334. :
  335. <span class="phpdocumentor-element-found-in__line">81</span>
  336. </aside>
  337. <p class="phpdocumentor-summary">Computes an average estimated module size based on estimated derived from the positions
  338. of the three finder patterns.</p>
  339. <code class="phpdocumentor-code phpdocumentor-signature ">
  340. <span class="phpdocumentor-signature__visibility">private</span>
  341. <span class="phpdocumentor-signature__name">calculateModuleSize</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$topLeft</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$topRight</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$bottomLeft</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
  342. <div class="phpdocumentor-label-line">
  343. </div>
  344. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  345. <dl class="phpdocumentor-argument-list">
  346. <dt class="phpdocumentor-argument-list__entry">
  347. <span class="phpdocumentor-signature__argument__name">$topLeft</span>
  348. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  349. </dt>
  350. <dd class="phpdocumentor-argument-list__definition">
  351. </dd>
  352. <dt class="phpdocumentor-argument-list__entry">
  353. <span class="phpdocumentor-signature__argument__name">$topRight</span>
  354. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  355. </dt>
  356. <dd class="phpdocumentor-argument-list__definition">
  357. </dd>
  358. <dt class="phpdocumentor-argument-list__entry">
  359. <span class="phpdocumentor-signature__argument__name">$bottomLeft</span>
  360. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  361. </dt>
  362. <dd class="phpdocumentor-argument-list__definition">
  363. </dd>
  364. </dl>
  365. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  366. Tags
  367. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSize#tags" class="headerlink"><i class="fas fa-link"></i></a>
  368. </h5>
  369. <dl class="phpdocumentor-tag-list">
  370. <dt class="phpdocumentor-tag-list__entry">
  371. <span class="phpdocumentor-tag__name">throws</span>
  372. </dt>
  373. <dd class="phpdocumentor-tag-list__definition">
  374. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  375. </dd>
  376. </dl>
  377. <section>
  378. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  379. <span class="phpdocumentor-signature__response_type">float</span>
  380. </section>
  381. </article>
  382. <article
  383. class="phpdocumentor-element
  384. -method
  385. -private
  386. "
  387. >
  388. <h4 class="phpdocumentor-element__name" id="method_calculateModuleSizeOneWay">
  389. calculateModuleSizeOneWay()
  390. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSizeOneWay" class="headerlink"><i class="fas fa-link"></i></a>
  391. </h4>
  392. <aside class="phpdocumentor-element-found-in">
  393. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  394. :
  395. <span class="phpdocumentor-element-found-in__line">100</span>
  396. </aside>
  397. <p class="phpdocumentor-summary">Estimates module size based on two finder patterns -- it uses
  398. #sizeOfBlackWhiteBlackRunBothWays(int, int, int, int) to figure the
  399. width of each, measuring along the axis between their centers.</p>
  400. <code class="phpdocumentor-code phpdocumentor-signature ">
  401. <span class="phpdocumentor-signature__visibility">private</span>
  402. <span class="phpdocumentor-signature__name">calculateModuleSizeOneWay</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$a</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$b</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
  403. <div class="phpdocumentor-label-line">
  404. </div>
  405. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  406. <dl class="phpdocumentor-argument-list">
  407. <dt class="phpdocumentor-argument-list__entry">
  408. <span class="phpdocumentor-signature__argument__name">$a</span>
  409. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  410. </dt>
  411. <dd class="phpdocumentor-argument-list__definition">
  412. </dd>
  413. <dt class="phpdocumentor-argument-list__entry">
  414. <span class="phpdocumentor-signature__argument__name">$b</span>
  415. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  416. </dt>
  417. <dd class="phpdocumentor-argument-list__definition">
  418. </dd>
  419. </dl>
  420. <section>
  421. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  422. <span class="phpdocumentor-signature__response_type">float</span>
  423. </section>
  424. </article>
  425. <article
  426. class="phpdocumentor-element
  427. -method
  428. -private
  429. "
  430. >
  431. <h4 class="phpdocumentor-element__name" id="method_computeDimension">
  432. computeDimension()
  433. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_computeDimension" class="headerlink"><i class="fas fa-link"></i></a>
  434. </h4>
  435. <aside class="phpdocumentor-element-found-in">
  436. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  437. :
  438. <span class="phpdocumentor-element-found-in__line">238</span>
  439. </aside>
  440. <p class="phpdocumentor-summary">Computes the dimension (number of modules on a size) of the QR Code based on the position
  441. of the finder patterns and estimated module size.</p>
  442. <code class="phpdocumentor-code phpdocumentor-signature ">
  443. <span class="phpdocumentor-signature__visibility">private</span>
  444. <span class="phpdocumentor-signature__name">computeDimension</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nw</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$ne</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$sw</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$size</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  445. <div class="phpdocumentor-label-line">
  446. </div>
  447. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  448. <dl class="phpdocumentor-argument-list">
  449. <dt class="phpdocumentor-argument-list__entry">
  450. <span class="phpdocumentor-signature__argument__name">$nw</span>
  451. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  452. </dt>
  453. <dd class="phpdocumentor-argument-list__definition">
  454. </dd>
  455. <dt class="phpdocumentor-argument-list__entry">
  456. <span class="phpdocumentor-signature__argument__name">$ne</span>
  457. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  458. </dt>
  459. <dd class="phpdocumentor-argument-list__definition">
  460. </dd>
  461. <dt class="phpdocumentor-argument-list__entry">
  462. <span class="phpdocumentor-signature__argument__name">$sw</span>
  463. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  464. </dt>
  465. <dd class="phpdocumentor-argument-list__definition">
  466. </dd>
  467. <dt class="phpdocumentor-argument-list__entry">
  468. <span class="phpdocumentor-signature__argument__name">$size</span>
  469. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  470. </dt>
  471. <dd class="phpdocumentor-argument-list__definition">
  472. </dd>
  473. </dl>
  474. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  475. Tags
  476. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_computeDimension#tags" class="headerlink"><i class="fas fa-link"></i></a>
  477. </h5>
  478. <dl class="phpdocumentor-tag-list">
  479. <dt class="phpdocumentor-tag-list__entry">
  480. <span class="phpdocumentor-tag__name">throws</span>
  481. </dt>
  482. <dd class="phpdocumentor-tag-list__definition">
  483. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  484. </dd>
  485. </dl>
  486. <section>
  487. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  488. <span class="phpdocumentor-signature__response_type">int</span>
  489. </section>
  490. </article>
  491. <article
  492. class="phpdocumentor-element
  493. -method
  494. -private
  495. "
  496. >
  497. <h4 class="phpdocumentor-element__name" id="method_createTransform">
  498. createTransform()
  499. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_createTransform" class="headerlink"><i class="fas fa-link"></i></a>
  500. </h4>
  501. <aside class="phpdocumentor-element-found-in">
  502. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  503. :
  504. <span class="phpdocumentor-element-found-in__line">307</span>
  505. </aside>
  506. <code class="phpdocumentor-code phpdocumentor-signature ">
  507. <span class="phpdocumentor-signature__visibility">private</span>
  508. <span class="phpdocumentor-signature__name">createTransform</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$nw</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$ne</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$sw</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">$size</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$ap</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">null</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-PerspectiveTransform.html"><abbr title="\chillerlan\QRCode\Detector\PerspectiveTransform">PerspectiveTransform</abbr></a></span></code>
  509. <div class="phpdocumentor-label-line">
  510. </div>
  511. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  512. <dl class="phpdocumentor-argument-list">
  513. <dt class="phpdocumentor-argument-list__entry">
  514. <span class="phpdocumentor-signature__argument__name">$nw</span>
  515. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  516. </dt>
  517. <dd class="phpdocumentor-argument-list__definition">
  518. </dd>
  519. <dt class="phpdocumentor-argument-list__entry">
  520. <span class="phpdocumentor-signature__argument__name">$ne</span>
  521. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  522. </dt>
  523. <dd class="phpdocumentor-argument-list__definition">
  524. </dd>
  525. <dt class="phpdocumentor-argument-list__entry">
  526. <span class="phpdocumentor-signature__argument__name">$sw</span>
  527. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-FinderPattern.html"><abbr title="\chillerlan\QRCode\Detector\FinderPattern">FinderPattern</abbr></a></span>
  528. </dt>
  529. <dd class="phpdocumentor-argument-list__definition">
  530. </dd>
  531. <dt class="phpdocumentor-argument-list__entry">
  532. <span class="phpdocumentor-signature__argument__name">$size</span>
  533. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  534. </dt>
  535. <dd class="phpdocumentor-argument-list__definition">
  536. </dd>
  537. <dt class="phpdocumentor-argument-list__entry">
  538. <span class="phpdocumentor-signature__argument__name">$ap</span>
  539. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a></span>
  540. = <span class="phpdocumentor-signature__argument__default-value">null</span> </dt>
  541. <dd class="phpdocumentor-argument-list__definition">
  542. </dd>
  543. </dl>
  544. <section>
  545. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  546. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-PerspectiveTransform.html"><abbr title="\chillerlan\QRCode\Detector\PerspectiveTransform">PerspectiveTransform</abbr></a></span>
  547. </section>
  548. </article>
  549. <article
  550. class="phpdocumentor-element
  551. -method
  552. -private
  553. "
  554. >
  555. <h4 class="phpdocumentor-element__name" id="method_findAlignmentInRegion">
  556. findAlignmentInRegion()
  557. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_findAlignmentInRegion" class="headerlink"><i class="fas fa-link"></i></a>
  558. </h4>
  559. <aside class="phpdocumentor-element-found-in">
  560. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  561. :
  562. <span class="phpdocumentor-element-found-in__line">273</span>
  563. </aside>
  564. <p class="phpdocumentor-summary">Attempts to locate an alignment pattern in a limited region of the image, which is
  565. guessed to contain it.</p>
  566. <code class="phpdocumentor-code phpdocumentor-signature ">
  567. <span class="phpdocumentor-signature__visibility">private</span>
  568. <span class="phpdocumentor-signature__name">findAlignmentInRegion</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$overallEstModuleSize</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">$estAlignmentX</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">$estAlignmentY</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$allowanceFactor</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span></code>
  569. <div class="phpdocumentor-label-line">
  570. </div>
  571. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  572. <dl class="phpdocumentor-argument-list">
  573. <dt class="phpdocumentor-argument-list__entry">
  574. <span class="phpdocumentor-signature__argument__name">$overallEstModuleSize</span>
  575. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  576. </dt>
  577. <dd class="phpdocumentor-argument-list__definition">
  578. <section class="phpdocumentor-description"><p>estimated module size so far</p>
  579. </section>
  580. </dd>
  581. <dt class="phpdocumentor-argument-list__entry">
  582. <span class="phpdocumentor-signature__argument__name">$estAlignmentX</span>
  583. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  584. </dt>
  585. <dd class="phpdocumentor-argument-list__definition">
  586. <section class="phpdocumentor-description"><p>x coordinate of center of area probably containing alignment pattern</p>
  587. </section>
  588. </dd>
  589. <dt class="phpdocumentor-argument-list__entry">
  590. <span class="phpdocumentor-signature__argument__name">$estAlignmentY</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"><p>y coordinate of above</p>
  595. </section>
  596. </dd>
  597. <dt class="phpdocumentor-argument-list__entry">
  598. <span class="phpdocumentor-signature__argument__name">$allowanceFactor</span>
  599. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  600. </dt>
  601. <dd class="phpdocumentor-argument-list__definition">
  602. <section class="phpdocumentor-description"><p>number of pixels in all directions to search from the center</p>
  603. </section>
  604. </dd>
  605. </dl>
  606. <section>
  607. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  608. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Detector-AlignmentPattern.html"><abbr title="\chillerlan\QRCode\Detector\AlignmentPattern">AlignmentPattern</abbr></a>|null</span>
  609. &mdash;
  610. <section class="phpdocumentor-description"><p>if found, or null otherwise</p>
  611. </section>
  612. </section>
  613. </article>
  614. <article
  615. class="phpdocumentor-element
  616. -method
  617. -private
  618. "
  619. >
  620. <h4 class="phpdocumentor-element__name" id="method_sizeOfBlackWhiteBlackRun">
  621. sizeOfBlackWhiteBlackRun()
  622. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRun" class="headerlink"><i class="fas fa-link"></i></a>
  623. </h4>
  624. <aside class="phpdocumentor-element-found-in">
  625. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  626. :
  627. <span class="phpdocumentor-element-found-in__line">167</span>
  628. </aside>
  629. <p class="phpdocumentor-summary">This method traces a line from a po$in the image, in the direction towards another point.</p>
  630. <code class="phpdocumentor-code phpdocumentor-signature ">
  631. <span class="phpdocumentor-signature__visibility">private</span>
  632. <span class="phpdocumentor-signature__name">sizeOfBlackWhiteBlackRun</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fromX</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">$fromY</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">$toX</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">$toY</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
  633. <div class="phpdocumentor-label-line">
  634. </div>
  635. <section class="phpdocumentor-description"><p>It begins in a black region, and keeps going until it finds white, then black, then white again.
  636. It reports the distance from the start to this point.</p>
  637. <p>This is used when figuring out how wide a finder pattern is, when the finder pattern
  638. may be skewed or rotated.</p>
  639. </section>
  640. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  641. <dl class="phpdocumentor-argument-list">
  642. <dt class="phpdocumentor-argument-list__entry">
  643. <span class="phpdocumentor-signature__argument__name">$fromX</span>
  644. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  645. </dt>
  646. <dd class="phpdocumentor-argument-list__definition">
  647. </dd>
  648. <dt class="phpdocumentor-argument-list__entry">
  649. <span class="phpdocumentor-signature__argument__name">$fromY</span>
  650. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  651. </dt>
  652. <dd class="phpdocumentor-argument-list__definition">
  653. </dd>
  654. <dt class="phpdocumentor-argument-list__entry">
  655. <span class="phpdocumentor-signature__argument__name">$toX</span>
  656. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  657. </dt>
  658. <dd class="phpdocumentor-argument-list__definition">
  659. </dd>
  660. <dt class="phpdocumentor-argument-list__entry">
  661. <span class="phpdocumentor-signature__argument__name">$toY</span>
  662. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  663. </dt>
  664. <dd class="phpdocumentor-argument-list__definition">
  665. </dd>
  666. </dl>
  667. <section>
  668. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  669. <span class="phpdocumentor-signature__response_type">float</span>
  670. </section>
  671. </article>
  672. <article
  673. class="phpdocumentor-element
  674. -method
  675. -private
  676. "
  677. >
  678. <h4 class="phpdocumentor-element__name" id="method_sizeOfBlackWhiteBlackRunBothWays">
  679. sizeOfBlackWhiteBlackRunBothWays()
  680. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRunBothWays" class="headerlink"><i class="fas fa-link"></i></a>
  681. </h4>
  682. <aside class="phpdocumentor-element-found-in">
  683. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/Detector.php"><a href="files/src-detector-detector.html"><abbr title="src/Detector/Detector.php">Detector.php</abbr></a></abbr>
  684. :
  685. <span class="phpdocumentor-element-found-in__line">124</span>
  686. </aside>
  687. <p class="phpdocumentor-summary">See #sizeOfBlackWhiteBlackRun(int, int, int, int); computes the total width of
  688. a finder pattern by looking for a black-white-black run from the center in the direction
  689. of another po$(another finder pattern center), and in the opposite direction too.</p>
  690. <code class="phpdocumentor-code phpdocumentor-signature ">
  691. <span class="phpdocumentor-signature__visibility">private</span>
  692. <span class="phpdocumentor-signature__name">sizeOfBlackWhiteBlackRunBothWays</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fromX</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$fromY</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$toX</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">float&nbsp;</span><span class="phpdocumentor-signature__argument__name">$toY</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
  693. <div class="phpdocumentor-label-line">
  694. </div>
  695. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  696. <dl class="phpdocumentor-argument-list">
  697. <dt class="phpdocumentor-argument-list__entry">
  698. <span class="phpdocumentor-signature__argument__name">$fromX</span>
  699. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  700. </dt>
  701. <dd class="phpdocumentor-argument-list__definition">
  702. </dd>
  703. <dt class="phpdocumentor-argument-list__entry">
  704. <span class="phpdocumentor-signature__argument__name">$fromY</span>
  705. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  706. </dt>
  707. <dd class="phpdocumentor-argument-list__definition">
  708. </dd>
  709. <dt class="phpdocumentor-argument-list__entry">
  710. <span class="phpdocumentor-signature__argument__name">$toX</span>
  711. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  712. </dt>
  713. <dd class="phpdocumentor-argument-list__definition">
  714. </dd>
  715. <dt class="phpdocumentor-argument-list__entry">
  716. <span class="phpdocumentor-signature__argument__name">$toY</span>
  717. : <span class="phpdocumentor-signature__argument__return-type">float</span>
  718. </dt>
  719. <dd class="phpdocumentor-argument-list__definition">
  720. </dd>
  721. </dl>
  722. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  723. Tags
  724. <a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRunBothWays#tags" class="headerlink"><i class="fas fa-link"></i></a>
  725. </h5>
  726. <dl class="phpdocumentor-tag-list">
  727. <dt class="phpdocumentor-tag-list__entry">
  728. <span class="phpdocumentor-tag__name">noinspection</span>
  729. </dt>
  730. <dd class="phpdocumentor-tag-list__definition">
  731. <section class="phpdocumentor-description"><p>DuplicatedCode</p>
  732. </section>
  733. </dd>
  734. </dl>
  735. <section>
  736. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  737. <span class="phpdocumentor-signature__response_type">float</span>
  738. </section>
  739. </article>
  740. </section>
  741. <div class="phpdocumentor-modal" id="source-view">
  742. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  743. <div class="phpdocumentor-modal-container">
  744. <div class="phpdocumentor-modal-content">
  745. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Detector/Detector.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  746. </div>
  747. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  748. </div>
  749. </div>
  750. <script type="text/javascript">
  751. (function () {
  752. function loadExternalCodeSnippet(el, url, line) {
  753. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  754. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  755. const language = 'php';
  756. const code = document.createElement('code');
  757. code.className = 'language-' + language;
  758. pre.textContent = '';
  759. pre.setAttribute('data-line', line)
  760. code.textContent = 'Loading…';
  761. pre.appendChild(code);
  762. var xhr = new XMLHttpRequest();
  763. xhr.open('GET', src, true);
  764. xhr.onreadystatechange = function () {
  765. if (xhr.readyState !== 4) {
  766. return;
  767. }
  768. if (xhr.status < 400 && xhr.responseText) {
  769. code.textContent = xhr.responseText;
  770. Prism.highlightElement(code);
  771. return;
  772. }
  773. if (xhr.status === 404) {
  774. code.textContent = '✖ Error: File could not be found';
  775. return;
  776. }
  777. if (xhr.status >= 400) {
  778. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  779. return;
  780. }
  781. code.textContent = '✖ Error: An unknown error occurred';
  782. };
  783. xhr.send(null);
  784. });
  785. }
  786. const modalButtons = document.querySelectorAll("[data-modal]");
  787. const openedAsLocalFile = window.location.protocol === 'file:';
  788. if (modalButtons.length > 0 && openedAsLocalFile) {
  789. console.warn(
  790. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  791. 'browsers block XHR requests when a page is opened this way'
  792. );
  793. }
  794. modalButtons.forEach(function (trigger) {
  795. if (openedAsLocalFile) {
  796. trigger.setAttribute("hidden", "hidden");
  797. }
  798. trigger.addEventListener("click", function (event) {
  799. event.preventDefault();
  800. const modal = document.getElementById(trigger.dataset.modal);
  801. if (!modal) {
  802. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  803. return;
  804. }
  805. modal.classList.add("phpdocumentor-modal__open");
  806. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  807. const exits = modal.querySelectorAll("[data-exit-button]");
  808. exits.forEach(function (exit) {
  809. exit.addEventListener("click", function (event) {
  810. event.preventDefault();
  811. modal.classList.remove("phpdocumentor-modal__open");
  812. });
  813. });
  814. });
  815. });
  816. })();
  817. </script>
  818. </article>
  819. </section>
  820. <section class="phpdocumentor-on-this-page__sidebar">
  821. <section class="phpdocumentor-on-this-page__content">
  822. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  823. <ul class="phpdocumentor-list -clean">
  824. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  825. <li>
  826. <ul class="phpdocumentor-list -clean">
  827. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#toc-properties">Properties</a></li>
  828. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#toc-methods">Methods</a></li>
  829. </ul>
  830. </li>
  831. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  832. <li>
  833. <ul class="phpdocumentor-list -clean">
  834. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#property_matrix">$matrix<a href="classes/chillerlan-QRCode-Detector-Detector.html"></li>
  835. </ul>
  836. </li>
  837. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  838. <li>
  839. <ul class="phpdocumentor-list -clean">
  840. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method___construct">__construct()</a></li>
  841. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_detect">detect()</a></li>
  842. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSize">calculateModuleSize()</a></li>
  843. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_calculateModuleSizeOneWay">calculateModuleSizeOneWay()</a></li>
  844. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_computeDimension">computeDimension()</a></li>
  845. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_createTransform">createTransform()</a></li>
  846. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_findAlignmentInRegion">findAlignmentInRegion()</a></li>
  847. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRun">sizeOfBlackWhiteBlackRun()</a></li>
  848. <li><a href="classes/chillerlan-QRCode-Detector-Detector.html#method_sizeOfBlackWhiteBlackRunBothWays">sizeOfBlackWhiteBlackRunBothWays()</a></li>
  849. </ul>
  850. </li>
  851. </ul>
  852. </section>
  853. </section>
  854. </div>
  855. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  856. <section class="phpdocumentor-search-results__dialog">
  857. <header class="phpdocumentor-search-results__header">
  858. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  859. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  860. </header>
  861. <section class="phpdocumentor-search-results__body">
  862. <ul class="phpdocumentor-search-results__entries"></ul>
  863. </section>
  864. </section>
  865. </section>
  866. </div>
  867. <a href="classes/chillerlan-QRCode-Detector-Detector.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  868. </main>
  869. <script>
  870. cssVars({});
  871. </script>
  872. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  873. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  874. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  875. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  876. </body>
  877. </html>