chillerlan-QRCode-Detector-GridSampler.html 29 KB

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