chillerlan-QRCode-Common-MaskPattern.html 70 KB

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