chillerlan-QRCode-Detector-GridSampler.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. </ul>
  59. </nav>
  60. </header>
  61. <main class="phpdocumentor">
  62. <div class="phpdocumentor-section">
  63. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  64. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  65. Menu
  66. </label>
  67. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  68. <section class="phpdocumentor-sidebar__category">
  69. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  70. <h4 class="phpdocumentor-sidebar__root-namespace">
  71. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  72. </h4>
  73. <ul class="phpdocumentor-list">
  74. <li>
  75. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  76. </li>
  77. <li>
  78. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  79. </li>
  80. </ul>
  81. <h4 class="phpdocumentor-sidebar__root-namespace">
  82. <a href="namespaces/output.html" class="">Output</a>
  83. </h4>
  84. </section>
  85. <section class="phpdocumentor-sidebar__category">
  86. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  87. <h4 class="phpdocumentor-sidebar__root-namespace">
  88. <a href="packages/Application.html" class="">Application</a>
  89. </h4>
  90. </section>
  91. <section class="phpdocumentor-sidebar__category">
  92. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  93. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  94. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  95. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  96. </section>
  97. <section class="phpdocumentor-sidebar__category">
  98. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  99. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  100. </section>
  101. </aside>
  102. <div class="phpdocumentor-column -nine phpdocumentor-content">
  103. <section>
  104. <ul class="phpdocumentor-breadcrumbs">
  105. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  106. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  107. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-detector.html">Detector</a></li>
  108. </ul>
  109. <article class="phpdocumentor-element -class">
  110. <h2 class="phpdocumentor-content__title">
  111. GridSampler
  112. <div class="phpdocumentor-element__package">
  113. in package
  114. <ul class="phpdocumentor-breadcrumbs">
  115. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  116. </ul>
  117. </div>
  118. </h2>
  119. <div class="phpdocumentor-label-line">
  120. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Final</span><span>Yes</span></div>
  121. </div>
  122. <aside class="phpdocumentor-element-found-in">
  123. <abbr class="phpdocumentor-element-found-in__file" title="src/Detector/GridSampler.php"><a href="files/src-detector-gridsampler.html"><abbr title="src/Detector/GridSampler.php">GridSampler.php</abbr></a></abbr>
  124. :
  125. <span class="phpdocumentor-element-found-in__line">31</span>
  126. </aside>
  127. <p class="phpdocumentor-summary">Implementations of this class can, given locations of finder patterns for a QR code in an
  128. image, sample the right points in the image to reconstruct the QR code, accounting for
  129. perspective distortion. It is abstracted since it is relatively expensive and should be allowed
  130. to take advantage of platform-specific optimized implementations, like Sun&#039;s Java Advanced
  131. Imaging library, but which may not be available in other environments such as J2ME, and vice
  132. versa.</p>
  133. <section class="phpdocumentor-description"><p>The implementation used can be controlled by calling #setGridSampler(GridSampler)
  134. with an instance of a class which implements this interface.</p>
  135. </section>
  136. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  137. Tags
  138. <a href="classes/chillerlan-QRCode-Detector-GridSampler.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-GridSampler.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-GridSampler.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-GridSampler.html#property_points">$points</a>
  160. <span>
  161. &nbsp;: array&lt;string|int, mixed&gt; </span>
  162. </dt>
  163. </dl>
  164. <h4 id="toc-methods">
  165. Methods
  166. <a href="classes/chillerlan-QRCode-Detector-GridSampler.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-GridSampler.html#method_sampleGrid">sampleGrid()</a>
  171. <span>
  172. &nbsp;: <a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a> </span>
  173. </dt>
  174. <dd>Samples an image for a rectangular matrix of bits of the given dimension. The sampling
  175. transformation is determined by the coordinates of 4 points, in the original and transformed
  176. image space.</dd>
  177. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  178. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints">checkAndNudgePoints()</a>
  179. <span>
  180. &nbsp;: void </span>
  181. </dt>
  182. <dd>Checks a set of points that have been transformed to sample points on an image against
  183. the image&#039;s dimensions to see if the point are even within the image.</dd>
  184. </dl>
  185. <section class="phpdocumentor-properties">
  186. <h3 class="phpdocumentor-elements__header" id="properties">
  187. Properties
  188. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  189. </h3>
  190. <article
  191. class="
  192. phpdocumentor-element
  193. -property
  194. -private
  195. "
  196. >
  197. <h4 class="phpdocumentor-element__name" id="property_points">
  198. $points
  199. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#property_points" class="headerlink"><i class="fas fa-link"></i></a>
  200. <span class="phpdocumentor-element__modifiers">
  201. </span>
  202. </h4>
  203. <aside class="phpdocumentor-element-found-in">
  204. <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>
  205. :
  206. <span class="phpdocumentor-element-found-in__line">33</span>
  207. </aside>
  208. <code class="phpdocumentor-code phpdocumentor-signature ">
  209. <span class="phpdocumentor-signature__visibility">private</span>
  210. <span class="phpdocumentor-signature__type">array&lt;string|int, mixed&gt;</span>
  211. <span class="phpdocumentor-signature__name">$points</span>
  212. </code>
  213. </article>
  214. </section>
  215. <section class="phpdocumentor-methods">
  216. <h3 class="phpdocumentor-elements__header" id="methods">
  217. Methods
  218. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  219. </h3>
  220. <article
  221. class="phpdocumentor-element
  222. -method
  223. -public
  224. "
  225. >
  226. <h4 class="phpdocumentor-element__name" id="method_sampleGrid">
  227. sampleGrid()
  228. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid" class="headerlink"><i class="fas fa-link"></i></a>
  229. </h4>
  230. <aside class="phpdocumentor-element-found-in">
  231. <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>
  232. :
  233. <span class="phpdocumentor-element-found-in__line">130</span>
  234. </aside>
  235. <p class="phpdocumentor-summary">Samples an image for a rectangular matrix of bits of the given dimension. The sampling
  236. transformation is determined by the coordinates of 4 points, in the original and transformed
  237. image space.</p>
  238. <code class="phpdocumentor-code phpdocumentor-signature ">
  239. <span class="phpdocumentor-signature__visibility">public</span>
  240. <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>
  241. <div class="phpdocumentor-label-line">
  242. </div>
  243. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  244. <dl class="phpdocumentor-argument-list">
  245. <dt class="phpdocumentor-argument-list__entry">
  246. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  247. : <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>
  248. </dt>
  249. <dd class="phpdocumentor-argument-list__definition">
  250. </dd>
  251. <dt class="phpdocumentor-argument-list__entry">
  252. <span class="phpdocumentor-signature__argument__name">$dimension</span>
  253. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  254. </dt>
  255. <dd class="phpdocumentor-argument-list__definition">
  256. </dd>
  257. <dt class="phpdocumentor-argument-list__entry">
  258. <span class="phpdocumentor-signature__argument__name">$transform</span>
  259. : <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>
  260. </dt>
  261. <dd class="phpdocumentor-argument-list__definition">
  262. </dd>
  263. </dl>
  264. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  265. Tags
  266. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid#tags" class="headerlink"><i class="fas fa-link"></i></a>
  267. </h5>
  268. <dl class="phpdocumentor-tag-list">
  269. <dt class="phpdocumentor-tag-list__entry">
  270. <span class="phpdocumentor-tag__name">throws</span>
  271. </dt>
  272. <dd class="phpdocumentor-tag-list__definition">
  273. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  274. <section class="phpdocumentor-description"><p>if image can't be sampled, for example, if the transformation defined
  275. by the given points is invalid or results in sampling outside the image boundaries</p>
  276. </section>
  277. </dd>
  278. </dl>
  279. <section>
  280. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  281. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Decoder-BitMatrix.html"><abbr title="\chillerlan\QRCode\Decoder\BitMatrix">BitMatrix</abbr></a></span>
  282. &mdash;
  283. <section class="phpdocumentor-description"><p>representing a grid of points sampled from the image within a region
  284. defined by the &quot;from&quot; parameters</p>
  285. </section>
  286. </section>
  287. </article>
  288. <article
  289. class="phpdocumentor-element
  290. -method
  291. -private
  292. "
  293. >
  294. <h4 class="phpdocumentor-element__name" id="method_checkAndNudgePoints">
  295. checkAndNudgePoints()
  296. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints" class="headerlink"><i class="fas fa-link"></i></a>
  297. </h4>
  298. <aside class="phpdocumentor-element-found-in">
  299. <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>
  300. :
  301. <span class="phpdocumentor-element-found-in__line">50</span>
  302. </aside>
  303. <p class="phpdocumentor-summary">Checks a set of points that have been transformed to sample points on an image against
  304. the image&#039;s dimensions to see if the point are even within the image.</p>
  305. <code class="phpdocumentor-code phpdocumentor-signature ">
  306. <span class="phpdocumentor-signature__visibility">private</span>
  307. <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>
  308. <div class="phpdocumentor-label-line">
  309. </div>
  310. <section class="phpdocumentor-description"><p>This method will actually &quot;nudge&quot; the endpoints back onto the image if they are found to be
  311. barely (less than 1 pixel) off the image. This accounts for imperfect detection of finder
  312. patterns in an image where the QR Code runs all the way to the image border.</p>
  313. <p>For efficiency, the method will check points from either end of the line until one is found
  314. to be within the image. Because the set of points are assumed to be linear, this is valid.</p>
  315. </section>
  316. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  317. <dl class="phpdocumentor-argument-list">
  318. <dt class="phpdocumentor-argument-list__entry">
  319. <span class="phpdocumentor-signature__argument__name">$dimension</span>
  320. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  321. </dt>
  322. <dd class="phpdocumentor-argument-list__definition">
  323. <section class="phpdocumentor-description"><p>matrix width/height</p>
  324. </section>
  325. </dd>
  326. </dl>
  327. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  328. Tags
  329. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints#tags" class="headerlink"><i class="fas fa-link"></i></a>
  330. </h5>
  331. <dl class="phpdocumentor-tag-list">
  332. <dt class="phpdocumentor-tag-list__entry">
  333. <span class="phpdocumentor-tag__name">throws</span>
  334. </dt>
  335. <dd class="phpdocumentor-tag-list__definition">
  336. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Detector-QRCodeDetectorException.html"><abbr title="\chillerlan\QRCode\Detector\QRCodeDetectorException">QRCodeDetectorException</abbr></a></span>
  337. <section class="phpdocumentor-description"><p>if an endpoint is lies outside the image boundaries</p>
  338. </section>
  339. </dd>
  340. </dl>
  341. </article>
  342. </section>
  343. <div class="phpdocumentor-modal" id="source-view">
  344. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  345. <div class="phpdocumentor-modal-container">
  346. <div class="phpdocumentor-modal-content">
  347. <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>
  348. </div>
  349. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  350. </div>
  351. </div>
  352. <script type="text/javascript">
  353. (function () {
  354. function loadExternalCodeSnippet(el, url, line) {
  355. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  356. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  357. const language = 'php';
  358. const code = document.createElement('code');
  359. code.className = 'language-' + language;
  360. pre.textContent = '';
  361. pre.setAttribute('data-line', line)
  362. code.textContent = 'Loading…';
  363. pre.appendChild(code);
  364. var xhr = new XMLHttpRequest();
  365. xhr.open('GET', src, true);
  366. xhr.onreadystatechange = function () {
  367. if (xhr.readyState !== 4) {
  368. return;
  369. }
  370. if (xhr.status < 400 && xhr.responseText) {
  371. code.textContent = xhr.responseText;
  372. Prism.highlightElement(code);
  373. return;
  374. }
  375. if (xhr.status === 404) {
  376. code.textContent = '✖ Error: File could not be found';
  377. return;
  378. }
  379. if (xhr.status >= 400) {
  380. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  381. return;
  382. }
  383. code.textContent = '✖ Error: An unknown error occurred';
  384. };
  385. xhr.send(null);
  386. });
  387. }
  388. const modalButtons = document.querySelectorAll("[data-modal]");
  389. const openedAsLocalFile = window.location.protocol === 'file:';
  390. if (modalButtons.length > 0 && openedAsLocalFile) {
  391. console.warn(
  392. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  393. 'browsers block XHR requests when a page is opened this way'
  394. );
  395. }
  396. modalButtons.forEach(function (trigger) {
  397. if (openedAsLocalFile) {
  398. trigger.setAttribute("hidden", "hidden");
  399. }
  400. trigger.addEventListener("click", function (event) {
  401. event.preventDefault();
  402. const modal = document.getElementById(trigger.dataset.modal);
  403. if (!modal) {
  404. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  405. return;
  406. }
  407. modal.classList.add("phpdocumentor-modal__open");
  408. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  409. const exits = modal.querySelectorAll("[data-exit-button]");
  410. exits.forEach(function (exit) {
  411. exit.addEventListener("click", function (event) {
  412. event.preventDefault();
  413. modal.classList.remove("phpdocumentor-modal__open");
  414. });
  415. });
  416. });
  417. });
  418. })();
  419. </script>
  420. </article>
  421. </section>
  422. <section class="phpdocumentor-on-this-page__sidebar">
  423. <section class="phpdocumentor-on-this-page__content">
  424. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  425. <ul class="phpdocumentor-list -clean">
  426. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  427. <li>
  428. <ul class="phpdocumentor-list -clean">
  429. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-properties">Properties</a></li>
  430. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#toc-methods">Methods</a></li>
  431. </ul>
  432. </li>
  433. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  434. <li>
  435. <ul class="phpdocumentor-list -clean">
  436. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#property_points">$points<a href="classes/chillerlan-QRCode-Detector-GridSampler.html"></li>
  437. </ul>
  438. </li>
  439. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  440. <li>
  441. <ul class="phpdocumentor-list -clean">
  442. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_sampleGrid">sampleGrid()</a></li>
  443. <li><a href="classes/chillerlan-QRCode-Detector-GridSampler.html#method_checkAndNudgePoints">checkAndNudgePoints()</a></li>
  444. </ul>
  445. </li>
  446. </ul>
  447. </section>
  448. </section>
  449. </div>
  450. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  451. <section class="phpdocumentor-search-results__dialog">
  452. <header class="phpdocumentor-search-results__header">
  453. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  454. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  455. </header>
  456. <section class="phpdocumentor-search-results__body">
  457. <ul class="phpdocumentor-search-results__entries"></ul>
  458. </section>
  459. </section>
  460. </section>
  461. </div>
  462. <a href="classes/chillerlan-QRCode-Detector-GridSampler.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  463. </main>
  464. <script>
  465. cssVars({});
  466. </script>
  467. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  468. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  469. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  470. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  471. </body>
  472. </html>