TGALoader.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>TGALoader - 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> → <a href="DataTextureLoader.html">DataTextureLoader</a> → </p>
  13. <h1 translate="no">TGALoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the TGA texture format.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new TGALoader();
  19. const texture = await loader.loadAsync( 'textures/crate_color8.tga' );
  20. texture.colorSpace = THREE.SRGBColorSpace; // only for color textures
  21. </code></pre></div>
  22. </header>
  23. <article>
  24. <h2 class="subsection-title">Import</h2>
  25. <p><span translate="no">TGALoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank" rel="noopener">Installation#Addons</a>.</p>
  26. <pre><code class="language-js">import { TGALoader } from 'three/addons/loaders/TGALoader.js';</code></pre>
  27. <div class="container-overview">
  28. <h2>Constructor</h2>
  29. <h3 class="name name-method" id="TGALoader" translate="no">new <a href="#TGALoader">TGALoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
  30. <div class="method">
  31. <div class="description">
  32. <p>Constructs a new TGA loader.</p>
  33. </div>
  34. <table class="params">
  35. <tbody>
  36. <tr>
  37. <td class="name">
  38. <strong>manager</strong>
  39. </td>
  40. <td class="description last">
  41. <p>The loading manager.</p>
  42. </td>
  43. </tr>
  44. </tbody>
  45. </table>
  46. </div>
  47. </div>
  48. <h2 class="subsection-title">Methods</h2>
  49. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( buffer : <span class="param-type">ArrayBuffer</span> )</span><span class="type-signature"> : <a href="DataTextureLoader.html#~TexData">DataTextureLoader~TexData</a></span> </h3>
  50. <div class="method">
  51. <div class="description">
  52. <p>Parses the given TGA texture data.</p>
  53. </div>
  54. <table class="params">
  55. <tbody>
  56. <tr>
  57. <td class="name">
  58. <strong>buffer</strong>
  59. </td>
  60. <td class="description last">
  61. <p>The raw texture data.</p>
  62. </td>
  63. </tr>
  64. </tbody>
  65. </table>
  66. <dl class="details">
  67. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
  68. </dl>
  69. <dl class="details">
  70. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  71. </dl>
  72. </div>
  73. <h2 class="subsection-title">Source</h2>
  74. <p>
  75. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/TGALoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/TGALoader.js</a>
  76. </p>
  77. </article>
  78. </section>
  79. <script src="../scripts/linenumber.js"></script>
  80. <script src="../scripts/page.js"></script>
  81. </body>
  82. </html>
粤ICP备19079148号