chillerlan-QRCode-Detector-Detector.html 62 KB

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