LUTCubeLoader.html 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>LUTCubeLoader - 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">LUTCubeLoader</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>A loader for the Cube LUT format.</p>
  17. <p>References:</p>
  18. <ul>
  19. <li><a href="https://web.archive.org/web/20220220033515/https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf" target="_blank" rel="noopener">Cube LUT Specification</a></li>
  20. </ul></div>
  21. <h2>Code Example</h2>
  22. <div translate="no"><pre><code class="language-js">const loader = new LUTCubeLoader();
  23. const map = loader.loadAsync( 'luts/Bourbon 64.CUBE' );
  24. </code></pre></div>
  25. </header>
  26. <article>
  27. <h2 class="subsection-title">Import</h2>
  28. <p><span translate="no">LUTCubeLoader</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>
  29. <pre><code class="language-js">import { LUTCubeLoader } from 'three/addons/loaders/LUTCubeLoader.js';</code></pre>
  30. <div class="container-overview">
  31. <h2>Constructor</h2>
  32. <h3 class="name name-method" id="LUTCubeLoader" translate="no">new <a href="#LUTCubeLoader">LUTCubeLoader</a><span class="signature">( manager : <span class="param-type"><a href="LoadingManager.html">LoadingManager</a></span> )</span> </h3>
  33. <div class="method">
  34. <div class="description">
  35. <p>Constructs a new Cube LUT loader.</p>
  36. </div>
  37. <table class="params">
  38. <tbody>
  39. <tr>
  40. <td class="name">
  41. <strong>manager</strong>
  42. </td>
  43. <td class="description last">
  44. <p>The loading manager.</p>
  45. </td>
  46. </tr>
  47. </tbody>
  48. </table>
  49. </div>
  50. </div>
  51. <h2 class="subsection-title">Classes</h2>
  52. <dl>
  53. <dt><a href="LUTCubeLoader.html">LUTCubeLoader</a></dt>
  54. <dd></dd>
  55. </dl>
  56. <h2 class="subsection-title">Properties</h2>
  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#UnsignedByteType">UnsignedByteType</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>UnsignedByteType</code>.</p>
  62. </div>
  63. </div>
  64. <h2 class="subsection-title">Methods</h2>
  65. <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>
  66. <div class="method">
  67. <div class="description">
  68. <p>Starts loading from the given URL and passes the loaded Cube LUT asset
  69. to the <code>onLoad()</code> callback.</p>
  70. </div>
  71. <table class="params">
  72. <tbody>
  73. <tr>
  74. <td class="name">
  75. <strong>url</strong>
  76. </td>
  77. <td class="description last">
  78. <p>The path/URL of the file to be loaded. This can also be a data URI.</p>
  79. </td>
  80. </tr>
  81. <tr>
  82. <td class="name">
  83. <strong>onLoad</strong>
  84. </td>
  85. <td class="description last">
  86. <p>Executed when the loading process has been finished.</p>
  87. </td>
  88. </tr>
  89. <tr>
  90. <td class="name">
  91. <strong>onProgress</strong>
  92. </td>
  93. <td class="description last">
  94. <p>Executed while the loading is in progress.</p>
  95. </td>
  96. </tr>
  97. <tr>
  98. <td class="name">
  99. <strong>onError</strong>
  100. </td>
  101. <td class="description last">
  102. <p>Executed when errors occur.</p>
  103. </td>
  104. </tr>
  105. </tbody>
  106. </table>
  107. <dl class="details">
  108. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#load">Loader#load</a></dt>
  109. </dl>
  110. </div>
  111. <h3 class="name name-method" id="parse" translate="no">.<a href="#parse">parse</a><span class="signature">( input : <span class="param-type">string</span> )</span><span class="type-signature"> : Object</span> </h3>
  112. <div class="method">
  113. <div class="description">
  114. <p>Parses the given Cube LUT data and returns the resulting 3D data texture.</p>
  115. </div>
  116. <table class="params">
  117. <tbody>
  118. <tr>
  119. <td class="name">
  120. <strong>input</strong>
  121. </td>
  122. <td class="description last">
  123. <p>The raw Cube LUT data as a string.</p>
  124. </td>
  125. </tr>
  126. </tbody>
  127. </table>
  128. <dl class="details">
  129. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="Loader.html#parse">Loader#parse</a></dt>
  130. </dl>
  131. <dl class="details">
  132. <dt class="tag-returns"><strong>Returns:</strong> The parsed Cube LUT.</dt>
  133. </dl>
  134. </div>
  135. <h3 class="name name-method" id="setType" translate="no">.<a href="#setType">setType</a><span class="signature">( type : <span class="param-type"><a href="global.html#UnsignedByteType">UnsignedByteType</a> | <a href="global.html#FloatType">FloatType</a></span> )</span><span class="type-signature"> : <a href="LUTCubeLoader.html">LUTCubeLoader</a></span> </h3>
  136. <div class="method">
  137. <div class="description">
  138. <p>Sets the texture type.</p>
  139. </div>
  140. <table class="params">
  141. <tbody>
  142. <tr>
  143. <td class="name">
  144. <strong>type</strong>
  145. </td>
  146. <td class="description last">
  147. <p>The texture type to set.</p>
  148. </td>
  149. </tr>
  150. </tbody>
  151. </table>
  152. <dl class="details">
  153. <dt class="tag-returns"><strong>Returns:</strong> A reference to this loader.</dt>
  154. </dl>
  155. </div>
  156. <h2 class="subsection-title">Source</h2>
  157. <p>
  158. <a href="https://github.com/mrdoob/three.js/blob/master/examples/jsm/loaders/LUTCubeLoader.js" translate="no" target="_blank" rel="noopener">examples/jsm/loaders/LUTCubeLoader.js</a>
  159. </p>
  160. </article>
  161. </section>
  162. <script src="../scripts/linenumber.js"></script>
  163. <script src="../scripts/page.js"></script>
  164. </body>
  165. </html>
粤ICP备19079148号