chillerlan-QRCode-Common-MaskPatternTester.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736
  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=Source+Sans+Pro:wght@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/search.js"></script>
  22. <script defer src="js/searchIndex.js"></script>
  23. </head>
  24. <body id="top">
  25. <header class="phpdocumentor-header phpdocumentor-section">
  26. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  27. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  28. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  29. <i class="fas fa-bars"></i>
  30. </label>
  31. <section data-search-form class="phpdocumentor-search">
  32. <label>
  33. <span class="visually-hidden">Search for</span>
  34. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  35. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  36. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  37. </svg>
  38. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  39. </label>
  40. </section>
  41. <nav class="phpdocumentor-topnav">
  42. <ul class="phpdocumentor-topnav__menu">
  43. </ul>
  44. </nav>
  45. </header>
  46. <main class="phpdocumentor">
  47. <div class="phpdocumentor-section">
  48. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  49. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  50. Menu
  51. </label>
  52. <aside class="phpdocumentor-column -four phpdocumentor-sidebar">
  53. <section class="phpdocumentor-sidebar__category">
  54. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  55. <h4 class="phpdocumentor-sidebar__root-namespace"><a href="namespaces/chillerlan.html">chillerlan</a></h4>
  56. <ul class="phpdocumentor-list">
  57. <li>
  58. <a href="namespaces/chillerlan-qrcode.html">QRCode</a>
  59. </li>
  60. <li>
  61. <a href="namespaces/chillerlan-qrcodetest.html">QRCodeTest</a>
  62. </li>
  63. </ul>
  64. </section>
  65. <section class="phpdocumentor-sidebar__category">
  66. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  67. <h4 class="phpdocumentor-sidebar__root-namespace"><a href="packages/Application.html">Application</a></h4>
  68. </section>
  69. <section class="phpdocumentor-sidebar__category">
  70. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  71. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  72. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  73. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  74. </section>
  75. <section class="phpdocumentor-sidebar__category">
  76. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  77. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  78. </section>
  79. </aside>
  80. <div class="phpdocumentor-column -eight phpdocumentor-content">
  81. <ul class="phpdocumentor-breadcrumbs">
  82. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  83. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  84. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  85. </ul>
  86. <article class="phpdocumentor-element -class">
  87. <h2 class="phpdocumentor-content__title">
  88. MaskPatternTester
  89. <div class="phpdocumentor-element__package">
  90. in package
  91. <ul class="phpdocumentor-breadcrumbs">
  92. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  93. </ul>
  94. </div>
  95. </h2>
  96. <aside class="phpdocumentor-element-found-in">
  97. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  98. :
  99. <span class="phpdocumentor-element-found-in__line">25</span>
  100. </aside>
  101. <p class="phpdocumentor-summary">Receives a QRData object and runs the mask pattern tests on it.</p>
  102. <section class="phpdocumentor-description"><p>ISO/IEC 18004:2000 Section 8.8.2 - Evaluation of masking results</p>
  103. </section>
  104. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  105. Tags
  106. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  107. </h5>
  108. <dl class="phpdocumentor-tag-list">
  109. <dt class="phpdocumentor-tag-list__entry">
  110. <span class="phpdocumentor-tag__name">see</span>
  111. </dt>
  112. <dd class="phpdocumentor-tag-list__definition">
  113. <span class="phpdocumentor-tag-link"><a href="http://www.thonky.com/qr-code-tutorial/data-masking"><abbr title="http://www.thonky.com/qr-code-tutorial/data-masking">http://www.thonky.com/qr-code-tutorial/data-masking</abbr></a></span>
  114. </dd>
  115. </dl>
  116. <h3 id="toc">
  117. Table of Contents
  118. <a href="#toc" class="headerlink"><i class="fas fa-link"></i></a>
  119. </h3>
  120. <dl class="phpdocumentor-table-of-contents">
  121. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  122. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#property_qrData">$qrData</a>
  123. <span>
  124. &nbsp;: <a href="classes/chillerlan-QRCode-Data-QRData.html"><abbr title="\chillerlan\QRCode\Data\QRData">QRData</abbr></a> </span>
  125. </dt>
  126. <dd>The data interface that contains the data matrix to test</dd>
  127. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  128. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method___construct">__construct()</a>
  129. <span>
  130. &nbsp;: mixed </span>
  131. </dt>
  132. <dd>Receives the QRData object</dd>
  133. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  134. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_getBestMaskPattern">getBestMaskPattern()</a>
  135. <span>
  136. &nbsp;: <a href="classes/chillerlan-QRCode-Common-MaskPattern.html"><abbr title="\chillerlan\QRCode\Common\MaskPattern">MaskPattern</abbr></a> </span>
  137. </dt>
  138. <dd>shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern</dd>
  139. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  140. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testPattern">testPattern()</a>
  141. <span>
  142. &nbsp;: int </span>
  143. </dt>
  144. <dd>Returns the penalty for the given mask pattern</dd>
  145. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  146. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel1">testLevel1()</a>
  147. <span>
  148. &nbsp;: int </span>
  149. </dt>
  150. <dd>Checks for each group of five or more same-colored modules in a row (or column)</dd>
  151. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  152. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel2">testLevel2()</a>
  153. <span>
  154. &nbsp;: int </span>
  155. </dt>
  156. <dd>Checks for each 2x2 area of same-colored modules in the matrix</dd>
  157. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  158. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel3">testLevel3()</a>
  159. <span>
  160. &nbsp;: int </span>
  161. </dt>
  162. <dd>Checks if there are patterns that look similar to the finder patterns (1:1:3:1:1 ratio)</dd>
  163. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  164. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel4">testLevel4()</a>
  165. <span>
  166. &nbsp;: float </span>
  167. </dt>
  168. <dd>Checks if more than half of the modules are dark or light, with a larger penalty for a larger difference</dd>
  169. </dl>
  170. <section class="phpdocumentor-properties">
  171. <h3 class="phpdocumentor-elements__header" id="properties">
  172. Properties
  173. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  174. </h3>
  175. <article
  176. class="
  177. phpdocumentor-element
  178. -property
  179. -private
  180. "
  181. >
  182. <h4 class="phpdocumentor-element__name" id="property_qrData">
  183. $qrData
  184. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#property_qrData" class="headerlink"><i class="fas fa-link"></i></a>
  185. <span class="phpdocumentor-element__modifiers">
  186. </span>
  187. </h4>
  188. <aside class="phpdocumentor-element-found-in">
  189. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  190. :
  191. <span class="phpdocumentor-element-found-in__line">30</span>
  192. </aside>
  193. <p class="phpdocumentor-summary">The data interface that contains the data matrix to test</p>
  194. <code class="phpdocumentor-code phpdocumentor-signature ">
  195. <span class="phpdocumentor-signature__visibility">private</span>
  196. <span class="phpdocumentor-signature__type"><a href="classes/chillerlan-QRCode-Data-QRData.html"><abbr title="\chillerlan\QRCode\Data\QRData">QRData</abbr></a></span>
  197. <span class="phpdocumentor-signature__name">$qrData</span>
  198. </code>
  199. <section class="phpdocumentor-description"></section>
  200. </article>
  201. </section>
  202. <section class="phpdocumentor-methods">
  203. <h3 class="phpdocumentor-elements__header" id="methods">
  204. Methods
  205. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  206. </h3>
  207. <article
  208. class="phpdocumentor-element
  209. -method
  210. -public
  211. "
  212. >
  213. <h4 class="phpdocumentor-element__name" id="method___construct">
  214. __construct()
  215. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  216. </h4>
  217. <aside class="phpdocumentor-element-found-in">
  218. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  219. :
  220. <span class="phpdocumentor-element-found-in__line">38</span>
  221. </aside>
  222. <p class="phpdocumentor-summary">Receives the QRData object</p>
  223. <code class="phpdocumentor-code phpdocumentor-signature ">
  224. <span class="phpdocumentor-signature__visibility">public</span>
  225. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Data-QRData.html"><abbr title="\chillerlan\QRCode\Data\QRData">QRData</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$qrData</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  226. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  227. <dl class="phpdocumentor-argument-list">
  228. <dt class="phpdocumentor-argument-list__entry">
  229. <span class="phpdocumentor-signature__argument__name">$qrData</span>
  230. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Data-QRData.html"><abbr title="\chillerlan\QRCode\Data\QRData">QRData</abbr></a></span>
  231. </dt>
  232. <dd class="phpdocumentor-argument-list__definition">
  233. <section class="phpdocumentor-description"></section>
  234. </dd>
  235. </dl>
  236. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  237. Tags
  238. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  239. </h5>
  240. <dl class="phpdocumentor-tag-list">
  241. <dt class="phpdocumentor-tag-list__entry">
  242. <span class="phpdocumentor-tag__name">see</span>
  243. </dt>
  244. <dd class="phpdocumentor-tag-list__definition">
  245. <span class="phpdocumentor-tag-link"><abbr title="\chillerlan\QRCode\QROptions::$maskPattern">QROptions::$maskPattern</abbr></span>
  246. </dd>
  247. <dt class="phpdocumentor-tag-list__entry">
  248. <span class="phpdocumentor-tag__name">see</span>
  249. </dt>
  250. <dd class="phpdocumentor-tag-list__definition">
  251. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRMatrix.html#property_maskPattern"><abbr title="\chillerlan\QRCode\Data\QRMatrix::$maskPattern">QRMatrix::$maskPattern</abbr></a></span>
  252. </dd>
  253. </dl>
  254. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  255. <span class="phpdocumentor-signature__response_type">mixed</span>
  256. &mdash;
  257. </article>
  258. <article
  259. class="phpdocumentor-element
  260. -method
  261. -public
  262. "
  263. >
  264. <h4 class="phpdocumentor-element__name" id="method_getBestMaskPattern">
  265. getBestMaskPattern()
  266. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_getBestMaskPattern" class="headerlink"><i class="fas fa-link"></i></a>
  267. </h4>
  268. <aside class="phpdocumentor-element-found-in">
  269. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  270. :
  271. <span class="phpdocumentor-element-found-in__line">47</span>
  272. </aside>
  273. <p class="phpdocumentor-summary">shoves a QRMatrix through the MaskPatternTester to find the lowest penalty mask pattern</p>
  274. <code class="phpdocumentor-code phpdocumentor-signature ">
  275. <span class="phpdocumentor-signature__visibility">public</span>
  276. <span class="phpdocumentor-signature__name">getBestMaskPattern</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Common-MaskPattern.html"><abbr title="\chillerlan\QRCode\Common\MaskPattern">MaskPattern</abbr></a></span></code>
  277. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  278. Tags
  279. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  280. </h5>
  281. <dl class="phpdocumentor-tag-list">
  282. <dt class="phpdocumentor-tag-list__entry">
  283. <span class="phpdocumentor-tag__name">see</span>
  284. </dt>
  285. <dd class="phpdocumentor-tag-list__definition">
  286. <span class="phpdocumentor-tag-link"><abbr title="\chillerlan\QRCode\Data\MaskPatternTester">MaskPatternTester</abbr></span>
  287. </dd>
  288. </dl>
  289. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  290. <span class="phpdocumentor-signature__response_type"><a href="classes/chillerlan-QRCode-Common-MaskPattern.html"><abbr title="\chillerlan\QRCode\Common\MaskPattern">MaskPattern</abbr></a></span>
  291. &mdash;
  292. </article>
  293. <article
  294. class="phpdocumentor-element
  295. -method
  296. -public
  297. "
  298. >
  299. <h4 class="phpdocumentor-element__name" id="method_testPattern">
  300. testPattern()
  301. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testPattern" class="headerlink"><i class="fas fa-link"></i></a>
  302. </h4>
  303. <aside class="phpdocumentor-element-found-in">
  304. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  305. :
  306. <span class="phpdocumentor-element-found-in__line">63</span>
  307. </aside>
  308. <p class="phpdocumentor-summary">Returns the penalty for the given mask pattern</p>
  309. <code class="phpdocumentor-code phpdocumentor-signature ">
  310. <span class="phpdocumentor-signature__visibility">public</span>
  311. <span class="phpdocumentor-signature__name">testPattern</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-MaskPattern.html"><abbr title="\chillerlan\QRCode\Common\MaskPattern">MaskPattern</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$pattern</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  312. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  313. <dl class="phpdocumentor-argument-list">
  314. <dt class="phpdocumentor-argument-list__entry">
  315. <span class="phpdocumentor-signature__argument__name">$pattern</span>
  316. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Common-MaskPattern.html"><abbr title="\chillerlan\QRCode\Common\MaskPattern">MaskPattern</abbr></a></span>
  317. </dt>
  318. <dd class="phpdocumentor-argument-list__definition">
  319. <section class="phpdocumentor-description"></section>
  320. </dd>
  321. </dl>
  322. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  323. Tags
  324. <a href="#tags" class="headerlink"><i class="fas fa-link"></i></a>
  325. </h5>
  326. <dl class="phpdocumentor-tag-list">
  327. <dt class="phpdocumentor-tag-list__entry">
  328. <span class="phpdocumentor-tag__name">see</span>
  329. </dt>
  330. <dd class="phpdocumentor-tag-list__definition">
  331. <span class="phpdocumentor-tag-link"><abbr title="\chillerlan\QRCode\QROptions::$maskPattern">QROptions::$maskPattern</abbr></span>
  332. </dd>
  333. <dt class="phpdocumentor-tag-list__entry">
  334. <span class="phpdocumentor-tag__name">see</span>
  335. </dt>
  336. <dd class="phpdocumentor-tag-list__definition">
  337. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Data-QRMatrix.html#property_maskPattern"><abbr title="\chillerlan\QRCode\Data\QRMatrix::$maskPattern">QRMatrix::$maskPattern</abbr></a></span>
  338. </dd>
  339. </dl>
  340. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  341. <span class="phpdocumentor-signature__response_type">int</span>
  342. &mdash;
  343. </article>
  344. <article
  345. class="phpdocumentor-element
  346. -method
  347. -private
  348. "
  349. >
  350. <h4 class="phpdocumentor-element__name" id="method_testLevel1">
  351. testLevel1()
  352. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel1" class="headerlink"><i class="fas fa-link"></i></a>
  353. </h4>
  354. <aside class="phpdocumentor-element-found-in">
  355. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  356. :
  357. <span class="phpdocumentor-element-found-in__line">77</span>
  358. </aside>
  359. <p class="phpdocumentor-summary">Checks for each group of five or more same-colored modules in a row (or column)</p>
  360. <code class="phpdocumentor-code phpdocumentor-signature ">
  361. <span class="phpdocumentor-signature__visibility">private</span>
  362. <span class="phpdocumentor-signature__name">testLevel1</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$m</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$size</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  363. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  364. <dl class="phpdocumentor-argument-list">
  365. <dt class="phpdocumentor-argument-list__entry">
  366. <span class="phpdocumentor-signature__argument__name">$m</span>
  367. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  368. </dt>
  369. <dd class="phpdocumentor-argument-list__definition">
  370. <section class="phpdocumentor-description"></section>
  371. </dd>
  372. <dt class="phpdocumentor-argument-list__entry">
  373. <span class="phpdocumentor-signature__argument__name">$size</span>
  374. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  375. </dt>
  376. <dd class="phpdocumentor-argument-list__definition">
  377. <section class="phpdocumentor-description"></section>
  378. </dd>
  379. </dl>
  380. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  381. <span class="phpdocumentor-signature__response_type">int</span>
  382. &mdash;
  383. </article>
  384. <article
  385. class="phpdocumentor-element
  386. -method
  387. -private
  388. "
  389. >
  390. <h4 class="phpdocumentor-element__name" id="method_testLevel2">
  391. testLevel2()
  392. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel2" class="headerlink"><i class="fas fa-link"></i></a>
  393. </h4>
  394. <aside class="phpdocumentor-element-found-in">
  395. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  396. :
  397. <span class="phpdocumentor-element-found-in__line">116</span>
  398. </aside>
  399. <p class="phpdocumentor-summary">Checks for each 2x2 area of same-colored modules in the matrix</p>
  400. <code class="phpdocumentor-code phpdocumentor-signature ">
  401. <span class="phpdocumentor-signature__visibility">private</span>
  402. <span class="phpdocumentor-signature__name">testLevel2</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$m</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$size</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  403. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  404. <dl class="phpdocumentor-argument-list">
  405. <dt class="phpdocumentor-argument-list__entry">
  406. <span class="phpdocumentor-signature__argument__name">$m</span>
  407. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  408. </dt>
  409. <dd class="phpdocumentor-argument-list__definition">
  410. <section class="phpdocumentor-description"></section>
  411. </dd>
  412. <dt class="phpdocumentor-argument-list__entry">
  413. <span class="phpdocumentor-signature__argument__name">$size</span>
  414. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  415. </dt>
  416. <dd class="phpdocumentor-argument-list__definition">
  417. <section class="phpdocumentor-description"></section>
  418. </dd>
  419. </dl>
  420. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  421. <span class="phpdocumentor-signature__response_type">int</span>
  422. &mdash;
  423. </article>
  424. <article
  425. class="phpdocumentor-element
  426. -method
  427. -private
  428. "
  429. >
  430. <h4 class="phpdocumentor-element__name" id="method_testLevel3">
  431. testLevel3()
  432. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel3" class="headerlink"><i class="fas fa-link"></i></a>
  433. </h4>
  434. <aside class="phpdocumentor-element-found-in">
  435. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  436. :
  437. <span class="phpdocumentor-element-found-in__line">147</span>
  438. </aside>
  439. <p class="phpdocumentor-summary">Checks if there are patterns that look similar to the finder patterns (1:1:3:1:1 ratio)</p>
  440. <code class="phpdocumentor-code phpdocumentor-signature ">
  441. <span class="phpdocumentor-signature__visibility">private</span>
  442. <span class="phpdocumentor-signature__name">testLevel3</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$m</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$size</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  443. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  444. <dl class="phpdocumentor-argument-list">
  445. <dt class="phpdocumentor-argument-list__entry">
  446. <span class="phpdocumentor-signature__argument__name">$m</span>
  447. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  448. </dt>
  449. <dd class="phpdocumentor-argument-list__definition">
  450. <section class="phpdocumentor-description"></section>
  451. </dd>
  452. <dt class="phpdocumentor-argument-list__entry">
  453. <span class="phpdocumentor-signature__argument__name">$size</span>
  454. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  455. </dt>
  456. <dd class="phpdocumentor-argument-list__definition">
  457. <section class="phpdocumentor-description"></section>
  458. </dd>
  459. </dl>
  460. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  461. <span class="phpdocumentor-signature__response_type">int</span>
  462. &mdash;
  463. </article>
  464. <article
  465. class="phpdocumentor-element
  466. -method
  467. -private
  468. "
  469. >
  470. <h4 class="phpdocumentor-element__name" id="method_testLevel4">
  471. testLevel4()
  472. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#method_testLevel4" class="headerlink"><i class="fas fa-link"></i></a>
  473. </h4>
  474. <aside class="phpdocumentor-element-found-in">
  475. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPatternTester.php"><a href="files/src-common-maskpatterntester.html"><abbr title="src/Common/MaskPatternTester.php">MaskPatternTester.php</abbr></a></abbr>
  476. :
  477. <span class="phpdocumentor-element-found-in__line">188</span>
  478. </aside>
  479. <p class="phpdocumentor-summary">Checks if more than half of the modules are dark or light, with a larger penalty for a larger difference</p>
  480. <code class="phpdocumentor-code phpdocumentor-signature ">
  481. <span class="phpdocumentor-signature__visibility">private</span>
  482. <span class="phpdocumentor-signature__name">testLevel4</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;&nbsp;</span><span class="phpdocumentor-signature__argument__name">$m</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$size</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">float</span></code>
  483. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  484. <dl class="phpdocumentor-argument-list">
  485. <dt class="phpdocumentor-argument-list__entry">
  486. <span class="phpdocumentor-signature__argument__name">$m</span>
  487. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  488. </dt>
  489. <dd class="phpdocumentor-argument-list__definition">
  490. <section class="phpdocumentor-description"></section>
  491. </dd>
  492. <dt class="phpdocumentor-argument-list__entry">
  493. <span class="phpdocumentor-signature__argument__name">$size</span>
  494. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  495. </dt>
  496. <dd class="phpdocumentor-argument-list__definition">
  497. <section class="phpdocumentor-description"></section>
  498. </dd>
  499. </dl>
  500. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  501. <span class="phpdocumentor-signature__response_type">float</span>
  502. &mdash;
  503. </article>
  504. </section>
  505. <script type="text/javascript">
  506. function loadExternalCodeSnippets(line) {
  507. Array.prototype.slice.call(document.querySelectorAll('pre[data-src]')).forEach((pre) => {
  508. var src = pre.getAttribute('data-src').replace( /\\/g, '/');
  509. var extension = (src.match(/\.(\w+)$/) || [, ''])[1];
  510. var language = 'php';
  511. var code = document.createElement('code');
  512. code.className = 'language-' + language;
  513. pre.textContent = '';
  514. pre.setAttribute('data-line', line)
  515. code.textContent = 'Loading…';
  516. pre.appendChild(code);
  517. var xhr = new XMLHttpRequest();
  518. xhr.open('GET', src, true);
  519. xhr.onreadystatechange = function () {
  520. if (xhr.readyState == 4) {
  521. if (xhr.status < 400 && xhr.responseText) {
  522. code.textContent = xhr.responseText;
  523. Prism.highlightElement(code);
  524. }
  525. else if (xhr.status >= 400) {
  526. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  527. }
  528. else {
  529. code.textContent = '✖ Error: File does not exist, is empty or trying to view from localhost';
  530. }
  531. }
  532. };
  533. xhr.send(null);
  534. });
  535. }
  536. var modals = document.querySelectorAll("[data-modal]");
  537. modals.forEach(function (trigger) {
  538. trigger.addEventListener("click", function (event) {
  539. //event.preventDefault();
  540. const modal = document.getElementById(trigger.dataset.modal);
  541. modal.classList.add("phpdocumentor-modal__open");
  542. loadExternalCodeSnippets(trigger.dataset.line)
  543. const exits = modal.querySelectorAll("[data-exit-button]");
  544. exits.forEach(function (exit) {
  545. exit.addEventListener("click", function (event) {
  546. event.preventDefault();
  547. modal.classList.remove("phpdocumentor-modal__open");
  548. });
  549. });
  550. });
  551. });
  552. </script>
  553. </article>
  554. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  555. <section class="phpdocumentor-search-results__dialog">
  556. <header class="phpdocumentor-search-results__header">
  557. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  558. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  559. </header>
  560. <section class="phpdocumentor-search-results__body">
  561. <ul class="phpdocumentor-search-results__entries"></ul>
  562. </section>
  563. </section>
  564. </section>
  565. </div>
  566. </div>
  567. <a href="classes/chillerlan-QRCode-Common-MaskPatternTester.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  568. </main>
  569. <script>
  570. cssVars({});
  571. </script>
  572. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  573. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  574. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  575. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  576. </body>
  577. </html>