EXRLoader.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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" 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>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="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>
  59. <div class="description">
  60. <p>The texture type.</p>
  61. <p>Default is <code>HalfFloatType</code>.</p>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Methods</h2>
  65. <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>
  66. <div class="method">
  67. <div class="description">
  68. <p>Parses the given EXR texture data.</p>
  69. </div>
  70. <table class="params">
  71. <tbody>
  72. <tr>
  73. <td class="name">
  74. <strong>buffer</strong>
  75. </td>
  76. <td class="description last">
  77. <p>The raw texture data.</p>
  78. </td>
  79. </tr>
  80. </tbody>
  81. </table>
  82. <dl class="details">
  83. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="DataTextureLoader.html#parse">DataTextureLoader#parse</a></dt>
  84. </dl>
  85. <dl class="details">
  86. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed texture data.</dt>
  87. </dl>
  88. </div>
  89. <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>
  90. <div class="method">
  91. <div class="description">
  92. <p>Sets the texture type.</p>
  93. </div>
  94. <table class="params">
  95. <tbody>
  96. <tr>
  97. <td class="name">
  98. <strong>value</strong>
  99. </td>
  100. <td class="description last">
  101. <p>The texture type to set.</p>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <dl class="details">
  107. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  108. </dl>
  109. </div>
  110. <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>
  111. <div class="method">
  112. <div class="description">
  113. <p>Sets texture output format. Defaults to <code>RGBAFormat</code>.</p>
  114. </div>
  115. <table class="params">
  116. <tbody>
  117. <tr>
  118. <td class="name">
  119. <strong>value</strong>
  120. </td>
  121. <td class="description last">
  122. <p>Texture output format.</p>
  123. </td>
  124. </tr>
  125. </tbody>
  126. </table>
  127. <dl class="details">
  128. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  129. </dl>
  130. </div>
  131. <h2 class="subsection-title">Source</h2>
  132. <p>
  133. <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>
  134. </p>
  135. </article>
  136. </section>
  137. <script src="../scripts/linenumber.js"></script>
  138. <script src="../scripts/page.js"></script>
  139. </body>
  140. </html>
粤ICP备19079148号