DataTextureLoader.html 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>DataTextureLoader - 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="Loader.html">Loader</a> → </p>
  13. <h1 translate="no">DataTextureLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Abstract base class for loading binary texture formats RGBE, EXR or TGA.
  17. Textures are internally loaded via <a href="FileLoader.html">FileLoader</a>.</p>
  18. <p>Derived classes have to implement the <code>parse()</code> method which holds the parsing
  19. for the respective format.</p></div>
  20. </header>
  21. <article>
  22. <div class="container-overview">
  23. <h2>Constructor</h2>
  24. <h3 class="name name-method" id="DataTextureLoader" translate="no">new <a href="#DataTextureLoader">DataTextureLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> <span class="type-signature">(abstract) </span></h3>
  25. <div class="method">
  26. <div class="description">
  27. <p>Constructs a new data texture loader.</p>
  28. </div>
  29. <table class="params">
  30. <tbody>
  31. <tr>
  32. <td class="name">
  33. <strong>manager</strong>
  34. </td>
  35. <td class="description last">
  36. <p>The loading manager.</p>
  37. </td>
  38. </tr>
  39. </tbody>
  40. </table>
  41. </div>
  42. </div>
  43. <h2 class="subsection-title">Methods</h2>
  44. <h3 class="name name-method" id="load" translate="no">.<a href="#load">load</a><span class="signature">( url : <span class="param-type">string</span>, onLoad : <span class="param-type">function</span>, onProgress : <span class="param-type"><a href="global.html#onProgressCallback">onProgressCallback</a></span>, onError : <span class="param-type"><a href="global.html#onErrorCallback">onErrorCallback</a></span> )</span><span class="type-signature"> : <a href="DataTexture.html">DataTexture</a></span> </h3>
  45. <div class="method">
  46. <div class="description">
  47. <p>Starts loading from the given URL and passes the loaded data texture
  48. to the <code>onLoad()</code> callback. The method also returns a new texture object which can
  49. directly be used for material creation. If you do it this way, the texture
  50. may pop up in your scene once the respective loading process is finished.</p>
  51. </div>
  52. <table class="params">
  53. <tbody>
  54. <tr>
  55. <td class="name">
  56. <strong>url</strong>
  57. </td>
  58. <td class="description last">
  59. <p>The path/URL of the file to be loaded. This can also be a data URI.</p>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class="name">
  64. <strong>onLoad</strong>
  65. </td>
  66. <td class="description last">
  67. <p>Executed when the loading process has been finished.</p>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class="name">
  72. <strong>onProgress</strong>
  73. </td>
  74. <td class="description last">
  75. <p>Executed while the loading is in progress.</p>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class="name">
  80. <strong>onError</strong>
  81. </td>
  82. <td class="description last">
  83. <p>Executed when errors occur.</p>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. <dl class="details">
  89. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  90. </dl>
  91. <dl class="details">
  92. <dt class="tag-returns"><strong>Returns:</strong> The data texture.</dt>
  93. </dl>
  94. </div>
  95. <h2 class="subsection-title">Type Definitions</h2>
  96. <div class="member">
  97. <h3 class="name" id="~TexData" translate="no">.<a href="#~TexData">TexData</a> </h3>
  98. <div class="description">
  99. <p>Represents the result object type of the <code>parse()</code> method.</p>
  100. </div>
  101. <table class="props">
  102. <tbody>
  103. <tr>
  104. <td class="name">
  105. <strong>image</strong>
  106. <br>
  107. <span class="param-type">Object</span>
  108. </td>
  109. <td class="description last">
  110. <p>An object holding width, height and the texture data.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>width</strong>
  116. <br>
  117. <span class="param-type">number</span>
  118. </td>
  119. <td class="description last">
  120. <p>The width of the base mip.</p>
  121. </td>
  122. </tr>
  123. <tr>
  124. <td class="name">
  125. <strong>height</strong>
  126. <br>
  127. <span class="param-type">number</span>
  128. </td>
  129. <td class="description last">
  130. <p>The width of the base mip.</p>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td class="name">
  135. <strong>data</strong>
  136. <br>
  137. <span class="param-type">TypedArray</span>
  138. </td>
  139. <td class="description last">
  140. <p>The texture data.</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="name">
  145. <strong>format</strong>
  146. <br>
  147. <span class="param-type">number</span>
  148. </td>
  149. <td class="description last">
  150. <p>The texture format.</p>
  151. </td>
  152. </tr>
  153. <tr>
  154. <td class="name">
  155. <strong>type</strong>
  156. <br>
  157. <span class="param-type">number</span>
  158. </td>
  159. <td class="description last">
  160. <p>The texture type.</p>
  161. </td>
  162. </tr>
  163. <tr>
  164. <td class="name">
  165. <strong>flipY</strong>
  166. <br>
  167. <span class="param-type">boolean</span>
  168. </td>
  169. <td class="description last">
  170. <p>If set to <code>true</code>, the texture is flipped along the vertical axis when uploaded to the GPU.</p>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class="name">
  175. <strong>wrapS</strong>
  176. <br>
  177. <span class="param-type">number</span>
  178. </td>
  179. <td class="description last">
  180. <p>The wrapS value.</p>
  181. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td class="name">
  186. <strong>wrapT</strong>
  187. <br>
  188. <span class="param-type">number</span>
  189. </td>
  190. <td class="description last">
  191. <p>The wrapT value.</p>
  192. <p>Default is <code>ClampToEdgeWrapping</code>.</p>
  193. </td>
  194. </tr>
  195. <tr>
  196. <td class="name">
  197. <strong>anisotropy</strong>
  198. <br>
  199. <span class="param-type">number</span>
  200. </td>
  201. <td class="description last">
  202. <p>The anisotropy value.</p>
  203. <p>Default is <code>1</code>.</p>
  204. </td>
  205. </tr>
  206. <tr>
  207. <td class="name">
  208. <strong>generateMipmaps</strong>
  209. <br>
  210. <span class="param-type">boolean</span>
  211. </td>
  212. <td class="description last">
  213. <p>Whether to generate mipmaps or not.</p>
  214. </td>
  215. </tr>
  216. <tr>
  217. <td class="name">
  218. <strong>colorSpace</strong>
  219. <br>
  220. <span class="param-type">string</span>
  221. </td>
  222. <td class="description last">
  223. <p>The color space.</p>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td class="name">
  228. <strong>magFilter</strong>
  229. <br>
  230. <span class="param-type">number</span>
  231. </td>
  232. <td class="description last">
  233. <p>The mag filter.</p>
  234. </td>
  235. </tr>
  236. <tr>
  237. <td class="name">
  238. <strong>minFilter</strong>
  239. <br>
  240. <span class="param-type">number</span>
  241. </td>
  242. <td class="description last">
  243. <p>The min filter.</p>
  244. </td>
  245. </tr>
  246. <tr>
  247. <td class="name">
  248. <strong>mipmaps</strong>
  249. <br>
  250. <span class="param-type">Array.&lt;Object></span>
  251. </td>
  252. <td class="description last">
  253. <p>The mipmaps.</p>
  254. </td>
  255. </tr>
  256. </tbody>
  257. </table>
  258. </div>
  259. <h2 class="subsection-title">Source</h2>
  260. <p>
  261. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/DataTextureLoader.js" translate="no" target="_blank" rel="noopener">src/loaders/DataTextureLoader.js</a>
  262. </p>
  263. </article>
  264. </section>
  265. <script src="../scripts/linenumber.js"></script>
  266. <script src="../scripts/page.js"></script>
  267. </body>
  268. </html>
粤ICP备19079148号