chillerlan-QRCode-Common-MaskPattern.html 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552
  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-common.html">Common</a></li>
  105. </ul>
  106. <article class="phpdocumentor-element -class">
  107. <h2 class="phpdocumentor-content__title">
  108. MaskPattern
  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/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  121. :
  122. <span class="phpdocumentor-element-found-in__line">26</span>
  123. </aside>
  124. <p class="phpdocumentor-summary">ISO/IEC 18004:2000 Section 8.8.1
  125. ISO/IEC 18004:2000 Section 8.8.2 - Evaluation of masking results</p>
  126. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  127. Tags
  128. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  129. </h5>
  130. <dl class="phpdocumentor-tag-list">
  131. <dt class="phpdocumentor-tag-list__entry">
  132. <span class="phpdocumentor-tag__name">see</span>
  133. </dt>
  134. <dd class="phpdocumentor-tag-list__definition">
  135. <span class="phpdocumentor-tag-link"><a href="http://www.thonky.com/qr-code-tutorial/data-masking">http://www.thonky.com/qr-code-tutorial/data-masking</a></span>
  136. </dd>
  137. <dt class="phpdocumentor-tag-list__entry">
  138. <span class="phpdocumentor-tag__name">see</span>
  139. </dt>
  140. <dd class="phpdocumentor-tag-list__definition">
  141. <span class="phpdocumentor-tag-link"><a href="https://github.com/zxing/zxing/blob/e9e2bd280bcaeabd59d0f955798384fe6c018a6c/core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java">https://github.com/zxing/zxing/blob/e9e2bd280bcaeabd59d0f955798384fe6c018a6c/core/src/main/java/com/google/zxing/qrcode/encoder/MaskUtil.java</a></span>
  142. </dd>
  143. </dl>
  144. <h3 id="toc">
  145. Table of Contents
  146. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  147. </h3>
  148. <h4 id="toc-constants">
  149. Constants
  150. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-constants" class="headerlink"><i class="fas fa-link"></i></a>
  151. </h4>
  152. <dl class="phpdocumentor-table-of-contents">
  153. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  154. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_AUTO">AUTO</a>
  155. <span>
  156. &nbsp;= -1 </span>
  157. </dt>
  158. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  159. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_000">PATTERN_000</a>
  160. <span>
  161. &nbsp;= 0b0 </span>
  162. </dt>
  163. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  164. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_001">PATTERN_001</a>
  165. <span>
  166. &nbsp;= 0b1 </span>
  167. </dt>
  168. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  169. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_010">PATTERN_010</a>
  170. <span>
  171. &nbsp;= 0b10 </span>
  172. </dt>
  173. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  174. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_011">PATTERN_011</a>
  175. <span>
  176. &nbsp;= 0b11 </span>
  177. </dt>
  178. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  179. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_100">PATTERN_100</a>
  180. <span>
  181. &nbsp;= 0b100 </span>
  182. </dt>
  183. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  184. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_101">PATTERN_101</a>
  185. <span>
  186. &nbsp;= 0b101 </span>
  187. </dt>
  188. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  189. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_110">PATTERN_110</a>
  190. <span>
  191. &nbsp;= 0b110 </span>
  192. </dt>
  193. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  194. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_111">PATTERN_111</a>
  195. <span>
  196. &nbsp;= 0b111 </span>
  197. </dt>
  198. <dt class="phpdocumentor-table-of-contents__entry -constant -public">
  199. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERNS">PATTERNS</a>
  200. <span>
  201. &nbsp;= [self::PATTERN_000, self::PATTERN_001, self::PATTERN_010, self::PATTERN_011, self::PATTERN_100, self::PATTERN_101, self::PATTERN_110, self::PATTERN_111] </span>
  202. </dt>
  203. </dl>
  204. <h4 id="toc-properties">
  205. Properties
  206. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  207. </h4>
  208. <dl class="phpdocumentor-table-of-contents">
  209. <dt class="phpdocumentor-table-of-contents__entry -property -private">
  210. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#property_maskPattern">$maskPattern</a>
  211. <span>
  212. &nbsp;: int </span>
  213. </dt>
  214. <dd>The current mask pattern value (0-7)</dd>
  215. </dl>
  216. <h4 id="toc-methods">
  217. Methods
  218. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  219. </h4>
  220. <dl class="phpdocumentor-table-of-contents">
  221. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  222. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method___construct">__construct()</a>
  223. <span>
  224. &nbsp;: mixed </span>
  225. </dt>
  226. <dd>MaskPattern constructor.</dd>
  227. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  228. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getBestPattern">getBestPattern()</a>
  229. <span>
  230. &nbsp;: self </span>
  231. </dt>
  232. <dd>Evaluates the matrix of the given data interface and returns a new mask pattern instance for the best result</dd>
  233. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  234. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getMask">getMask()</a>
  235. <span>
  236. &nbsp;: <abbr title="\Closure">Closure</abbr> </span>
  237. </dt>
  238. <dd>Returns a closure that applies the mask for the chosen mask pattern.</dd>
  239. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  240. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getPattern">getPattern()</a>
  241. <span>
  242. &nbsp;: int </span>
  243. </dt>
  244. <dd>Returns the current mask pattern</dd>
  245. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  246. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule1">testRule1()</a>
  247. <span>
  248. &nbsp;: int </span>
  249. </dt>
  250. <dd>Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and
  251. give penalty to them. Example: 00000 or 11111.</dd>
  252. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  253. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule2">testRule2()</a>
  254. <span>
  255. &nbsp;: int </span>
  256. </dt>
  257. <dd>Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
  258. penalty to them. This is actually equivalent to the spec&#039;s rule, which is to find MxN blocks and give a
  259. penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.</dd>
  260. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  261. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule3">testRule3()</a>
  262. <span>
  263. &nbsp;: int </span>
  264. </dt>
  265. <dd>Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
  266. starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
  267. find patterns like 000010111010000, we give penalty once.</dd>
  268. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  269. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule4">testRule4()</a>
  270. <span>
  271. &nbsp;: int </span>
  272. </dt>
  273. <dd>Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
  274. penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.</dd>
  275. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  276. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_applyRule1">applyRule1()</a>
  277. <span>
  278. &nbsp;: int </span>
  279. </dt>
  280. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  281. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteHorizontal">isWhiteHorizontal()</a>
  282. <span>
  283. &nbsp;: bool </span>
  284. </dt>
  285. <dt class="phpdocumentor-table-of-contents__entry -method -private">
  286. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteVertical">isWhiteVertical()</a>
  287. <span>
  288. &nbsp;: bool </span>
  289. </dt>
  290. </dl>
  291. <section class="phpdocumentor-constants">
  292. <h3 class="phpdocumentor-elements__header" id="constants">
  293. Constants
  294. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constants" class="headerlink"><i class="fas fa-link"></i></a>
  295. </h3>
  296. <article class="phpdocumentor-element -constant -public ">
  297. <h4 class="phpdocumentor-element__name" id="constant_AUTO">
  298. AUTO
  299. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_AUTO" class="headerlink"><i class="fas fa-link"></i></a>
  300. </h4>
  301. <aside class="phpdocumentor-element-found-in">
  302. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  303. :
  304. <span class="phpdocumentor-element-found-in__line">33</span>
  305. </aside>
  306. <code class="phpdocumentor-signature phpdocumentor-code ">
  307. <span class="phpdocumentor-signature__visibility">public</span>
  308. <span class="phpdocumentor-signature__type">int</span>
  309. <span class="phpdocumentor-signature__name">AUTO</span>
  310. = <span class="phpdocumentor-signature__default-value">-1</span>
  311. </code>
  312. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  313. Tags
  314. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_AUTO#tags" class="headerlink"><i class="fas fa-link"></i></a>
  315. </h5>
  316. <dl class="phpdocumentor-tag-list">
  317. <dt class="phpdocumentor-tag-list__entry">
  318. <span class="phpdocumentor-tag__name">see</span>
  319. </dt>
  320. <dd class="phpdocumentor-tag-list__definition">
  321. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QROptionsTrait.html#property_maskPattern"><abbr title="\chillerlan\QRCode\QROptionsTrait::$maskPattern">QROptionsTrait::$maskPattern</abbr></a></span>
  322. </dd>
  323. </dl>
  324. </article>
  325. <article class="phpdocumentor-element -constant -public ">
  326. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_000">
  327. PATTERN_000
  328. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_000" class="headerlink"><i class="fas fa-link"></i></a>
  329. </h4>
  330. <aside class="phpdocumentor-element-found-in">
  331. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  332. :
  333. <span class="phpdocumentor-element-found-in__line">35</span>
  334. </aside>
  335. <code class="phpdocumentor-signature phpdocumentor-code ">
  336. <span class="phpdocumentor-signature__visibility">public</span>
  337. <span class="phpdocumentor-signature__type">mixed</span>
  338. <span class="phpdocumentor-signature__name">PATTERN_000</span>
  339. = <span class="phpdocumentor-signature__default-value">0b0</span>
  340. </code>
  341. </article>
  342. <article class="phpdocumentor-element -constant -public ">
  343. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_001">
  344. PATTERN_001
  345. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_001" class="headerlink"><i class="fas fa-link"></i></a>
  346. </h4>
  347. <aside class="phpdocumentor-element-found-in">
  348. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  349. :
  350. <span class="phpdocumentor-element-found-in__line">36</span>
  351. </aside>
  352. <code class="phpdocumentor-signature phpdocumentor-code ">
  353. <span class="phpdocumentor-signature__visibility">public</span>
  354. <span class="phpdocumentor-signature__type">mixed</span>
  355. <span class="phpdocumentor-signature__name">PATTERN_001</span>
  356. = <span class="phpdocumentor-signature__default-value">0b1</span>
  357. </code>
  358. </article>
  359. <article class="phpdocumentor-element -constant -public ">
  360. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_010">
  361. PATTERN_010
  362. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_010" class="headerlink"><i class="fas fa-link"></i></a>
  363. </h4>
  364. <aside class="phpdocumentor-element-found-in">
  365. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  366. :
  367. <span class="phpdocumentor-element-found-in__line">37</span>
  368. </aside>
  369. <code class="phpdocumentor-signature phpdocumentor-code ">
  370. <span class="phpdocumentor-signature__visibility">public</span>
  371. <span class="phpdocumentor-signature__type">mixed</span>
  372. <span class="phpdocumentor-signature__name">PATTERN_010</span>
  373. = <span class="phpdocumentor-signature__default-value">0b10</span>
  374. </code>
  375. </article>
  376. <article class="phpdocumentor-element -constant -public ">
  377. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_011">
  378. PATTERN_011
  379. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_011" class="headerlink"><i class="fas fa-link"></i></a>
  380. </h4>
  381. <aside class="phpdocumentor-element-found-in">
  382. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  383. :
  384. <span class="phpdocumentor-element-found-in__line">38</span>
  385. </aside>
  386. <code class="phpdocumentor-signature phpdocumentor-code ">
  387. <span class="phpdocumentor-signature__visibility">public</span>
  388. <span class="phpdocumentor-signature__type">mixed</span>
  389. <span class="phpdocumentor-signature__name">PATTERN_011</span>
  390. = <span class="phpdocumentor-signature__default-value">0b11</span>
  391. </code>
  392. </article>
  393. <article class="phpdocumentor-element -constant -public ">
  394. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_100">
  395. PATTERN_100
  396. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_100" class="headerlink"><i class="fas fa-link"></i></a>
  397. </h4>
  398. <aside class="phpdocumentor-element-found-in">
  399. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  400. :
  401. <span class="phpdocumentor-element-found-in__line">39</span>
  402. </aside>
  403. <code class="phpdocumentor-signature phpdocumentor-code ">
  404. <span class="phpdocumentor-signature__visibility">public</span>
  405. <span class="phpdocumentor-signature__type">mixed</span>
  406. <span class="phpdocumentor-signature__name">PATTERN_100</span>
  407. = <span class="phpdocumentor-signature__default-value">0b100</span>
  408. </code>
  409. </article>
  410. <article class="phpdocumentor-element -constant -public ">
  411. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_101">
  412. PATTERN_101
  413. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_101" class="headerlink"><i class="fas fa-link"></i></a>
  414. </h4>
  415. <aside class="phpdocumentor-element-found-in">
  416. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  417. :
  418. <span class="phpdocumentor-element-found-in__line">40</span>
  419. </aside>
  420. <code class="phpdocumentor-signature phpdocumentor-code ">
  421. <span class="phpdocumentor-signature__visibility">public</span>
  422. <span class="phpdocumentor-signature__type">mixed</span>
  423. <span class="phpdocumentor-signature__name">PATTERN_101</span>
  424. = <span class="phpdocumentor-signature__default-value">0b101</span>
  425. </code>
  426. </article>
  427. <article class="phpdocumentor-element -constant -public ">
  428. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_110">
  429. PATTERN_110
  430. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_110" class="headerlink"><i class="fas fa-link"></i></a>
  431. </h4>
  432. <aside class="phpdocumentor-element-found-in">
  433. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  434. :
  435. <span class="phpdocumentor-element-found-in__line">41</span>
  436. </aside>
  437. <code class="phpdocumentor-signature phpdocumentor-code ">
  438. <span class="phpdocumentor-signature__visibility">public</span>
  439. <span class="phpdocumentor-signature__type">mixed</span>
  440. <span class="phpdocumentor-signature__name">PATTERN_110</span>
  441. = <span class="phpdocumentor-signature__default-value">0b110</span>
  442. </code>
  443. </article>
  444. <article class="phpdocumentor-element -constant -public ">
  445. <h4 class="phpdocumentor-element__name" id="constant_PATTERN_111">
  446. PATTERN_111
  447. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_111" class="headerlink"><i class="fas fa-link"></i></a>
  448. </h4>
  449. <aside class="phpdocumentor-element-found-in">
  450. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  451. :
  452. <span class="phpdocumentor-element-found-in__line">42</span>
  453. </aside>
  454. <code class="phpdocumentor-signature phpdocumentor-code ">
  455. <span class="phpdocumentor-signature__visibility">public</span>
  456. <span class="phpdocumentor-signature__type">mixed</span>
  457. <span class="phpdocumentor-signature__name">PATTERN_111</span>
  458. = <span class="phpdocumentor-signature__default-value">0b111</span>
  459. </code>
  460. </article>
  461. <article class="phpdocumentor-element -constant -public ">
  462. <h4 class="phpdocumentor-element__name" id="constant_PATTERNS">
  463. PATTERNS
  464. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERNS" class="headerlink"><i class="fas fa-link"></i></a>
  465. </h4>
  466. <aside class="phpdocumentor-element-found-in">
  467. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  468. :
  469. <span class="phpdocumentor-element-found-in__line">47</span>
  470. </aside>
  471. <code class="phpdocumentor-signature phpdocumentor-code ">
  472. <span class="phpdocumentor-signature__visibility">public</span>
  473. <span class="phpdocumentor-signature__type">array&lt;string|int, int&gt;</span>
  474. <span class="phpdocumentor-signature__name">PATTERNS</span>
  475. = <span class="phpdocumentor-signature__default-value">[self::PATTERN_000, self::PATTERN_001, self::PATTERN_010, self::PATTERN_011, self::PATTERN_100, self::PATTERN_101, self::PATTERN_110, self::PATTERN_111]</span>
  476. </code>
  477. </article>
  478. </section>
  479. <section class="phpdocumentor-properties">
  480. <h3 class="phpdocumentor-elements__header" id="properties">
  481. Properties
  482. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  483. </h3>
  484. <article
  485. class="
  486. phpdocumentor-element
  487. -property
  488. -private
  489. "
  490. >
  491. <h4 class="phpdocumentor-element__name" id="property_maskPattern">
  492. $maskPattern
  493. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#property_maskPattern" class="headerlink"><i class="fas fa-link"></i></a>
  494. <span class="phpdocumentor-element__modifiers">
  495. </span>
  496. </h4>
  497. <aside class="phpdocumentor-element-found-in">
  498. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  499. :
  500. <span class="phpdocumentor-element-found-in__line">61</span>
  501. </aside>
  502. <p class="phpdocumentor-summary">The current mask pattern value (0-7)</p>
  503. <code class="phpdocumentor-code phpdocumentor-signature ">
  504. <span class="phpdocumentor-signature__visibility">private</span>
  505. <span class="phpdocumentor-signature__type">int</span>
  506. <span class="phpdocumentor-signature__name">$maskPattern</span>
  507. </code>
  508. </article>
  509. </section>
  510. <section class="phpdocumentor-methods">
  511. <h3 class="phpdocumentor-elements__header" id="methods">
  512. Methods
  513. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  514. </h3>
  515. <article
  516. class="phpdocumentor-element
  517. -method
  518. -public
  519. "
  520. >
  521. <h4 class="phpdocumentor-element__name" id="method___construct">
  522. __construct()
  523. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  524. </h4>
  525. <aside class="phpdocumentor-element-found-in">
  526. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  527. :
  528. <span class="phpdocumentor-element-found-in__line">68</span>
  529. </aside>
  530. <p class="phpdocumentor-summary">MaskPattern constructor.</p>
  531. <code class="phpdocumentor-code phpdocumentor-signature ">
  532. <span class="phpdocumentor-signature__visibility">public</span>
  533. <span class="phpdocumentor-signature__name">__construct</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$maskPattern</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  534. <div class="phpdocumentor-label-line">
  535. </div>
  536. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  537. <dl class="phpdocumentor-argument-list">
  538. <dt class="phpdocumentor-argument-list__entry">
  539. <span class="phpdocumentor-signature__argument__name">$maskPattern</span>
  540. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  541. </dt>
  542. <dd class="phpdocumentor-argument-list__definition">
  543. </dd>
  544. </dl>
  545. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  546. Tags
  547. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method___construct#tags" class="headerlink"><i class="fas fa-link"></i></a>
  548. </h5>
  549. <dl class="phpdocumentor-tag-list">
  550. <dt class="phpdocumentor-tag-list__entry">
  551. <span class="phpdocumentor-tag__name">throws</span>
  552. </dt>
  553. <dd class="phpdocumentor-tag-list__definition">
  554. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-QRCodeException.html"><abbr title="\chillerlan\QRCode\QRCodeException">QRCodeException</abbr></a></span>
  555. </dd>
  556. </dl>
  557. </article>
  558. <article
  559. class="phpdocumentor-element
  560. -method
  561. -public
  562. -static "
  563. >
  564. <h4 class="phpdocumentor-element__name" id="method_getBestPattern">
  565. getBestPattern()
  566. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getBestPattern" class="headerlink"><i class="fas fa-link"></i></a>
  567. </h4>
  568. <aside class="phpdocumentor-element-found-in">
  569. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  570. :
  571. <span class="phpdocumentor-element-found-in__line">115</span>
  572. </aside>
  573. <p class="phpdocumentor-summary">Evaluates the matrix of the given data interface and returns a new mask pattern instance for the best result</p>
  574. <code class="phpdocumentor-code phpdocumentor-signature ">
  575. <span class="phpdocumentor-signature__visibility">public</span>
  576. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">getBestPattern</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Data-QRMatrix.html"><abbr title="\chillerlan\QRCode\Data\QRMatrix">QRMatrix</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$QRMatrix</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">self</span></code>
  577. <div class="phpdocumentor-label-line">
  578. </div>
  579. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  580. <dl class="phpdocumentor-argument-list">
  581. <dt class="phpdocumentor-argument-list__entry">
  582. <span class="phpdocumentor-signature__argument__name">$QRMatrix</span>
  583. : <span class="phpdocumentor-signature__argument__return-type"><a href="classes/chillerlan-QRCode-Data-QRMatrix.html"><abbr title="\chillerlan\QRCode\Data\QRMatrix">QRMatrix</abbr></a></span>
  584. </dt>
  585. <dd class="phpdocumentor-argument-list__definition">
  586. </dd>
  587. </dl>
  588. <section>
  589. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  590. <span class="phpdocumentor-signature__response_type">self</span>
  591. </section>
  592. </article>
  593. <article
  594. class="phpdocumentor-element
  595. -method
  596. -public
  597. "
  598. >
  599. <h4 class="phpdocumentor-element__name" id="method_getMask">
  600. getMask()
  601. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getMask" class="headerlink"><i class="fas fa-link"></i></a>
  602. </h4>
  603. <aside class="phpdocumentor-element-found-in">
  604. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  605. :
  606. <span class="phpdocumentor-element-found-in__line">98</span>
  607. </aside>
  608. <p class="phpdocumentor-summary">Returns a closure that applies the mask for the chosen mask pattern.</p>
  609. <code class="phpdocumentor-code phpdocumentor-signature ">
  610. <span class="phpdocumentor-signature__visibility">public</span>
  611. <span class="phpdocumentor-signature__name">getMask</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type"><abbr title="\Closure">Closure</abbr></span></code>
  612. <div class="phpdocumentor-label-line">
  613. </div>
  614. <section class="phpdocumentor-description"><p>Encapsulates data masks for the data bits in a QR code, per ISO 18004:2006 6.8. Implementations
  615. of this class can un-mask a raw BitMatrix. For simplicity, they will unmask the entire BitMatrix,
  616. including areas used for finder patterns, timing patterns, etc. These areas should be unused
  617. after the point they are unmasked anyway.</p>
  618. <p>Note that the diagram in section 6.8.1 is misleading since it indicates that $i is column position
  619. and $j is row position. In fact, as the text says, $i is row position and $j is column position.</p>
  620. </section>
  621. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  622. Tags
  623. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getMask#tags" class="headerlink"><i class="fas fa-link"></i></a>
  624. </h5>
  625. <dl class="phpdocumentor-tag-list">
  626. <dt class="phpdocumentor-tag-list__entry">
  627. <span class="phpdocumentor-tag__name">see</span>
  628. </dt>
  629. <dd class="phpdocumentor-tag-list__definition">
  630. <span class="phpdocumentor-tag-link"><a href="https://www.thonky.com/qr-code-tutorial/mask-patterns">https://www.thonky.com/qr-code-tutorial/mask-patterns</a></span>
  631. </dd>
  632. <dt class="phpdocumentor-tag-list__entry">
  633. <span class="phpdocumentor-tag__name">see</span>
  634. </dt>
  635. <dd class="phpdocumentor-tag-list__definition">
  636. <span class="phpdocumentor-tag-link"><a href="https://github.com/zxing/zxing/blob/e9e2bd280bcaeabd59d0f955798384fe6c018a6c/core/src/main/java/com/google/zxing/qrcode/decoder/DataMask.java#L32-L117">https://github.com/zxing/zxing/blob/e9e2bd280bcaeabd59d0f955798384fe6c018a6c/core/src/main/java/com/google/zxing/qrcode/decoder/DataMask.java#L32-L117</a></span>
  637. </dd>
  638. </dl>
  639. <section>
  640. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  641. <span class="phpdocumentor-signature__response_type"><abbr title="\Closure">Closure</abbr></span>
  642. </section>
  643. </article>
  644. <article
  645. class="phpdocumentor-element
  646. -method
  647. -public
  648. "
  649. >
  650. <h4 class="phpdocumentor-element__name" id="method_getPattern">
  651. getPattern()
  652. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getPattern" class="headerlink"><i class="fas fa-link"></i></a>
  653. </h4>
  654. <aside class="phpdocumentor-element-found-in">
  655. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  656. :
  657. <span class="phpdocumentor-element-found-in__line">80</span>
  658. </aside>
  659. <p class="phpdocumentor-summary">Returns the current mask pattern</p>
  660. <code class="phpdocumentor-code phpdocumentor-signature ">
  661. <span class="phpdocumentor-signature__visibility">public</span>
  662. <span class="phpdocumentor-signature__name">getPattern</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  663. <div class="phpdocumentor-label-line">
  664. </div>
  665. <section>
  666. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  667. <span class="phpdocumentor-signature__response_type">int</span>
  668. </section>
  669. </article>
  670. <article
  671. class="phpdocumentor-element
  672. -method
  673. -public
  674. -static "
  675. >
  676. <h4 class="phpdocumentor-element__name" id="method_testRule1">
  677. testRule1()
  678. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule1" class="headerlink"><i class="fas fa-link"></i></a>
  679. </h4>
  680. <aside class="phpdocumentor-element-found-in">
  681. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  682. :
  683. <span class="phpdocumentor-element-found-in__line">137</span>
  684. </aside>
  685. <p class="phpdocumentor-summary">Apply mask penalty rule 1 and return the penalty. Find repetitive cells with the same color and
  686. give penalty to them. Example: 00000 or 11111.</p>
  687. <code class="phpdocumentor-code phpdocumentor-signature ">
  688. <span class="phpdocumentor-signature__visibility">public</span>
  689. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">testRule1</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">$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">$height</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">$width</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  690. <div class="phpdocumentor-label-line">
  691. </div>
  692. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  693. <dl class="phpdocumentor-argument-list">
  694. <dt class="phpdocumentor-argument-list__entry">
  695. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  696. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  697. </dt>
  698. <dd class="phpdocumentor-argument-list__definition">
  699. </dd>
  700. <dt class="phpdocumentor-argument-list__entry">
  701. <span class="phpdocumentor-signature__argument__name">$height</span>
  702. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  703. </dt>
  704. <dd class="phpdocumentor-argument-list__definition">
  705. </dd>
  706. <dt class="phpdocumentor-argument-list__entry">
  707. <span class="phpdocumentor-signature__argument__name">$width</span>
  708. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  709. </dt>
  710. <dd class="phpdocumentor-argument-list__definition">
  711. </dd>
  712. </dl>
  713. <section>
  714. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  715. <span class="phpdocumentor-signature__response_type">int</span>
  716. </section>
  717. </article>
  718. <article
  719. class="phpdocumentor-element
  720. -method
  721. -public
  722. -static "
  723. >
  724. <h4 class="phpdocumentor-element__name" id="method_testRule2">
  725. testRule2()
  726. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule2" class="headerlink"><i class="fas fa-link"></i></a>
  727. </h4>
  728. <aside class="phpdocumentor-element-found-in">
  729. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  730. :
  731. <span class="phpdocumentor-element-found-in__line">182</span>
  732. </aside>
  733. <p class="phpdocumentor-summary">Apply mask penalty rule 2 and return the penalty. Find 2x2 blocks with the same color and give
  734. penalty to them. This is actually equivalent to the spec&#039;s rule, which is to find MxN blocks and give a
  735. penalty proportional to (M-1)x(N-1), because this is the number of 2x2 blocks inside such a block.</p>
  736. <code class="phpdocumentor-code phpdocumentor-signature ">
  737. <span class="phpdocumentor-signature__visibility">public</span>
  738. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">testRule2</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">$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">$height</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">$width</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  739. <div class="phpdocumentor-label-line">
  740. </div>
  741. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  742. <dl class="phpdocumentor-argument-list">
  743. <dt class="phpdocumentor-argument-list__entry">
  744. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  745. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  746. </dt>
  747. <dd class="phpdocumentor-argument-list__definition">
  748. </dd>
  749. <dt class="phpdocumentor-argument-list__entry">
  750. <span class="phpdocumentor-signature__argument__name">$height</span>
  751. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  752. </dt>
  753. <dd class="phpdocumentor-argument-list__definition">
  754. </dd>
  755. <dt class="phpdocumentor-argument-list__entry">
  756. <span class="phpdocumentor-signature__argument__name">$width</span>
  757. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  758. </dt>
  759. <dd class="phpdocumentor-argument-list__definition">
  760. </dd>
  761. </dl>
  762. <section>
  763. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  764. <span class="phpdocumentor-signature__response_type">int</span>
  765. </section>
  766. </article>
  767. <article
  768. class="phpdocumentor-element
  769. -method
  770. -public
  771. -static "
  772. >
  773. <h4 class="phpdocumentor-element__name" id="method_testRule3">
  774. testRule3()
  775. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule3" class="headerlink"><i class="fas fa-link"></i></a>
  776. </h4>
  777. <aside class="phpdocumentor-element-found-in">
  778. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  779. :
  780. <span class="phpdocumentor-element-found-in__line">215</span>
  781. </aside>
  782. <p class="phpdocumentor-summary">Apply mask penalty rule 3 and return the penalty. Find consecutive runs of 1:1:3:1:1:4
  783. starting with black, or 4:1:1:3:1:1 starting with white, and give penalty to them. If we
  784. find patterns like 000010111010000, we give penalty once.</p>
  785. <code class="phpdocumentor-code phpdocumentor-signature ">
  786. <span class="phpdocumentor-signature__visibility">public</span>
  787. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">testRule3</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">$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">$height</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">$width</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  788. <div class="phpdocumentor-label-line">
  789. </div>
  790. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  791. <dl class="phpdocumentor-argument-list">
  792. <dt class="phpdocumentor-argument-list__entry">
  793. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  794. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  795. </dt>
  796. <dd class="phpdocumentor-argument-list__definition">
  797. </dd>
  798. <dt class="phpdocumentor-argument-list__entry">
  799. <span class="phpdocumentor-signature__argument__name">$height</span>
  800. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  801. </dt>
  802. <dd class="phpdocumentor-argument-list__definition">
  803. </dd>
  804. <dt class="phpdocumentor-argument-list__entry">
  805. <span class="phpdocumentor-signature__argument__name">$width</span>
  806. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  807. </dt>
  808. <dd class="phpdocumentor-argument-list__definition">
  809. </dd>
  810. </dl>
  811. <section>
  812. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  813. <span class="phpdocumentor-signature__response_type">int</span>
  814. </section>
  815. </article>
  816. <article
  817. class="phpdocumentor-element
  818. -method
  819. -public
  820. -static "
  821. >
  822. <h4 class="phpdocumentor-element__name" id="method_testRule4">
  823. testRule4()
  824. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule4" class="headerlink"><i class="fas fa-link"></i></a>
  825. </h4>
  826. <aside class="phpdocumentor-element-found-in">
  827. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  828. :
  829. <span class="phpdocumentor-element-found-in__line">301</span>
  830. </aside>
  831. <p class="phpdocumentor-summary">Apply mask penalty rule 4 and return the penalty. Calculate the ratio of dark cells and give
  832. penalty if the ratio is far from 50%. It gives 10 penalty for 5% distance.</p>
  833. <code class="phpdocumentor-code phpdocumentor-signature ">
  834. <span class="phpdocumentor-signature__visibility">public</span>
  835. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">testRule4</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">$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">$height</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">$width</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  836. <div class="phpdocumentor-label-line">
  837. </div>
  838. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  839. <dl class="phpdocumentor-argument-list">
  840. <dt class="phpdocumentor-argument-list__entry">
  841. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  842. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  843. </dt>
  844. <dd class="phpdocumentor-argument-list__definition">
  845. </dd>
  846. <dt class="phpdocumentor-argument-list__entry">
  847. <span class="phpdocumentor-signature__argument__name">$height</span>
  848. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  849. </dt>
  850. <dd class="phpdocumentor-argument-list__definition">
  851. </dd>
  852. <dt class="phpdocumentor-argument-list__entry">
  853. <span class="phpdocumentor-signature__argument__name">$width</span>
  854. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  855. </dt>
  856. <dd class="phpdocumentor-argument-list__definition">
  857. </dd>
  858. </dl>
  859. <section>
  860. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  861. <span class="phpdocumentor-signature__response_type">int</span>
  862. </section>
  863. </article>
  864. <article
  865. class="phpdocumentor-element
  866. -method
  867. -private
  868. -static "
  869. >
  870. <h4 class="phpdocumentor-element__name" id="method_applyRule1">
  871. applyRule1()
  872. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_applyRule1" class="headerlink"><i class="fas fa-link"></i></a>
  873. </h4>
  874. <aside class="phpdocumentor-element-found-in">
  875. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  876. :
  877. <span class="phpdocumentor-element-found-in__line">144</span>
  878. </aside>
  879. <code class="phpdocumentor-code phpdocumentor-signature ">
  880. <span class="phpdocumentor-signature__visibility">private</span>
  881. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">applyRule1</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">$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">$height</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">$width</span></span><span class="phpdocumentor-signature__argument"><span>, </span><span class="phpdocumentor-signature__argument__return-type">bool&nbsp;</span><span class="phpdocumentor-signature__argument__name">$isHorizontal</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  882. <div class="phpdocumentor-label-line">
  883. </div>
  884. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  885. <dl class="phpdocumentor-argument-list">
  886. <dt class="phpdocumentor-argument-list__entry">
  887. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  888. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  889. </dt>
  890. <dd class="phpdocumentor-argument-list__definition">
  891. </dd>
  892. <dt class="phpdocumentor-argument-list__entry">
  893. <span class="phpdocumentor-signature__argument__name">$height</span>
  894. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  895. </dt>
  896. <dd class="phpdocumentor-argument-list__definition">
  897. </dd>
  898. <dt class="phpdocumentor-argument-list__entry">
  899. <span class="phpdocumentor-signature__argument__name">$width</span>
  900. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  901. </dt>
  902. <dd class="phpdocumentor-argument-list__definition">
  903. </dd>
  904. <dt class="phpdocumentor-argument-list__entry">
  905. <span class="phpdocumentor-signature__argument__name">$isHorizontal</span>
  906. : <span class="phpdocumentor-signature__argument__return-type">bool</span>
  907. </dt>
  908. <dd class="phpdocumentor-argument-list__definition">
  909. </dd>
  910. </dl>
  911. <section>
  912. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  913. <span class="phpdocumentor-signature__response_type">int</span>
  914. </section>
  915. </article>
  916. <article
  917. class="phpdocumentor-element
  918. -method
  919. -private
  920. -static "
  921. >
  922. <h4 class="phpdocumentor-element__name" id="method_isWhiteHorizontal">
  923. isWhiteHorizontal()
  924. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteHorizontal" class="headerlink"><i class="fas fa-link"></i></a>
  925. </h4>
  926. <aside class="phpdocumentor-element-found-in">
  927. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  928. :
  929. <span class="phpdocumentor-element-found-in__line">264</span>
  930. </aside>
  931. <code class="phpdocumentor-code phpdocumentor-signature ">
  932. <span class="phpdocumentor-signature__visibility">private</span>
  933. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">isWhiteHorizontal</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">$row</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">$width</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">$from</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">$to</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
  934. <div class="phpdocumentor-label-line">
  935. </div>
  936. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  937. <dl class="phpdocumentor-argument-list">
  938. <dt class="phpdocumentor-argument-list__entry">
  939. <span class="phpdocumentor-signature__argument__name">$row</span>
  940. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  941. </dt>
  942. <dd class="phpdocumentor-argument-list__definition">
  943. </dd>
  944. <dt class="phpdocumentor-argument-list__entry">
  945. <span class="phpdocumentor-signature__argument__name">$width</span>
  946. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  947. </dt>
  948. <dd class="phpdocumentor-argument-list__definition">
  949. </dd>
  950. <dt class="phpdocumentor-argument-list__entry">
  951. <span class="phpdocumentor-signature__argument__name">$from</span>
  952. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  953. </dt>
  954. <dd class="phpdocumentor-argument-list__definition">
  955. </dd>
  956. <dt class="phpdocumentor-argument-list__entry">
  957. <span class="phpdocumentor-signature__argument__name">$to</span>
  958. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  959. </dt>
  960. <dd class="phpdocumentor-argument-list__definition">
  961. </dd>
  962. </dl>
  963. <section>
  964. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  965. <span class="phpdocumentor-signature__response_type">bool</span>
  966. </section>
  967. </article>
  968. <article
  969. class="phpdocumentor-element
  970. -method
  971. -private
  972. -static "
  973. >
  974. <h4 class="phpdocumentor-element__name" id="method_isWhiteVertical">
  975. isWhiteVertical()
  976. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteVertical" class="headerlink"><i class="fas fa-link"></i></a>
  977. </h4>
  978. <aside class="phpdocumentor-element-found-in">
  979. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/MaskPattern.php"><a href="files/src-common-maskpattern.html"><abbr title="src/Common/MaskPattern.php">MaskPattern.php</abbr></a></abbr>
  980. :
  981. <span class="phpdocumentor-element-found-in__line">282</span>
  982. </aside>
  983. <code class="phpdocumentor-code phpdocumentor-signature ">
  984. <span class="phpdocumentor-signature__visibility">private</span>
  985. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">isWhiteVertical</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">$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">$height</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">$x</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">$from</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">$to</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">bool</span></code>
  986. <div class="phpdocumentor-label-line">
  987. </div>
  988. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  989. <dl class="phpdocumentor-argument-list">
  990. <dt class="phpdocumentor-argument-list__entry">
  991. <span class="phpdocumentor-signature__argument__name">$matrix</span>
  992. : <span class="phpdocumentor-signature__argument__return-type">array&lt;string|int, mixed&gt;</span>
  993. </dt>
  994. <dd class="phpdocumentor-argument-list__definition">
  995. </dd>
  996. <dt class="phpdocumentor-argument-list__entry">
  997. <span class="phpdocumentor-signature__argument__name">$height</span>
  998. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  999. </dt>
  1000. <dd class="phpdocumentor-argument-list__definition">
  1001. </dd>
  1002. <dt class="phpdocumentor-argument-list__entry">
  1003. <span class="phpdocumentor-signature__argument__name">$x</span>
  1004. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  1005. </dt>
  1006. <dd class="phpdocumentor-argument-list__definition">
  1007. </dd>
  1008. <dt class="phpdocumentor-argument-list__entry">
  1009. <span class="phpdocumentor-signature__argument__name">$from</span>
  1010. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  1011. </dt>
  1012. <dd class="phpdocumentor-argument-list__definition">
  1013. </dd>
  1014. <dt class="phpdocumentor-argument-list__entry">
  1015. <span class="phpdocumentor-signature__argument__name">$to</span>
  1016. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  1017. </dt>
  1018. <dd class="phpdocumentor-argument-list__definition">
  1019. </dd>
  1020. </dl>
  1021. <section>
  1022. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  1023. <span class="phpdocumentor-signature__response_type">bool</span>
  1024. </section>
  1025. </article>
  1026. </section>
  1027. <div class="phpdocumentor-modal" id="source-view">
  1028. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  1029. <div class="phpdocumentor-modal-container">
  1030. <div class="phpdocumentor-modal-content">
  1031. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Common/MaskPattern.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  1032. </div>
  1033. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  1034. </div>
  1035. </div>
  1036. <script type="text/javascript">
  1037. (function () {
  1038. function loadExternalCodeSnippet(el, url, line) {
  1039. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  1040. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  1041. const language = 'php';
  1042. const code = document.createElement('code');
  1043. code.className = 'language-' + language;
  1044. pre.textContent = '';
  1045. pre.setAttribute('data-line', line)
  1046. code.textContent = 'Loading…';
  1047. pre.appendChild(code);
  1048. var xhr = new XMLHttpRequest();
  1049. xhr.open('GET', src, true);
  1050. xhr.onreadystatechange = function () {
  1051. if (xhr.readyState !== 4) {
  1052. return;
  1053. }
  1054. if (xhr.status < 400 && xhr.responseText) {
  1055. code.textContent = xhr.responseText;
  1056. Prism.highlightElement(code);
  1057. return;
  1058. }
  1059. if (xhr.status === 404) {
  1060. code.textContent = '✖ Error: File could not be found';
  1061. return;
  1062. }
  1063. if (xhr.status >= 400) {
  1064. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  1065. return;
  1066. }
  1067. code.textContent = '✖ Error: An unknown error occurred';
  1068. };
  1069. xhr.send(null);
  1070. });
  1071. }
  1072. const modalButtons = document.querySelectorAll("[data-modal]");
  1073. const openedAsLocalFile = window.location.protocol === 'file:';
  1074. if (modalButtons.length > 0 && openedAsLocalFile) {
  1075. console.warn(
  1076. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  1077. 'browsers block XHR requests when a page is opened this way'
  1078. );
  1079. }
  1080. modalButtons.forEach(function (trigger) {
  1081. if (openedAsLocalFile) {
  1082. trigger.setAttribute("hidden", "hidden");
  1083. }
  1084. trigger.addEventListener("click", function (event) {
  1085. event.preventDefault();
  1086. const modal = document.getElementById(trigger.dataset.modal);
  1087. if (!modal) {
  1088. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  1089. return;
  1090. }
  1091. modal.classList.add("phpdocumentor-modal__open");
  1092. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  1093. const exits = modal.querySelectorAll("[data-exit-button]");
  1094. exits.forEach(function (exit) {
  1095. exit.addEventListener("click", function (event) {
  1096. event.preventDefault();
  1097. modal.classList.remove("phpdocumentor-modal__open");
  1098. });
  1099. });
  1100. });
  1101. });
  1102. })();
  1103. </script>
  1104. </article>
  1105. </section>
  1106. <section class="phpdocumentor-on-this-page__sidebar">
  1107. <section class="phpdocumentor-on-this-page__content">
  1108. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  1109. <ul class="phpdocumentor-list -clean">
  1110. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  1111. <li>
  1112. <ul class="phpdocumentor-list -clean">
  1113. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-constants">Constants</a></li>
  1114. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-properties">Properties</a></li>
  1115. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#toc-methods">Methods</a></li>
  1116. </ul>
  1117. </li>
  1118. <li class="phpdocumentor-on-this-page-section__title">Constants</li>
  1119. <li>
  1120. <ul class="phpdocumentor-list -clean">
  1121. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_AUTO">AUTO</a></li>
  1122. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_000">PATTERN_000</a></li>
  1123. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_001">PATTERN_001</a></li>
  1124. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_010">PATTERN_010</a></li>
  1125. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_011">PATTERN_011</a></li>
  1126. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_100">PATTERN_100</a></li>
  1127. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_101">PATTERN_101</a></li>
  1128. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_110">PATTERN_110</a></li>
  1129. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERN_111">PATTERN_111</a></li>
  1130. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#constant_PATTERNS">PATTERNS</a></li>
  1131. </ul>
  1132. </li>
  1133. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  1134. <li>
  1135. <ul class="phpdocumentor-list -clean">
  1136. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#property_maskPattern">$maskPattern<a href="classes/chillerlan-QRCode-Common-MaskPattern.html"></li>
  1137. </ul>
  1138. </li>
  1139. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  1140. <li>
  1141. <ul class="phpdocumentor-list -clean">
  1142. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method___construct">__construct()</a></li>
  1143. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getBestPattern">getBestPattern()</a></li>
  1144. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getMask">getMask()</a></li>
  1145. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_getPattern">getPattern()</a></li>
  1146. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule1">testRule1()</a></li>
  1147. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule2">testRule2()</a></li>
  1148. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule3">testRule3()</a></li>
  1149. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_testRule4">testRule4()</a></li>
  1150. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_applyRule1">applyRule1()</a></li>
  1151. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteHorizontal">isWhiteHorizontal()</a></li>
  1152. <li><a href="classes/chillerlan-QRCode-Common-MaskPattern.html#method_isWhiteVertical">isWhiteVertical()</a></li>
  1153. </ul>
  1154. </li>
  1155. </ul>
  1156. </section>
  1157. </section>
  1158. </div>
  1159. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  1160. <section class="phpdocumentor-search-results__dialog">
  1161. <header class="phpdocumentor-search-results__header">
  1162. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  1163. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  1164. </header>
  1165. <section class="phpdocumentor-search-results__body">
  1166. <ul class="phpdocumentor-search-results__entries"></ul>
  1167. </section>
  1168. </section>
  1169. </section>
  1170. </div>
  1171. <a href="classes/chillerlan-QRCode-Common-MaskPattern.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  1172. </main>
  1173. <script>
  1174. cssVars({});
  1175. </script>
  1176. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  1177. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  1178. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  1179. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  1180. </body>
  1181. </html>