DataTexture.html 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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"><code>data</code></td>
  34. <td class="description last"><p>The buffer data.<br/>Default is <code>null</code>.</p></td>
  35. </tr>
  36. <tr>
  37. <td class="name"><code>width</code></td>
  38. <td class="description last"><p>The width of the texture.<br/>Default is <code>1</code>.</p></td>
  39. </tr>
  40. <tr>
  41. <td class="name"><code>height</code></td>
  42. <td class="description last"><p>The height of the texture.<br/>Default is <code>1</code>.</p></td>
  43. </tr>
  44. <tr>
  45. <td class="name"><code>format</code></td>
  46. <td class="description last"><p>The texture format.<br/>Default is <code>RGBAFormat</code>.</p></td>
  47. </tr>
  48. <tr>
  49. <td class="name"><code>type</code></td>
  50. <td class="description last"><p>The texture type.<br/>Default is <code>UnsignedByteType</code>.</p></td>
  51. </tr>
  52. <tr>
  53. <td class="name"><code>mapping</code></td>
  54. <td class="description last"><p>The texture mapping.<br/>Default is <code>Texture.DEFAULT_MAPPING</code>.</p></td>
  55. </tr>
  56. <tr>
  57. <td class="name"><code>wrapS</code></td>
  58. <td class="description last"><p>The wrapS value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  59. </tr>
  60. <tr>
  61. <td class="name"><code>wrapT</code></td>
  62. <td class="description last"><p>The wrapT value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  63. </tr>
  64. <tr>
  65. <td class="name"><code>magFilter</code></td>
  66. <td class="description last"><p>The mag filter value.<br/>Default is <code>NearestFilter</code>.</p></td>
  67. </tr>
  68. <tr>
  69. <td class="name"><code>minFilter</code></td>
  70. <td class="description last"><p>The min filter value.<br/>Default is <code>NearestFilter</code>.</p></td>
  71. </tr>
  72. <tr>
  73. <td class="name"><code>anisotropy</code></td>
  74. <td class="description last"><p>The anisotropy value.<br/>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p></td>
  75. </tr>
  76. <tr>
  77. <td class="name"><code>colorSpace</code></td>
  78. <td class="description last"><p>The color space.<br/>Default is <code>NoColorSpace</code>.</p></td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. </div>
  83. </div>
  84. <h2 class="subsection-title">Properties</h2>
  85. <div class="member">
  86. <h3 class="name" id="flipY" translate="no">.<a href="#flipY">flipY</a><span class="type-signature"> : boolean</span> </h3>
  87. <div class="description">
  88. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when
  89. uploaded to the GPU.</p>
  90. <p>Overwritten and set to <code>false</code> by default.<br/>Default is <code>false</code>.</p>
  91. </div>
  92. <dl class="details">
  93. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#flipY">Texture#flipY</a></dt>
  94. </dl>
  95. </div>
  96. <div class="member">
  97. <h3 class="name" id="generateMipmaps" translate="no">.<a href="#generateMipmaps">generateMipmaps</a><span class="type-signature"> : boolean</span> </h3>
  98. <div class="description">
  99. <p>Whether to generate mipmaps (if possible) for a texture.</p>
  100. <p>Overwritten and set to <code>false</code> by default.<br/>Default is <code>false</code>.</p>
  101. </div>
  102. <dl class="details">
  103. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#generateMipmaps">Texture#generateMipmaps</a></dt>
  104. </dl>
  105. </div>
  106. <div class="member">
  107. <h3 class="name" id="image" translate="no">.<a href="#image">image</a><span class="type-signature"> : Object</span> </h3>
  108. <div class="description">
  109. <p>The image definition of a data texture.</p>
  110. </div>
  111. <dl class="details">
  112. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#image">Texture#image</a></dt>
  113. </dl>
  114. </div>
  115. <div class="member">
  116. <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>
  117. <div class="description">
  118. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  119. </div>
  120. </div>
  121. <div class="member">
  122. <h3 class="name" id="unpackAlignment" translate="no">.<a href="#unpackAlignment">unpackAlignment</a><span class="type-signature"> : boolean</span> </h3>
  123. <div class="description">
  124. <p>Specifies the alignment requirements for the start of each pixel row in memory.</p>
  125. <p>Overwritten and set to <code>1</code> by default.<br/>Default is <code>1</code>.</p>
  126. </div>
  127. <dl class="details">
  128. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Texture.html#unpackAlignment">Texture#unpackAlignment</a></dt>
  129. </dl>
  130. </div>
  131. <h2 class="subsection-title">Source</h2>
  132. <p>
  133. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/DataTexture.js" target="_blank" rel="noopener" translate="no">src/textures/DataTexture.js</a>
  134. </p>
  135. </article>
  136. </section>
  137. <script src="../scripts/linenumber.js"></script>
  138. <script src="../scripts/page.js"></script>
  139. </body>
  140. </html>
粤ICP备19079148号