EXRLoader.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>EXRLoader - 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">EXRLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the OpenEXR texture format.</p>
  17. <p><code>EXRLoader</code> currently supports uncompressed, ZIP(S), RLE, PIZ and DWA/B compression.
  18. Supports reading as UnsignedByte, HalfFloat and Float type data texture.</p></div>
  19. <h2>Code Example</h2>
  20. <div translate="no"><pre><code class="language-js">const loader = new EXRLoader();
  21. const texture = await loader.loadAsync( 'textures/memorial.exr' );
  22. </code></pre></div>
  23. </header>
  24. <article>
  25. <h2 class="subsection-title">Import</h2>
  26. <p><span translate="no">EXRLoader</span> is an addon, and must be imported explicitly, see <a href="https://threejs.org/manual/#en/installation" target="_blank">Installation#Addons</a>.</p>
  27. <pre><code class="language-js">import { EXRLoader } from 'three/addons/loaders/EXRLoader.js';</code></pre>
  28. <div class="container-overview">
  29. <h2>Constructor</h2>
  30. <h3 class="name name-method" id="EXRLoader" translate="no">new <a href="#EXRLoader">EXRLoader</a><span class="signature">( manager : <span class="param-type">LoadingManager</span> )</span> </h3>
  31. <div class="method">
  32. <div class="description">
  33. <p>Constructs a new EXR loader.</p>
  34. </div>
  35. <table class="params">
  36. <tbody>
  37. <tr>
  38. <td class="name"><code>manager</code></td>
  39. <td class="description last"><p>The loading manager.</p></td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <h2 class="subsection-title">Properties</h2>
  46. <div class="member">
  47. <h3 class="name" id="outputFormat" translate="no">.<a href="#outputFormat">outputFormat</a><span class="type-signature"> : <a href="global.html#RGBAFormat">RGBAFormat</a> | <a href="global.html#RGFormat">RGFormat</a> | <a href="global.html#RedFormat">RedFormat</a></span> </h3>
  48. <div class="description">
  49. <p>Texture output format.<br/>Default is <code>RGBAFormat</code>.</p>
  50. </div>
  51. </div>
  52. <div class="member">
  53. <h3 class="name" id="type" translate="no">.<a href="#type">type</a><span class="type-signature"> : <a href="global.html#HalfFloatType">HalfFloatType</a> | <a href="global.html#FloatType">FloatType</a></span> </h3>
  54. <div class="description">
  55. <p>The texture type.<br/>Default is <code>HalfFloatType</code>.</p>
  56. </div>
  57. </div>
  58. <h2 class="subsection-title">Methods</h2>
  59. <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>
  60. <div class="method">
  61. <div class="description">
  62. <p>Parses the given EXR texture data.</p>
  63. </div>
  64. <table class="params">
  65. <tbody>
  66. <tr>
  67. <td class="name"><code>buffer</code></td>
  68. <td class="description last"><p>The raw texture data.</p></td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <dl class="details">
  73. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
  74. </dl>
  75. <dl class="details">
  76. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  77. </dl>
  78. </div>
  79. <h3 class="name name-method" id="setDataType" translate="no">.<a href="#setDataType">setDataType</a><span class="signature">( value : <span class="param-type">HalfFloatType | FloatType</span> )</span><span class="type-signature"> : <a href="EXRLoader.html">EXRLoader</a></span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>Sets the texture type.</p>
  83. </div>
  84. <table class="params">
  85. <tbody>
  86. <tr>
  87. <td class="name"><code>value</code></td>
  88. <td class="description last"><p>The texture type to set.</p></td>
  89. </tr>
  90. </tbody>
  91. </table>
  92. <dl class="details">
  93. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  94. </dl>
  95. </div>
  96. <h3 class="name name-method" id="setOutputFormat" translate="no">.<a href="#setOutputFormat">setOutputFormat</a><span class="signature">( value : <span class="param-type">RGBAFormat | RGFormat | RedFormat</span> )</span><span class="type-signature"> : <a href="EXRLoader.html">EXRLoader</a></span> </h3>
  97. <div class="method">
  98. <div class="description">
  99. <p>Sets texture output format. Defaults to <code>RGBAFormat</code>.</p>
  100. </div>
  101. <table class="params">
  102. <tbody>
  103. <tr>
  104. <td class="name"><code>value</code></td>
  105. <td class="description last"><p>Texture output format.</p></td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. <dl class="details">
  110. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  111. </dl>
  112. </div>
  113. <h2 class="subsection-title">Source</h2>
  114. <p>
  115. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/EXRLoader.js" target="_blank" rel="noopener" translate="no">examples/jsm/loaders/EXRLoader.js</a>
  116. </p>
  117. </article>
  118. </section>
  119. <script src="../scripts/linenumber.js"></script>
  120. <script src="../scripts/page.js"></script>
  121. </body>
  122. </html>
粤ICP备19079148号