chillerlan-QRCode-Detector-GridSampler.html 29 KB

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