DataTexture.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DataTexture - Three.js Docs</title>
  6. <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
  7. <script src="../scripts/highlight.min.js"></script>
  8. <link type="text/css" rel="stylesheet" href="../styles/highlight-three.css">
  9. <link type="text/css" rel="stylesheet" href="../styles/page.css">
  10. </head>
  11. <body>
  12. <p class="inheritance" translate="no"><a href="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → </p>
  13. <h1 translate="no">DataTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Creates a texture directly from raw buffer data.</p>
  17. <p>The interpretation of the data depends on type and format: If the type is
  18. <code>UnsignedByteType</code>, a <code>Uint8Array</code> will be useful for addressing the
  19. texel data. If the format is <code>RGBAFormat</code>, data needs four values for
  20. one texel; Red, Green, Blue and Alpha (typically the opacity).</p></div>
  21. </header>
  22. <article>
  23. <div class="container-overview">
  24. <h2>Constructor</h2>
  25. <h3 class="name name-method" id="DataTexture" translate="no">new <a href="#DataTexture">DataTexture</a><span class="signature">( data : <span class="param-type">TypedArray</span>, width : <span class="param-type">number</span>, height : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span>, colorSpace : <span class="param-type">string</span> )</span> </h3>
  26. <div class="method">
  27. <div class="description">
  28. <p>Constructs a new data texture.</p>
  29. </div>
  30. <table class="params">
  31. <tbody>
  32. <tr>
  33. <td class="name">
  34. <strong>data</strong>
  35. </td>
  36. <td class="description last">
  37. <p>The buffer data.</p>
  38. <p>Default is <code>null</code>.</p>
  39. </td>
  40. </tr>
  41. <tr>
  42. <td class="name">
  43. <strong>width</strong>
  44. </td>
  45. <td class="description last">
  46. <p>The width of the texture.</p>
  47. <p>Default is <code>1</code>.</p>
  48. </td>
  49. </tr>
  50. <tr>
  51. <td class="name">
  52. <strong>height</strong>
  53. </td>
  54. <td class="description last">
  55. <p>The height of the texture.</p>
  56. <p>Default is <code>1</code>.</p>
  57. </td>
  58. </tr>
  59. <tr>
  60. <td class="name">
  61. <strong>format</strong>
  62. </td>
  63. <td class="description last">
  64. <p>The texture format.</p>
  65. <p>Default is <code>RGBAFormat</code>.</p>
  66. </td>
  67. </tr>
  68. <tr>
  69. <td class="name">
  70. <strong>type</strong>
  71. </td>
  72. <td class="description last">
  73. <p>The texture type.</p>
  74. <p>Default is <code>UnsignedByteType</code>.</p>
  75. </td>
  76. </tr>
  77. <tr>
  78. <td class="name">
  79. <strong>mapping</strong>
  80. </td>
  81. <td class="description last">
  82. <p>The texture mapping.</p>
  83. <p>Default is <code>Texture.DEFAULT_MAPPING</code>.</p>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td class="name">
  88. <strong>wrapS</strong>
  89. </td>
  90. <td class="description last">
  91. <p>The wrapS value.</p>
  92. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  93. </td>
  94. </tr>
  95. <tr>
  96. <td class="name">
  97. <strong>wrapT</strong>
  98. </td>
  99. <td class="description last">
  100. <p>The wrapT value.</p>
  101. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  102. </td>
  103. </tr>
  104. <tr>
  105. <td class="name">
  106. <strong>magFilter</strong>
  107. </td>
  108. <td class="description last">
  109. <p>The mag filter value.</p>
  110. <p>Default is <code>NearestFilter</code>.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>minFilter</strong>
  116. </td>
  117. <td class="description last">
  118. <p>The min filter value.</p>
  119. <p>Default is <code>NearestFilter</code>.</p>
  120. </td>
  121. </tr>
  122. <tr>
  123. <td class="name">
  124. <strong>anisotropy</strong>
  125. </td>
  126. <td class="description last">
  127. <p>The anisotropy value.</p>
  128. <p>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p>
  129. </td>
  130. </tr>
  131. <tr>
  132. <td class="name">
  133. <strong>colorSpace</strong>
  134. </td>
  135. <td class="description last">
  136. <p>The color space.</p>
  137. <p>Default is <code>NoColorSpace</code>.</p>
  138. </td>
  139. </tr>
  140. </tbody>
  141. </table>
  142. </div>
  143. </div>
  144. <h2 class="subsection-title">Properties</h2>
  145. <div class="member">
  146. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  147. <div class="description">
  148. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  149. uploaded to the GPU.</p>
  150. <p>Overwritten and set to <code>false</code> by default.</p>
  151. <p>Default is <code>false</code>.</p>
  152. </div>
  153. <dl class="details">
  154. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  155. </dl>
  156. </div>
  157. <div class="member">
  158. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  159. <div class="description">
  160. <p>Whether to generate mipmaps (if possible) for a texture.</p>
  161. <p>Overwritten and set to <code>false</code> by default.</p>
  162. <p>Default is <code>false</code>.</p>
  163. </div>
  164. <dl class="details">
  165. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#generateMipmaps">Texture#generateMipmaps</a></dt>
  166. </dl>
  167. </div>
  168. <div class="member">
  169. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  170. <div class="description">
  171. <p>The image definition of a data texture.</p>
  172. </div>
  173. <dl class="details">
  174. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  175. </dl>
  176. </div>
  177. <div class="member">
  178. <h3 class="name" id="isDataTexture" translate="no">.<a href="#isDataTexture">isDataTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  179. <div class="description">
  180. <p>This flag can be used for type testing.</p>
  181. <p>Default is <code>true</code>.</p>
  182. </div>
  183. </div>
  184. <div class="member">
  185. <h3 class="name" id="unpackAlignment" translate="no">.<a href="#unpackAlignment">unpackAlignment</a><span class="type-signature"> : boolean</span> </h3>
  186. <div class="description">
  187. <p>Specifies the alignment requirements for the start of each pixel row in memory.</p>
  188. <p>Overwritten and set to <code>1</code> by default.</p>
  189. <p>Default is <code>1</code>.</p>
  190. </div>
  191. <dl class="details">
  192. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#unpackAlignment">Texture#unpackAlignment</a></dt>
  193. </dl>
  194. </div>
  195. <h2 class="subsection-title">Source</h2>
  196. <p>
  197. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/DataTexture.js" translate="no" target="_blank" rel="noopener">src/textures/DataTexture.js</a>
  198. </p>
  199. </article>
  200. </section>
  201. <script src="../scripts/linenumber.js"></script>
  202. <script src="../scripts/page.js"></script>
  203. </body>
  204. </html>
粤ICP备19079148号