LUTImageLoader.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LUTImageLoader - 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">LUTImageLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for loading LUT images.</p></div>
  17. <h2>Code Example</h2>
  18. <div translate="no"><pre><code class="language-js">const loader = new LUTImageLoader();
  19. const map = loader.loadAsync( 'luts/NeutralLUT.png' );
  20. </code></pre></div>
  21. </header>
  22. <article>
  23. <h2 class="subsection-title">Import</h2>
  24. <p><span translate="no">LUTImageLoader</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>
  25. <pre><code class="language-js">import { LUTImageLoader } from 'three/addons/loaders/LUTImageLoader.js';</code></pre>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="LUTImageLoader" translate="no">new <a href="#LUTImageLoader">LUTImageLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new LUT loader.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name">
  37. <strong>manager</strong>
  38. </td>
  39. <td class="description last">
  40. <p>The loading manager.</p>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. </div>
  47. <h2 class="subsection-title">Classes</h2>
  48. <dl>
  49. <dt><a href="LUTImageLoader.html">LUTImageLoader</a></dt>
  50. <dd></dd>
  51. </dl>
  52. <h2 class="subsection-title">Properties</h2>
  53. <div class="member">
  54. <h3 class="name" id="flip" translate="no">.<a href="#flip">flip</a><span class="type-signature"> : boolean</span> </h3>
  55. <div class="description">
  56. <p>Whether to vertically flip the LUT or not.</p>
  57. <p>Depending on the LUT's origin, the texture has green at the bottom (e.g. for Unreal)
  58. or green at the top (e.g. for Unity URP Color Lookup). If you're using lut image strips
  59. from a Unity pipeline, then set this property to <code>true</code>.</p>
  60. <p>Default is <code>false</code>.</p>
  61. </div>
  62. </div>
  63. <h2 class="subsection-title">Methods</h2>
  64. <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> </h3>
  65. <div class="method">
  66. <div class="description">
  67. <p>Starts loading from the given URL and passes the loaded LUT
  68. to the <code>onLoad()</code> callback.</p>
  69. </div>
  70. <table class="params">
  71. <tbody>
  72. <tr>
  73. <td class="name">
  74. <strong>url</strong>
  75. </td>
  76. <td class="description last">
  77. <p>The path/URL of the file to be loaded. This can also be a data URI.</p>
  78. </td>
  79. </tr>
  80. <tr>
  81. <td class="name">
  82. <strong>onLoad</strong>
  83. </td>
  84. <td class="description last">
  85. <p>Executed when the loading process has been finished.</p>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td class="name">
  90. <strong>onProgress</strong>
  91. </td>
  92. <td class="description last">
  93. <p>Executed while the loading is in progress.</p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="name">
  98. <strong>onError</strong>
  99. </td>
  100. <td class="description last">
  101. <p>Executed when errors occur.</p>
  102. </td>
  103. </tr>
  104. </tbody>
  105. </table>
  106. <dl class="details">
  107. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  108. </dl>
  109. </div>
  110. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( dataArray : <span class="param-type">Uint8ClampedArray</span>, size : <span class="param-type">number</span> )</span><span class="type-signature"> : Object</span> </h3>
  111. <div class="method">
  112. <div class="description">
  113. <p>Parses the given LUT data and returns the resulting 3D data texture.</p>
  114. </div>
  115. <table class="params">
  116. <tbody>
  117. <tr>
  118. <td class="name">
  119. <strong>dataArray</strong>
  120. </td>
  121. <td class="description last">
  122. <p>The raw LUT data.</p>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class="name">
  127. <strong>size</strong>
  128. </td>
  129. <td class="description last">
  130. <p>The LUT size.</p>
  131. </td>
  132. </tr>
  133. </tbody>
  134. </table>
  135. <dl class="details">
  136. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  137. </dl>
  138. <dl class="details">
  139. <dt class="tag-returns"><strong>Returns:</strong> An object representing the parsed LUT.</dt>
  140. </dl>
  141. </div>
  142. <h2 class="subsection-title">Source</h2>
  143. <p>
  144. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/LUTImageLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/LUTImageLoader.js</a>
  145. </p>
  146. </article>
  147. </section>
  148. <script src="../scripts/linenumber.js"></script>
  149. <script src="../scripts/page.js"></script>
  150. </body>
  151. </html>
粤ICP备19079148号