chillerlan-QRCode-Detector-GridSampler.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610
  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. GridSampler
  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/GridSampler.php"><a href="files/src-detector-gridsampler.html"><abbr title="src/Detector/GridSampler.php">GridSampler.php</abbr></a></abbr>
  128. :
  129. <span class="phpdocumentor-element-found-in__line">32</span>
  130. </aside>
  131. <p class="phpdocumentor-summary">Implementations of this class can, given locations of finder patterns for a QR code in an
  132. image, sample the right points in the image to reconstruct the QR code, accounting for
  133. perspective distortion. It is abstracted since it is relatively expensive and should be allowed
  134. to take advantage of platform-specific optimized implementations, like Sun&#039;s Java Advanced
  135. Imaging library, but which may not be available in other environments such as J2ME, and vice
  136. versa.</p>
  137. <section class="phpdocumentor-description"><p>The implementation used can be controlled by calling #setGridSampler(GridSampler)
  138. with an instance of a class which implements this interface.</p>
  139. </section>
  140. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  141. Tags
  142. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  143. </h5>
  144. <dl class="phpdocumentor-tag-list">
  145. <dt class="phpdocumentor-tag-list__entry">
  146. <span class="phpdocumentor-tag__name">author</span>
  147. </dt>
  148. <dd class="phpdocumentor-tag-list__definition">
  149. <section class="phpdocumentor-description"><p>Sean Owen</p>
  150. </section>
  151. </dd>
  152. </dl>
  153. <h3 id="toc">
  154. Table of Contents
  155. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h3>
  157. <h4 id="toc-properties">
  158. Properties
  159. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  160. </h4>
  161. <dl class="phpdocumentor-table-of-contents">
  162. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  163. <a class="" href="classes/chillerlan-QRCode-Detector-GridSampler.html#property_points">$points</a>
  164. <span>
  165. &nbsp;: array&lt;string|int, float&gt; </span>
  166. </dt>
  167. </dl>
  168. <h4 id="toc-methods">
  169. Methods
  170. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  171. </h4>
  172. <dl class="phpdocumentor-table-of-contents">
  173. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  174. <a class="" href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid">sampleGrid()</a>
  175. <span>
  176. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  177. </dt>
  178. <dd>Samples an image for a rectangular matrix of bits of the given dimension. The sampling
  179. transformation is determined by the coordinates of 4 points, in the original and transformed
  180. image space.</dd>
  181. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  182. <a class="" href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints">checkAndNudgePoints()</a>
  183. <span>
  184. &nbsp;: void </span>
  185. </dt>
  186. <dd>Checks a set of points that have been transformed to sample points on an image against
  187. the image&#039;s dimensions to see if the point are even within the image.</dd>
  188. </dl>
  189. <section class="phpdocumentor-properties">
  190. <h3 class="phpdocumentor-elements__header" id="properties">
  191. Properties
  192. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  193. </h3>
  194. <article
  195. class="
  196. phpdocumentor-element
  197. -property
  198. -private
  199. "
  200. >
  201. <h4 class="phpdocumentor-element__name" id="property_points">
  202. $points
  203. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#property_points" class="headerlink"><i class="fas fa-link"></i></a>
  204. <span class="phpdocumentor-element__modifiers">
  205. </span>
  206. </h4>
  207. <aside class="phpdocumentor-element-found-in">
  208. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/GridSampler.php"><a href="files/src-detector-gridsampler.html"><abbr title="src/Detector/GridSampler.php">GridSampler.php</abbr></a></abbr>
  209. :
  210. <span class="phpdocumentor-element-found-in__line">35</span>
  211. </aside>
  212. <code class="phpdocumentor-code phpdocumentor-signature ">
  213. <span class="phpdocumentor-signature__visibility">private</span>
  214. <span class="phpdocumentor-signature__type">array&lt;string|int, float&gt;</span>
  215. <span class="phpdocumentor-signature__name">$points</span>
  216. </code>
  217. </article>
  218. </section>
  219. <section class="phpdocumentor-methods">
  220. <h3 class="phpdocumentor-elements__header" id="methods">
  221. Methods
  222. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  223. </h3>
  224. <article
  225. class="phpdocumentor-element
  226. -method
  227. -public
  228. "
  229. >
  230. <h4 class="phpdocumentor-element__name" id="method_sampleGrid">
  231. sampleGrid()
  232. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid" class="headerlink"><i class="fas fa-link"></i></a>
  233. </h4>
  234. <aside class="phpdocumentor-element-found-in">
  235. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/GridSampler.php"><a href="files/src-detector-gridsampler.html"><abbr title="src/Detector/GridSampler.php">GridSampler.php</abbr></a></abbr>
  236. :
  237. <span class="phpdocumentor-element-found-in__line">132</span>
  238. </aside>
  239. <p class="phpdocumentor-summary">Samples an image for a rectangular matrix of bits of the given dimension. The sampling
  240. transformation is determined by the coordinates of 4 points, in the original and transformed
  241. image space.</p>
  242. <code class="phpdocumentor-code phpdocumentor-signature ">
  243. <span class="phpdocumentor-signature__visibility">public</span>
  244. <span class="phpdocumentor-signature__name">sampleGrid</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$matrix</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">$dimension</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-PerspectiveTransform.html"><abbr title="\chillerlan\QRCode\Detector\PerspectiveTransform">PerspectiveTransform</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$transform</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>
  245. <div class="phpdocumentor-label-line">
  246. </div>
  247. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  248. <dl class="phpdocumentor-argument-list">
  249. <dt class="phpdocumentor-argument-list__entry">
  250. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  251. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  252. </dt>
  253. <dd class="phpdocumentor-argument-list__definition">
  254. </dd>
  255. <dt class="phpdocumentor-argument-list__entry">
  256. <span class="phpdocumentor-signature__argument__name">$dimension</span>
  257. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  258. </dt>
  259. <dd class="phpdocumentor-argument-list__definition">
  260. </dd>
  261. <dt class="phpdocumentor-argument-list__entry">
  262. <span class="phpdocumentor-signature__argument__name">$transform</span>
  263. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Detector-PerspectiveTransform.html"><abbr title="\chillerlan\QRCode\Detector\PerspectiveTransform">PerspectiveTransform</abbr></a></span>
  264. </dt>
  265. <dd class="phpdocumentor-argument-list__definition">
  266. </dd>
  267. </dl>
  268. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  269. Tags
  270. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid#tags" class="headerlink"><i class="fas fa-link"></i></a>
  271. </h5>
  272. <dl class="phpdocumentor-tag-list">
  273. <dt class="phpdocumentor-tag-list__entry">
  274. <span class="phpdocumentor-tag__name">throws</span>
  275. </dt>
  276. <dd class="phpdocumentor-tag-list__definition">
  277. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  278. <section class="phpdocumentor-description"><p>if image can't be sampled, for example, if the transformation defined
  279. by the given points is invalid or results in sampling outside the image boundaries</p>
  280. </section>
  281. </dd>
  282. </dl>
  283. <section>
  284. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  285. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  286. &mdash;
  287. <section class="phpdocumentor-description"><p>representing a grid of points sampled from the image within a region
  288. defined by the &quot;from&quot; parameters</p>
  289. </section>
  290. </section>
  291. </article>
  292. <article
  293. class="phpdocumentor-element
  294. -method
  295. -private
  296. "
  297. >
  298. <h4 class="phpdocumentor-element__name" id="method_checkAndNudgePoints">
  299. checkAndNudgePoints()
  300. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints" class="headerlink"><i class="fas fa-link"></i></a>
  301. </h4>
  302. <aside class="phpdocumentor-element-found-in">
  303. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/GridSampler.php"><a href="files/src-detector-gridsampler.html"><abbr title="src/Detector/GridSampler.php">GridSampler.php</abbr></a></abbr>
  304. :
  305. <span class="phpdocumentor-element-found-in__line">52</span>
  306. </aside>
  307. <p class="phpdocumentor-summary">Checks a set of points that have been transformed to sample points on an image against
  308. the image&#039;s dimensions to see if the point are even within the image.</p>
  309. <code class="phpdocumentor-code phpdocumentor-signature ">
  310. <span class="phpdocumentor-signature__visibility">private</span>
  311. <span class="phpdocumentor-signature__name">checkAndNudgePoints</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$dimension</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
  312. <div class="phpdocumentor-label-line">
  313. </div>
  314. <section class="phpdocumentor-description"><p>This method will actually &quot;nudge&quot; the endpoints back onto the image if they are found to be
  315. barely (less than 1 pixel) off the image. This accounts for imperfect detection of finder
  316. patterns in an image where the QR Code runs all the way to the image border.</p>
  317. <p>For efficiency, the method will check points from either end of the line until one is found
  318. to be within the image. Because the set of points are assumed to be linear, this is valid.</p>
  319. </section>
  320. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  321. <dl class="phpdocumentor-argument-list">
  322. <dt class="phpdocumentor-argument-list__entry">
  323. <span class="phpdocumentor-signature__argument__name">$dimension</span>
  324. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  325. </dt>
  326. <dd class="phpdocumentor-argument-list__definition">
  327. <section class="phpdocumentor-description"><p>matrix width/height</p>
  328. </section>
  329. </dd>
  330. </dl>
  331. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  332. Tags
  333. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints#tags" class="headerlink"><i class="fas fa-link"></i></a>
  334. </h5>
  335. <dl class="phpdocumentor-tag-list">
  336. <dt class="phpdocumentor-tag-list__entry">
  337. <span class="phpdocumentor-tag__name">throws</span>
  338. </dt>
  339. <dd class="phpdocumentor-tag-list__definition">
  340. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  341. <section class="phpdocumentor-description"><p>if an endpoint is lies outside the image boundaries</p>
  342. </section>
  343. </dd>
  344. </dl>
  345. </article>
  346. </section>
  347. <div class="phpdocumentor-modal" id="source-view">
  348. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  349. <div class="phpdocumentor-modal-container">
  350. <div class="phpdocumentor-modal-content">
  351. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Detector/GridSampler.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  352. </div>
  353. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  354. </div>
  355. </div>
  356. <script type="text/javascript">
  357. (function () {
  358. function loadExternalCodeSnippet(el, url, line) {
  359. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  360. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  361. const language = 'php';
  362. const code = document.createElement('code');
  363. code.className = 'language-' + language;
  364. pre.textContent = '';
  365. pre.setAttribute('data-line', line)
  366. code.textContent = 'Loading…';
  367. pre.appendChild(code);
  368. var xhr = new XMLHttpRequest();
  369. xhr.open('GET', src, true);
  370. xhr.onreadystatechange = function () {
  371. if (xhr.readyState !== 4) {
  372. return;
  373. }
  374. if (xhr.status < 400 && xhr.responseText) {
  375. code.textContent = xhr.responseText;
  376. Prism.highlightElement(code);
  377. d=document.getElementsByClassName("line-numbers");
  378. d[0].scrollTop = d[0].children[1].offsetTop;
  379. return;
  380. }
  381. if (xhr.status === 404) {
  382. code.textContent = '✖ Error: File could not be found';
  383. return;
  384. }
  385. if (xhr.status >= 400) {
  386. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  387. return;
  388. }
  389. code.textContent = '✖ Error: An unknown error occurred';
  390. };
  391. xhr.send(null);
  392. });
  393. }
  394. const modalButtons = document.querySelectorAll("[data-modal]");
  395. const openedAsLocalFile = window.location.protocol === 'file:';
  396. if (modalButtons.length > 0 && openedAsLocalFile) {
  397. console.warn(
  398. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  399. 'browsers block XHR requests when a page is opened this way'
  400. );
  401. }
  402. modalButtons.forEach(function (trigger) {
  403. if (openedAsLocalFile) {
  404. trigger.setAttribute("hidden", "hidden");
  405. }
  406. trigger.addEventListener("click", function (event) {
  407. event.preventDefault();
  408. const modal = document.getElementById(trigger.dataset.modal);
  409. if (!modal) {
  410. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  411. return;
  412. }
  413. modal.classList.add("phpdocumentor-modal__open");
  414. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  415. const exits = modal.querySelectorAll("[data-exit-button]");
  416. exits.forEach(function (exit) {
  417. exit.addEventListener("click", function (event) {
  418. event.preventDefault();
  419. modal.classList.remove("phpdocumentor-modal__open");
  420. });
  421. });
  422. });
  423. });
  424. })();
  425. </script>
  426. </article>
  427. </section>
  428. <section class="phpdocumentor-on-this-page__sidebar">
  429. <section class="phpdocumentor-on-this-page__content">
  430. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  431. <ul class="phpdocumentor-list -clean">
  432. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  433. <li>
  434. <ul class="phpdocumentor-list -clean">
  435. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-properties">Properties</a></li>
  436. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-methods">Methods</a></li>
  437. </ul>
  438. </li>
  439. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  440. <li>
  441. <ul class="phpdocumentor-list -clean">
  442. <li class=""><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#property_points">$points</a></li>
  443. </ul>
  444. </li>
  445. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  446. <li>
  447. <ul class="phpdocumentor-list -clean">
  448. <li class=""><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid">sampleGrid()</a></li>
  449. <li class=""><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints">checkAndNudgePoints()</a></li>
  450. </ul>
  451. </li>
  452. </ul>
  453. </section>
  454. </section>
  455. </div>
  456. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  457. <section class="phpdocumentor-search-results__dialog">
  458. <header class="phpdocumentor-search-results__header">
  459. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  460. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  461. </header>
  462. <section class="phpdocumentor-search-results__body">
  463. <ul class="phpdocumentor-search-results__entries"></ul>
  464. </section>
  465. </section>
  466. </section>
  467. </div>
  468. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  469. </main>
  470. <script>
  471. cssVars({});
  472. </script>
  473. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  474. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  475. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  476. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  477. </body>
  478. </html>