chillerlan-QRCode-Common-LuminanceSourceAbstract.html 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Documentation</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <base href="../">
  8. <link rel="icon" href="images/favicon.ico"/>
  9. <link rel="stylesheet" href="css/normalize.css">
  10. <link rel="stylesheet" href="css/base.css">
  11. <link rel="preconnect" href="https://fonts.gstatic.com">
  12. <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@100;200;300;400;600;700&display=swap" rel="stylesheet">
  13. <link href="https://fonts.googleapis.com/css2?family=Source+Code+Pro:wght@400;600;700&display=swap" rel="stylesheet">
  14. <link rel="stylesheet" href="css/template.css">
  15. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0/css/all.min.css" integrity="sha256-ybRkN9dBjhcS2qrW1z+hfCxq+1aBdwyQM5wlQoQVt/0=" crossorigin="anonymous" />
  16. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/themes/prism-okaidia.css">
  17. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.css">
  18. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.css">
  19. <script src="https://cdn.jsdelivr.net/npm/fuse.js@3.4.6"></script>
  20. <script src="https://cdn.jsdelivr.net/npm/css-vars-ponyfill@2"></script>
  21. <script src="js/template.js"></script>
  22. <script src="js/search.js"></script>
  23. <script defer src="js/searchIndex.js"></script>
  24. </head>
  25. <body id="top">
  26. <header class="phpdocumentor-header phpdocumentor-section">
  27. <h1 class="phpdocumentor-title"><a href="" class="phpdocumentor-title__link">Documentation</a></h1>
  28. <input class="phpdocumentor-header__menu-button" type="checkbox" id="menu-button" name="menu-button" />
  29. <label class="phpdocumentor-header__menu-icon" for="menu-button">
  30. <i class="fas fa-bars"></i>
  31. </label>
  32. <section data-search-form class="phpdocumentor-search">
  33. <label>
  34. <span class="visually-hidden">Search for</span>
  35. <svg class="phpdocumentor-search__icon" width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
  36. <circle cx="7.5" cy="7.5" r="6.5" stroke="currentColor" stroke-width="2"/>
  37. <line x1="12.4892" y1="12.2727" x2="19.1559" y2="18.9393" stroke="currentColor" stroke-width="3"/>
  38. </svg>
  39. <input type="search" class="phpdocumentor-field phpdocumentor-search__field" placeholder="Loading .." disabled />
  40. </label>
  41. </section>
  42. <nav class="phpdocumentor-topnav">
  43. <ul class="phpdocumentor-topnav__menu">
  44. <li class="phpdocumentor-topnav__menu-item -menu">
  45. <a href="https://php-qrcode.readthedocs.io">
  46. <span>
  47. User Manual
  48. </span>
  49. </a>
  50. </li>
  51. <li class="phpdocumentor-topnav__menu-item -social">
  52. <a href="https://github.com/chillerlan/php-qrcode">
  53. <span>
  54. <i class="fab fa-github"></i>
  55. </span>
  56. </a>
  57. </li>
  58. <li class="phpdocumentor-topnav__menu-item -social">
  59. <a href="https://github.com/chillerlan/php-qrcode/discussions">
  60. <span>
  61. <i class="fas fa-envelope-open-text"></i>
  62. </span>
  63. </a>
  64. </li>
  65. </ul>
  66. </nav>
  67. </header>
  68. <main class="phpdocumentor">
  69. <div class="phpdocumentor-section">
  70. <input class="phpdocumentor-sidebar__menu-button" type="checkbox" id="sidebar-button" name="sidebar-button" />
  71. <label class="phpdocumentor-sidebar__menu-icon" for="sidebar-button">
  72. Menu
  73. </label>
  74. <aside class="phpdocumentor-column -three phpdocumentor-sidebar">
  75. <section class="phpdocumentor-sidebar__category -namespaces">
  76. <h2 class="phpdocumentor-sidebar__category-header">Namespaces</h2>
  77. <h4 class="phpdocumentor-sidebar__root-namespace">
  78. <a href="namespaces/chillerlan.html" class="">chillerlan</a>
  79. </h4>
  80. <ul class="phpdocumentor-list">
  81. <li>
  82. <a href="namespaces/chillerlan-qrcode.html" class="">QRCode</a>
  83. </li>
  84. <li>
  85. <a href="namespaces/chillerlan-qrcodetest.html" class="">QRCodeTest</a>
  86. </li>
  87. </ul>
  88. </section>
  89. <section class="phpdocumentor-sidebar__category -packages">
  90. <h2 class="phpdocumentor-sidebar__category-header">Packages</h2>
  91. <h4 class="phpdocumentor-sidebar__root-namespace">
  92. <a href="packages/Application.html" class="">Application</a>
  93. </h4>
  94. </section>
  95. <section class="phpdocumentor-sidebar__category -reports">
  96. <h2 class="phpdocumentor-sidebar__category-header">Reports</h2>
  97. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/deprecated.html">Deprecated</a></h3>
  98. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/errors.html">Errors</a></h3>
  99. <h3 class="phpdocumentor-sidebar__root-package"><a href="reports/markers.html">Markers</a></h3>
  100. </section>
  101. <section class="phpdocumentor-sidebar__category -indices">
  102. <h2 class="phpdocumentor-sidebar__category-header">Indices</h2>
  103. <h3 class="phpdocumentor-sidebar__root-package"><a href="indices/files.html">Files</a></h3>
  104. </section>
  105. </aside>
  106. <div class="phpdocumentor-column -nine phpdocumentor-content">
  107. <section>
  108. <ul class="phpdocumentor-breadcrumbs">
  109. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan.html">chillerlan</a></li>
  110. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode.html">QRCode</a></li>
  111. <li class="phpdocumentor-breadcrumb"><a href="namespaces/chillerlan-qrcode-common.html">Common</a></li>
  112. </ul>
  113. <article class="phpdocumentor-element -class">
  114. <h2 class="phpdocumentor-content__title">
  115. LuminanceSourceAbstract
  116. <div class="phpdocumentor-element__package">
  117. in package
  118. <ul class="phpdocumentor-breadcrumbs">
  119. <li class="phpdocumentor-breadcrumb"><a href="packages/Application.html">Application</a></li>
  120. </ul>
  121. </div>
  122. <span class="phpdocumentor-element__implements">
  123. implements
  124. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a> </span>
  125. </h2>
  126. <div class="phpdocumentor-label-line">
  127. <div class="phpdocumentor-label phpdocumentor-label--success"><span>Abstract</span><span>Yes</span></div>
  128. </div>
  129. <aside class="phpdocumentor-element-found-in">
  130. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  131. :
  132. <span class="phpdocumentor-element-found-in__line">27</span>
  133. </aside>
  134. <p class="phpdocumentor-summary">The purpose of this class hierarchy is to abstract different bitmap implementations across
  135. platforms into a standard interface for requesting greyscale luminance values.</p>
  136. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  137. Tags
  138. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#tags" class="headerlink"><i class="fas fa-link"></i></a>
  139. </h5>
  140. <dl class="phpdocumentor-tag-list">
  141. <dt class="phpdocumentor-tag-list__entry">
  142. <span class="phpdocumentor-tag__name">author</span>
  143. </dt>
  144. <dd class="phpdocumentor-tag-list__definition">
  145. <section class="phpdocumentor-description"><p>dswitkin@google.com (Daniel Switkin)</p>
  146. </section>
  147. </dd>
  148. </dl>
  149. <h3 id="toc">
  150. Table of Contents
  151. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc" class="headerlink"><i class="fas fa-link"></i></a>
  152. </h3>
  153. <h4 id="toc-interfaces">
  154. Interfaces
  155. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc-interfaces" class="headerlink"><i class="fas fa-link"></i></a>
  156. </h4>
  157. <dl class="phpdocumentor-table-of-contents">
  158. <dt class="phpdocumentor-table-of-contents__entry -interface"><a href="classes/chillerlan-QRCode-Common-LuminanceSourceInterface.html"><abbr title="\chillerlan\QRCode\Common\LuminanceSourceInterface">LuminanceSourceInterface</abbr></a></dt><dd>Interface for the luminance sources</dd> </dl>
  159. <h4 id="toc-properties">
  160. Properties
  161. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc-properties" class="headerlink"><i class="fas fa-link"></i></a>
  162. </h4>
  163. <dl class="phpdocumentor-table-of-contents">
  164. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  165. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_height">$height</a>
  166. <span>
  167. &nbsp;: int </span>
  168. </dt>
  169. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  170. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_luminances">$luminances</a>
  171. <span>
  172. &nbsp;: array&lt;string|int, int&gt; </span>
  173. </dt>
  174. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  175. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_options">$options</a>
  176. <span>
  177. &nbsp;: <abbr title="\chillerlan\Settings\SettingsContainerInterface">SettingsContainerInterface</abbr>|<a href="classes/chillerlan-QRCode-QROptions.html"><abbr title="\chillerlan\QRCode\QROptions">QROptions</abbr></a> </span>
  178. </dt>
  179. <dt class="phpdocumentor-table-of-contents__entry -property -protected">
  180. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_width">$width</a>
  181. <span>
  182. &nbsp;: int </span>
  183. </dt>
  184. </dl>
  185. <h4 id="toc-methods">
  186. Methods
  187. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc-methods" class="headerlink"><i class="fas fa-link"></i></a>
  188. </h4>
  189. <dl class="phpdocumentor-table-of-contents">
  190. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  191. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method___construct">__construct()</a>
  192. <span>
  193. &nbsp;: mixed </span>
  194. </dt>
  195. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  196. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getHeight">getHeight()</a>
  197. <span>
  198. &nbsp;: int </span>
  199. </dt>
  200. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  201. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getLuminances">getLuminances()</a>
  202. <span>
  203. &nbsp;: array&lt;string|int, int&gt; </span>
  204. </dt>
  205. <dd>Fetches luminance data for the underlying bitmap. Values should be fetched using:
  206. `int luminance = array[y * width + x] &amp; 0xff`</dd>
  207. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  208. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getRow">getRow()</a>
  209. <span>
  210. &nbsp;: array&lt;string|int, int&gt; </span>
  211. </dt>
  212. <dd>Fetches one row of luminance data from the underlying platform&#039;s bitmap. Values range from
  213. 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
  214. to bitwise and with 0xff for each value. It is preferable for implementations of this method
  215. to only fetch this row rather than the whole image, since no 2D Readers may be installed and
  216. getLuminances() may never be called.</dd>
  217. <dt class="phpdocumentor-table-of-contents__entry -method -public">
  218. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getWidth">getWidth()</a>
  219. <span>
  220. &nbsp;: int </span>
  221. </dt>
  222. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  223. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_checkFile">checkFile()</a>
  224. <span>
  225. &nbsp;: string </span>
  226. </dt>
  227. <dt class="phpdocumentor-table-of-contents__entry -method -protected">
  228. <a class="" href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_setLuminancePixel">setLuminancePixel()</a>
  229. <span>
  230. &nbsp;: void </span>
  231. </dt>
  232. </dl>
  233. <section class="phpdocumentor-properties">
  234. <h3 class="phpdocumentor-elements__header" id="properties">
  235. Properties
  236. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#properties" class="headerlink"><i class="fas fa-link"></i></a>
  237. </h3>
  238. <article
  239. class="
  240. phpdocumentor-element
  241. -property
  242. -protected
  243. "
  244. >
  245. <h4 class="phpdocumentor-element__name" id="property_height">
  246. $height
  247. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_height" class="headerlink"><i class="fas fa-link"></i></a>
  248. <span class="phpdocumentor-element__modifiers">
  249. </span>
  250. </h4>
  251. <aside class="phpdocumentor-element-found-in">
  252. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  253. :
  254. <span class="phpdocumentor-element-found-in__line">33</span>
  255. </aside>
  256. <code class="phpdocumentor-code phpdocumentor-signature ">
  257. <span class="phpdocumentor-signature__visibility">protected</span>
  258. <span class="phpdocumentor-signature__type">int</span>
  259. <span class="phpdocumentor-signature__name">$height</span>
  260. </code>
  261. </article>
  262. <article
  263. class="
  264. phpdocumentor-element
  265. -property
  266. -protected
  267. "
  268. >
  269. <h4 class="phpdocumentor-element__name" id="property_luminances">
  270. $luminances
  271. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_luminances" class="headerlink"><i class="fas fa-link"></i></a>
  272. <span class="phpdocumentor-element__modifiers">
  273. </span>
  274. </h4>
  275. <aside class="phpdocumentor-element-found-in">
  276. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  277. :
  278. <span class="phpdocumentor-element-found-in__line">31</span>
  279. </aside>
  280. <code class="phpdocumentor-code phpdocumentor-signature ">
  281. <span class="phpdocumentor-signature__visibility">protected</span>
  282. <span class="phpdocumentor-signature__type">array&lt;string|int, int&gt;</span>
  283. <span class="phpdocumentor-signature__name">$luminances</span>
  284. = <span class="phpdocumentor-signature__default-value">[]</span></code>
  285. </article>
  286. <article
  287. class="
  288. phpdocumentor-element
  289. -property
  290. -protected
  291. "
  292. >
  293. <h4 class="phpdocumentor-element__name" id="property_options">
  294. $options
  295. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_options" class="headerlink"><i class="fas fa-link"></i></a>
  296. <span class="phpdocumentor-element__modifiers">
  297. </span>
  298. </h4>
  299. <aside class="phpdocumentor-element-found-in">
  300. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  301. :
  302. <span class="phpdocumentor-element-found-in__line">29</span>
  303. </aside>
  304. <code class="phpdocumentor-code phpdocumentor-signature ">
  305. <span class="phpdocumentor-signature__visibility">protected</span>
  306. <span class="phpdocumentor-signature__type"><abbr title="\chillerlan\Settings\SettingsContainerInterface">SettingsContainerInterface</abbr>|<a href="classes/chillerlan-QRCode-QROptions.html"><abbr title="\chillerlan\QRCode\QROptions">QROptions</abbr></a></span>
  307. <span class="phpdocumentor-signature__name">$options</span>
  308. </code>
  309. </article>
  310. <article
  311. class="
  312. phpdocumentor-element
  313. -property
  314. -protected
  315. "
  316. >
  317. <h4 class="phpdocumentor-element__name" id="property_width">
  318. $width
  319. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_width" class="headerlink"><i class="fas fa-link"></i></a>
  320. <span class="phpdocumentor-element__modifiers">
  321. </span>
  322. </h4>
  323. <aside class="phpdocumentor-element-found-in">
  324. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  325. :
  326. <span class="phpdocumentor-element-found-in__line">32</span>
  327. </aside>
  328. <code class="phpdocumentor-code phpdocumentor-signature ">
  329. <span class="phpdocumentor-signature__visibility">protected</span>
  330. <span class="phpdocumentor-signature__type">int</span>
  331. <span class="phpdocumentor-signature__name">$width</span>
  332. </code>
  333. </article>
  334. </section>
  335. <section class="phpdocumentor-methods">
  336. <h3 class="phpdocumentor-elements__header" id="methods">
  337. Methods
  338. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#methods" class="headerlink"><i class="fas fa-link"></i></a>
  339. </h3>
  340. <article
  341. class="phpdocumentor-element
  342. -method
  343. -public
  344. "
  345. >
  346. <h4 class="phpdocumentor-element__name" id="method___construct">
  347. __construct()
  348. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method___construct" class="headerlink"><i class="fas fa-link"></i></a>
  349. </h4>
  350. <aside class="phpdocumentor-element-found-in">
  351. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  352. :
  353. <span class="phpdocumentor-element-found-in__line">35</span>
  354. </aside>
  355. <code class="phpdocumentor-code phpdocumentor-signature ">
  356. <span class="phpdocumentor-signature__visibility">public</span>
  357. <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">$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">$height</span></span><span class="phpdocumentor-signature__argument"><span>[</span><span>, </span><span class="phpdocumentor-signature__argument__return-type"><abbr title="\chillerlan\Settings\SettingsContainerInterface">SettingsContainerInterface</abbr>|<a href="classes/chillerlan-QRCode-QROptions.html"><abbr title="\chillerlan\QRCode\QROptions">QROptions</abbr></a>&nbsp;</span><span class="phpdocumentor-signature__argument__name">$options</span><span> = </span><span class="phpdocumentor-signature__argument__default-value">new QROptions()</span><span> ]</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">mixed</span></code>
  358. <div class="phpdocumentor-label-line">
  359. </div>
  360. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  361. <dl class="phpdocumentor-argument-list">
  362. <dt class="phpdocumentor-argument-list__entry">
  363. <span class="phpdocumentor-signature__argument__name">$width</span>
  364. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  365. </dt>
  366. <dd class="phpdocumentor-argument-list__definition">
  367. </dd>
  368. <dt class="phpdocumentor-argument-list__entry">
  369. <span class="phpdocumentor-signature__argument__name">$height</span>
  370. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  371. </dt>
  372. <dd class="phpdocumentor-argument-list__definition">
  373. </dd>
  374. <dt class="phpdocumentor-argument-list__entry">
  375. <span class="phpdocumentor-signature__argument__name">$options</span>
  376. : <span class="phpdocumentor-signature__argument__return-type"><abbr title="\chillerlan\Settings\SettingsContainerInterface">SettingsContainerInterface</abbr>|<a href="classes/chillerlan-QRCode-QROptions.html"><abbr title="\chillerlan\QRCode\QROptions">QROptions</abbr></a></span>
  377. = <span class="phpdocumentor-signature__argument__default-value">new QROptions()</span> </dt>
  378. <dd class="phpdocumentor-argument-list__definition">
  379. </dd>
  380. </dl>
  381. </article>
  382. <article
  383. class="phpdocumentor-element
  384. -method
  385. -public
  386. "
  387. >
  388. <h4 class="phpdocumentor-element__name" id="method_getHeight">
  389. getHeight()
  390. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getHeight" class="headerlink"><i class="fas fa-link"></i></a>
  391. </h4>
  392. <aside class="phpdocumentor-element-found-in">
  393. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  394. :
  395. <span class="phpdocumentor-element-found-in__line">49</span>
  396. </aside>
  397. <code class="phpdocumentor-code phpdocumentor-signature ">
  398. <span class="phpdocumentor-signature__visibility">public</span>
  399. <span class="phpdocumentor-signature__name">getHeight</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  400. <div class="phpdocumentor-label-line">
  401. </div>
  402. <section>
  403. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  404. <span class="phpdocumentor-signature__response_type">int</span>
  405. &mdash;
  406. <section class="phpdocumentor-description"><p>The height of the bitmap.</p>
  407. </section>
  408. </section>
  409. </article>
  410. <article
  411. class="phpdocumentor-element
  412. -method
  413. -public
  414. "
  415. >
  416. <h4 class="phpdocumentor-element__name" id="method_getLuminances">
  417. getLuminances()
  418. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getLuminances" class="headerlink"><i class="fas fa-link"></i></a>
  419. </h4>
  420. <aside class="phpdocumentor-element-found-in">
  421. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  422. :
  423. <span class="phpdocumentor-element-found-in__line">41</span>
  424. </aside>
  425. <p class="phpdocumentor-summary">Fetches luminance data for the underlying bitmap. Values should be fetched using:
  426. `int luminance = array[y * width + x] &amp; 0xff`</p>
  427. <code class="phpdocumentor-code phpdocumentor-signature ">
  428. <span class="phpdocumentor-signature__visibility">public</span>
  429. <span class="phpdocumentor-signature__name">getLuminances</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span></code>
  430. <div class="phpdocumentor-label-line">
  431. </div>
  432. <section>
  433. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  434. <span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span>
  435. &mdash;
  436. <section class="phpdocumentor-description"><p>A row-major 2D array of luminance values. Do not use result $length as it may be
  437. larger than $width * $height bytes on some platforms. Do not modify the contents
  438. of the result.</p>
  439. </section>
  440. </section>
  441. </article>
  442. <article
  443. class="phpdocumentor-element
  444. -method
  445. -public
  446. "
  447. >
  448. <h4 class="phpdocumentor-element__name" id="method_getRow">
  449. getRow()
  450. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getRow" class="headerlink"><i class="fas fa-link"></i></a>
  451. </h4>
  452. <aside class="phpdocumentor-element-found-in">
  453. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  454. :
  455. <span class="phpdocumentor-element-found-in__line">53</span>
  456. </aside>
  457. <p class="phpdocumentor-summary">Fetches one row of luminance data from the underlying platform&#039;s bitmap. Values range from
  458. 0 (black) to 255 (white). Because Java does not have an unsigned byte type, callers will have
  459. to bitwise and with 0xff for each value. It is preferable for implementations of this method
  460. to only fetch this row rather than the whole image, since no 2D Readers may be installed and
  461. getLuminances() may never be called.</p>
  462. <code class="phpdocumentor-code phpdocumentor-signature ">
  463. <span class="phpdocumentor-signature__visibility">public</span>
  464. <span class="phpdocumentor-signature__name">getRow</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$y</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span></code>
  465. <div class="phpdocumentor-label-line">
  466. </div>
  467. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  468. <dl class="phpdocumentor-argument-list">
  469. <dt class="phpdocumentor-argument-list__entry">
  470. <span class="phpdocumentor-signature__argument__name">$y</span>
  471. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  472. </dt>
  473. <dd class="phpdocumentor-argument-list__definition">
  474. <section class="phpdocumentor-description"><p>The row to fetch, which must be in [0,getHeight())</p>
  475. </section>
  476. </dd>
  477. </dl>
  478. <section>
  479. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  480. <span class="phpdocumentor-signature__response_type">array&lt;string|int, int&gt;</span>
  481. &mdash;
  482. <section class="phpdocumentor-description"><p>An array containing the luminance data.</p>
  483. </section>
  484. </section>
  485. </article>
  486. <article
  487. class="phpdocumentor-element
  488. -method
  489. -public
  490. "
  491. >
  492. <h4 class="phpdocumentor-element__name" id="method_getWidth">
  493. getWidth()
  494. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getWidth" class="headerlink"><i class="fas fa-link"></i></a>
  495. </h4>
  496. <aside class="phpdocumentor-element-found-in">
  497. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  498. :
  499. <span class="phpdocumentor-element-found-in__line">45</span>
  500. </aside>
  501. <code class="phpdocumentor-code phpdocumentor-signature ">
  502. <span class="phpdocumentor-signature__visibility">public</span>
  503. <span class="phpdocumentor-signature__name">getWidth</span><span>(</span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">int</span></code>
  504. <div class="phpdocumentor-label-line">
  505. </div>
  506. <section>
  507. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  508. <span class="phpdocumentor-signature__response_type">int</span>
  509. &mdash;
  510. <section class="phpdocumentor-description"><p>The width of the bitmap.</p>
  511. </section>
  512. </section>
  513. </article>
  514. <article
  515. class="phpdocumentor-element
  516. -method
  517. -protected
  518. -static "
  519. >
  520. <h4 class="phpdocumentor-element__name" id="method_checkFile">
  521. checkFile()
  522. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_checkFile" class="headerlink"><i class="fas fa-link"></i></a>
  523. </h4>
  524. <aside class="phpdocumentor-element-found-in">
  525. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  526. :
  527. <span class="phpdocumentor-element-found-in__line">73</span>
  528. </aside>
  529. <code class="phpdocumentor-code phpdocumentor-signature ">
  530. <span class="phpdocumentor-signature__visibility">protected</span>
  531. <span class="phpdocumentor-signature__static">static</span> <span class="phpdocumentor-signature__name">checkFile</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">string&nbsp;</span><span class="phpdocumentor-signature__argument__name">$path</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">string</span></code>
  532. <div class="phpdocumentor-label-line">
  533. </div>
  534. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  535. <dl class="phpdocumentor-argument-list">
  536. <dt class="phpdocumentor-argument-list__entry">
  537. <span class="phpdocumentor-signature__argument__name">$path</span>
  538. : <span class="phpdocumentor-signature__argument__return-type">string</span>
  539. </dt>
  540. <dd class="phpdocumentor-argument-list__definition">
  541. </dd>
  542. </dl>
  543. <h5 class="phpdocumentor-tag-list__heading" id="tags">
  544. Tags
  545. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_checkFile#tags" class="headerlink"><i class="fas fa-link"></i></a>
  546. </h5>
  547. <dl class="phpdocumentor-tag-list">
  548. <dt class="phpdocumentor-tag-list__entry">
  549. <span class="phpdocumentor-tag__name">throws</span>
  550. </dt>
  551. <dd class="phpdocumentor-tag-list__definition">
  552. <span class="phpdocumentor-tag-link"><a href="classes/chillerlan-QRCode-Decoder-QRCodeDecoderException.html"><abbr title="\chillerlan\QRCode\Decoder\QRCodeDecoderException">QRCodeDecoderException</abbr></a></span>
  553. </dd>
  554. </dl>
  555. <section>
  556. <h5 class="phpdocumentor-return-value__heading">Return values</h5>
  557. <span class="phpdocumentor-signature__response_type">string</span>
  558. </section>
  559. </article>
  560. <article
  561. class="phpdocumentor-element
  562. -method
  563. -protected
  564. "
  565. >
  566. <h4 class="phpdocumentor-element__name" id="method_setLuminancePixel">
  567. setLuminancePixel()
  568. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_setLuminancePixel" class="headerlink"><i class="fas fa-link"></i></a>
  569. </h4>
  570. <aside class="phpdocumentor-element-found-in">
  571. <abbr class="phpdocumentor-element-found-in__file" title="src/Common/LuminanceSourceAbstract.php"><a href="files/src-common-luminancesourceabstract.html"><abbr title="src/Common/LuminanceSourceAbstract.php">LuminanceSourceAbstract.php</abbr></a></abbr>
  572. :
  573. <span class="phpdocumentor-element-found-in__line">62</span>
  574. </aside>
  575. <code class="phpdocumentor-code phpdocumentor-signature ">
  576. <span class="phpdocumentor-signature__visibility">protected</span>
  577. <span class="phpdocumentor-signature__name">setLuminancePixel</span><span>(</span><span class="phpdocumentor-signature__argument"><span class="phpdocumentor-signature__argument__return-type">int&nbsp;</span><span class="phpdocumentor-signature__argument__name">$r</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">$g</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">$b</span></span><span>)</span><span> : </span><span class="phpdocumentor-signature__response_type">void</span></code>
  578. <div class="phpdocumentor-label-line">
  579. </div>
  580. <h5 class="phpdocumentor-argument-list__heading">Parameters</h5>
  581. <dl class="phpdocumentor-argument-list">
  582. <dt class="phpdocumentor-argument-list__entry">
  583. <span class="phpdocumentor-signature__argument__name">$r</span>
  584. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  585. </dt>
  586. <dd class="phpdocumentor-argument-list__definition">
  587. </dd>
  588. <dt class="phpdocumentor-argument-list__entry">
  589. <span class="phpdocumentor-signature__argument__name">$g</span>
  590. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  591. </dt>
  592. <dd class="phpdocumentor-argument-list__definition">
  593. </dd>
  594. <dt class="phpdocumentor-argument-list__entry">
  595. <span class="phpdocumentor-signature__argument__name">$b</span>
  596. : <span class="phpdocumentor-signature__argument__return-type">int</span>
  597. </dt>
  598. <dd class="phpdocumentor-argument-list__definition">
  599. </dd>
  600. </dl>
  601. </article>
  602. </section>
  603. <div class="phpdocumentor-modal" id="source-view">
  604. <div class="phpdocumentor-modal-bg" data-exit-button></div>
  605. <div class="phpdocumentor-modal-container">
  606. <div class="phpdocumentor-modal-content">
  607. <pre style="max-height: 500px; overflow-y: scroll" data-src="files/src/Common/LuminanceSourceAbstract.php.txt" class="language-php line-numbers linkable-line-numbers"></pre>
  608. </div>
  609. <button data-exit-button class="phpdocumentor-modal__close">&times;</button>
  610. </div>
  611. </div>
  612. <script type="text/javascript">
  613. (function () {
  614. function loadExternalCodeSnippet(el, url, line) {
  615. Array.prototype.slice.call(el.querySelectorAll('pre[data-src]')).forEach((pre) => {
  616. const src = url || pre.getAttribute('data-src').replace(/\\/g, '/');
  617. const language = 'php';
  618. const code = document.createElement('code');
  619. code.className = 'language-' + language;
  620. pre.textContent = '';
  621. pre.setAttribute('data-line', line)
  622. code.textContent = 'Loading…';
  623. pre.appendChild(code);
  624. var xhr = new XMLHttpRequest();
  625. xhr.open('GET', src, true);
  626. xhr.onreadystatechange = function () {
  627. if (xhr.readyState !== 4) {
  628. return;
  629. }
  630. if (xhr.status < 400 && xhr.responseText) {
  631. code.textContent = xhr.responseText;
  632. Prism.highlightElement(code);
  633. d=document.getElementsByClassName("line-numbers");
  634. d[0].scrollTop = d[0].children[1].offsetTop;
  635. return;
  636. }
  637. if (xhr.status === 404) {
  638. code.textContent = '✖ Error: File could not be found';
  639. return;
  640. }
  641. if (xhr.status >= 400) {
  642. code.textContent = '✖ Error ' + xhr.status + ' while fetching file: ' + xhr.statusText;
  643. return;
  644. }
  645. code.textContent = '✖ Error: An unknown error occurred';
  646. };
  647. xhr.send(null);
  648. });
  649. }
  650. const modalButtons = document.querySelectorAll("[data-modal]");
  651. const openedAsLocalFile = window.location.protocol === 'file:';
  652. if (modalButtons.length > 0 && openedAsLocalFile) {
  653. console.warn(
  654. 'Viewing the source code is unavailable because you are opening this page from the file:// scheme; ' +
  655. 'browsers block XHR requests when a page is opened this way'
  656. );
  657. }
  658. modalButtons.forEach(function (trigger) {
  659. if (openedAsLocalFile) {
  660. trigger.setAttribute("hidden", "hidden");
  661. }
  662. trigger.addEventListener("click", function (event) {
  663. event.preventDefault();
  664. const modal = document.getElementById(trigger.dataset.modal);
  665. if (!modal) {
  666. console.error(`Modal with id "${trigger.dataset.modal}" could not be found`);
  667. return;
  668. }
  669. modal.classList.add("phpdocumentor-modal__open");
  670. loadExternalCodeSnippet(modal, trigger.dataset.src || null, trigger.dataset.line)
  671. const exits = modal.querySelectorAll("[data-exit-button]");
  672. exits.forEach(function (exit) {
  673. exit.addEventListener("click", function (event) {
  674. event.preventDefault();
  675. modal.classList.remove("phpdocumentor-modal__open");
  676. });
  677. });
  678. });
  679. });
  680. })();
  681. </script>
  682. </article>
  683. </section>
  684. <section class="phpdocumentor-on-this-page__sidebar">
  685. <section class="phpdocumentor-on-this-page__content">
  686. <strong class="phpdocumentor-on-this-page__title">On this page</strong>
  687. <ul class="phpdocumentor-list -clean">
  688. <li class="phpdocumentor-on-this-page-section__title">Table Of Contents</li>
  689. <li>
  690. <ul class="phpdocumentor-list -clean">
  691. <li><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc-properties">Properties</a></li>
  692. <li><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#toc-methods">Methods</a></li>
  693. </ul>
  694. </li>
  695. <li class="phpdocumentor-on-this-page-section__title">Properties</li>
  696. <li>
  697. <ul class="phpdocumentor-list -clean">
  698. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_height">$height</a></li>
  699. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_luminances">$luminances</a></li>
  700. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_options">$options</a></li>
  701. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#property_width">$width</a></li>
  702. </ul>
  703. </li>
  704. <li class="phpdocumentor-on-this-page-section__title">Methods</li>
  705. <li>
  706. <ul class="phpdocumentor-list -clean">
  707. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method___construct">__construct()</a></li>
  708. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getHeight">getHeight()</a></li>
  709. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getLuminances">getLuminances()</a></li>
  710. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getRow">getRow()</a></li>
  711. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_getWidth">getWidth()</a></li>
  712. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_checkFile">checkFile()</a></li>
  713. <li class=""><a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#method_setLuminancePixel">setLuminancePixel()</a></li>
  714. </ul>
  715. </li>
  716. </ul>
  717. </section>
  718. </section>
  719. </div>
  720. <section data-search-results class="phpdocumentor-search-results phpdocumentor-search-results--hidden">
  721. <section class="phpdocumentor-search-results__dialog">
  722. <header class="phpdocumentor-search-results__header">
  723. <h2 class="phpdocumentor-search-results__title">Search results</h2>
  724. <button class="phpdocumentor-search-results__close"><i class="fas fa-times"></i></button>
  725. </header>
  726. <section class="phpdocumentor-search-results__body">
  727. <ul class="phpdocumentor-search-results__entries"></ul>
  728. </section>
  729. </section>
  730. </section>
  731. </div>
  732. <a href="classes/chillerlan-QRCode-Common-LuminanceSourceAbstract.html#top" class="phpdocumentor-back-to-top"><i class="fas fa-chevron-circle-up"></i></a>
  733. </main>
  734. <script>
  735. cssVars({});
  736. </script>
  737. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/prism.min.js"></script>
  738. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/autoloader/prism-autoloader.min.js"></script>
  739. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-numbers/prism-line-numbers.min.js"></script>
  740. <script src="https://cdn.jsdelivr.net/npm/prismjs@1.23.0/plugins/line-highlight/prism-line-highlight.min.js"></script>
  741. </body>
  742. </html>