EXRLoader.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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, B44/A 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" rel="noopener">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"><a href="LoadingManager.html">LoadingManager</a></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">
  39. <strong translate="no">manager</strong>
  40. </td>
  41. <td class="description last">
  42. <p>The loading manager.</p>
  43. </td>
  44. </tr>
  45. </tbody>
  46. </table>
  47. </div>
  48. </div>
  49. <h2 class="subsection-title">Properties</h2>
  50. <div class="member">
  51. <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>
  52. <div class="description">
  53. <p>Texture output format.</p>
  54. <p>Default is <code>RGBAFormat</code>.</p>
  55. </div>
  56. </div>
  57. <div class="member">
  58. <h3 class="name" id="part" translate="no">.<a href="#part">part</a><span class="type-signature"> : number</span> </h3>
  59. <div class="description">
  60. <p>For multi-part EXR files, the index of the part to load.</p>
  61. <p>Default is <code>0</code>.</p>
  62. </div>
  63. </div>
  64. <div class="member">
  65. <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>
  66. <div class="description">
  67. <p>The texture type.</p>
  68. <p>Default is <code>HalfFloatType</code>.</p>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Methods</h2>
  72. <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>
  73. <div class="method">
  74. <div class="description">
  75. <p>Parses the given EXR texture data.</p>
  76. </div>
  77. <table class="params">
  78. <tbody>
  79. <tr>
  80. <td class="name">
  81. <strong translate="no">buffer</strong>
  82. </td>
  83. <td class="description last">
  84. <p>The raw texture data.</p>
  85. </td>
  86. </tr>
  87. </tbody>
  88. </table>
  89. <dl class="details">
  90. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
  91. </dl>
  92. <dl class="details">
  93. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  94. </dl>
  95. </div>
  96. <h3 class="name name-method" id="setDataType" translate="no">.<a href="#setDataType">setDataType</a><span class="signature">( value : <span class="param-type"><a href="global.html#HalfFloatType">HalfFloatType</a> | <a href="global.html#FloatType">FloatType</a></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 the texture type.</p>
  100. </div>
  101. <table class="params">
  102. <tbody>
  103. <tr>
  104. <td class="name">
  105. <strong translate="no">value</strong>
  106. </td>
  107. <td class="description last">
  108. <p>The texture type to set.</p>
  109. </td>
  110. </tr>
  111. </tbody>
  112. </table>
  113. <dl class="details">
  114. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  115. </dl>
  116. </div>
  117. <h3 class="name name-method" id="setOutputFormat" translate="no">.<a href="#setOutputFormat">setOutputFormat</a><span class="signature">( value : <span class="param-type"><a href="global.html#RGBAFormat">RGBAFormat</a> | <a href="global.html#RGFormat">RGFormat</a> | <a href="global.html#RedFormat">RedFormat</a></span> )</span><span class="type-signature"> : <a href="EXRLoader.html">EXRLoader</a></span> </h3>
  118. <div class="method">
  119. <div class="description">
  120. <p>Sets texture output format. Defaults to <code>RGBAFormat</code>.</p>
  121. </div>
  122. <table class="params">
  123. <tbody>
  124. <tr>
  125. <td class="name">
  126. <strong translate="no">value</strong>
  127. </td>
  128. <td class="description last">
  129. <p>Texture output format.</p>
  130. </td>
  131. </tr>
  132. </tbody>
  133. </table>
  134. <dl class="details">
  135. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  136. </dl>
  137. </div>
  138. <h3 class="name name-method" id="setPart" translate="no">.<a href="#setPart">setPart</a><span class="signature">( value : <span class="param-type">number</span> )</span><span class="type-signature"> : <a href="EXRLoader.html">EXRLoader</a></span> </h3>
  139. <div class="method">
  140. <div class="description">
  141. <p>For multi-part EXR files, sets which part to load.</p>
  142. </div>
  143. <table class="params">
  144. <tbody>
  145. <tr>
  146. <td class="name">
  147. <strong translate="no">value</strong>
  148. </td>
  149. <td class="description last">
  150. <p>The part index to load.</p>
  151. </td>
  152. </tr>
  153. </tbody>
  154. </table>
  155. <dl class="details">
  156. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  157. </dl>
  158. </div>
  159. <h2 class="subsection-title">Source</h2>
  160. <p>
  161. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/EXRLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/EXRLoader.js</a>
  162. </p>
  163. </article>
  164. </section>
  165. <script src="../scripts/linenumber.js"></script>
  166. <script src="../scripts/page.js"></script>
  167. </body>
  168. </html>
粤ICP备19079148号