1
0

CompressedTextureLoader.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>CompressedTextureLoader - 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">CompressedTextureLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>Abstract base class for loading compressed texture formats S3TC, ASTC or ETC.
  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="CompressedTextureLoader" translate="no">new <a href="#CompressedTextureLoader">CompressedTextureLoader</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 compressed 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="CompressedTexture.html">CompressedTexture</a></span> </h3>
  45. <div class="method">
  46. <div class="description">
  47. <p>Starts loading from the given URL and passes the loaded compressed 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 compressed 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>width</strong>
  106. <br>
  107. <span class="param-type">number</span>
  108. </td>
  109. <td class="description last">
  110. <p>The width of the base mip.</p>
  111. </td>
  112. </tr>
  113. <tr>
  114. <td class="name">
  115. <strong>height</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>isCubemap</strong>
  126. <br>
  127. <span class="param-type">boolean</span>
  128. </td>
  129. <td class="description last">
  130. <p>Whether the data represent a cubemap or not.</p>
  131. </td>
  132. </tr>
  133. <tr>
  134. <td class="name">
  135. <strong>mipmapCount</strong>
  136. <br>
  137. <span class="param-type">number</span>
  138. </td>
  139. <td class="description last">
  140. <p>The mipmap count.</p>
  141. </td>
  142. </tr>
  143. <tr>
  144. <td class="name">
  145. <strong>mipmaps</strong>
  146. <br>
  147. <span class="param-type">Array.&lt;{data:TypedArray, width:number, height:number}></span>
  148. </td>
  149. <td class="description last">
  150. <p>An array holding the mipmaps.
  151. Each entry holds the data and the dimensions for each level.</p>
  152. </td>
  153. </tr>
  154. <tr>
  155. <td class="name">
  156. <strong>format</strong>
  157. <br>
  158. <span class="param-type">number</span>
  159. </td>
  160. <td class="description last">
  161. <p>The texture format.</p>
  162. </td>
  163. </tr>
  164. </tbody>
  165. </table>
  166. </div>
  167. <h2 class="subsection-title">Source</h2>
  168. <p>
  169. <a href="https://github.com/mrdoob/three.js/blob/master/src/loaders/CompressedTextureLoader.js" translate="no" target="_blank" rel="noopener">src/loaders/CompressedTextureLoader.js</a>
  170. </p>
  171. </article>
  172. </section>
  173. <script src="../scripts/linenumber.js"></script>
  174. <script src="../scripts/page.js"></script>
  175. </body>
  176. </html>
粤ICP备19079148号