VideoFrameTexture.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>VideoFrameTexture - 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="EventDispatcher.html">EventDispatcher</a> → <a href="Texture.html">Texture</a> → <a href="VideoTexture.html">VideoTexture</a> → </p>
  13. <h1 translate="no">VideoFrameTexture</h1>
  14. <section>
  15. <header>
  16. <div class="class-description"><p>This class can be used as an alternative way to define video data. Instead of using
  17. an instance of <code>HTMLVideoElement</code> like with <code>VideoTexture</code>, <code>VideoFrameTexture</code> expects each frame is
  18. defined manually via <a href="VideoFrameTexture.html#setFrame">VideoFrameTexture#setFrame</a>. A typical use case for this module is when
  19. video frames are decoded with the WebCodecs API.</p></div>
  20. <h2>Code Example</h2>
  21. <div translate="no"><pre><code class="language-js">const texture = new THREE.VideoFrameTexture();
  22. texture.setFrame( frame );
  23. </code></pre></div>
  24. </header>
  25. <article>
  26. <div class="container-overview">
  27. <h2>Constructor</h2>
  28. <h3 class="name name-method" id="VideoFrameTexture" translate="no">new <a href="#VideoFrameTexture">VideoFrameTexture</a><span class="signature">( mapping : <span class="param-type">number</span>, wrapS : <span class="param-type">number</span>, wrapT : <span class="param-type">number</span>, magFilter : <span class="param-type">number</span>, minFilter : <span class="param-type">number</span>, format : <span class="param-type">number</span>, type : <span class="param-type">number</span>, anisotropy : <span class="param-type">number</span> )</span> </h3>
  29. <div class="method">
  30. <div class="description">
  31. <p>Constructs a new video frame texture.</p>
  32. </div>
  33. <table class="params">
  34. <tbody>
  35. <tr>
  36. <td class="name"><code>mapping</code></td>
  37. <td class="description last"><p>The texture mapping.<br/>Default is <code>Texture.DEFAULT_MAPPING</code>.</p></td>
  38. </tr>
  39. <tr>
  40. <td class="name"><code>wrapS</code></td>
  41. <td class="description last"><p>The wrapS value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  42. </tr>
  43. <tr>
  44. <td class="name"><code>wrapT</code></td>
  45. <td class="description last"><p>The wrapT value.<br/>Default is <code>ClampToEdgeWrapping</code>.</p></td>
  46. </tr>
  47. <tr>
  48. <td class="name"><code>magFilter</code></td>
  49. <td class="description last"><p>The mag filter value.<br/>Default is <code>LinearFilter</code>.</p></td>
  50. </tr>
  51. <tr>
  52. <td class="name"><code>minFilter</code></td>
  53. <td class="description last"><p>The min filter value.<br/>Default is <code>LinearFilter</code>.</p></td>
  54. </tr>
  55. <tr>
  56. <td class="name"><code>format</code></td>
  57. <td class="description last"><p>The texture format.<br/>Default is <code>RGBAFormat</code>.</p></td>
  58. </tr>
  59. <tr>
  60. <td class="name"><code>type</code></td>
  61. <td class="description last"><p>The texture type.<br/>Default is <code>UnsignedByteType</code>.</p></td>
  62. </tr>
  63. <tr>
  64. <td class="name"><code>anisotropy</code></td>
  65. <td class="description last"><p>The anisotropy value.<br/>Default is <code>Texture.DEFAULT_ANISOTROPY</code>.</p></td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. </div>
  70. </div>
  71. <h2 class="subsection-title">Properties</h2>
  72. <div class="member">
  73. <h3 class="name" id="isVideoFrameTexture" translate="no">.<a href="#isVideoFrameTexture">isVideoFrameTexture</a><span class="type-signature"> : boolean</span> <span class="type-signature">(readonly) </span></h3>
  74. <div class="description">
  75. <p>This flag can be used for type testing.<br/>Default is <code>true</code>.</p>
  76. </div>
  77. </div>
  78. <h2 class="subsection-title">Methods</h2>
  79. <h3 class="name name-method" id="setFrame" translate="no">.<a href="#setFrame">setFrame</a><span class="signature">( frame : <span class="param-type">VideoFrame</span> )</span> </h3>
  80. <div class="method">
  81. <div class="description">
  82. <p>Sets the current frame of the video. This will automatically update the texture
  83. so the data can be used for rendering.</p>
  84. </div>
  85. <table class="params">
  86. <tbody>
  87. <tr>
  88. <td class="name"><code>frame</code></td>
  89. <td class="description last"><p>The video frame.</p></td>
  90. </tr>
  91. </tbody>
  92. </table>
  93. </div>
  94. <h3 class="name name-method" id="update" translate="no">.<a href="#update">update</a><span class="signature">()</span> </h3>
  95. <div class="method">
  96. <div class="description">
  97. <p>This method overwritten with an empty implementation since
  98. this type of texture is updated via <code>setFrame()</code>.</p>
  99. </div>
  100. <dl class="details">
  101. <dt class="tag-overrides"><strong>Overrides:</strong> <a href="VideoTexture.html#update">VideoTexture#update</a></dt>
  102. </dl>
  103. </div>
  104. <h2 class="subsection-title">Source</h2>
  105. <p>
  106. <a href="https://github.com/mrdoob/three.js/blob/master/src/textures/VideoFrameTexture.js" target="_blank" rel="noopener" translate="no">src/textures/VideoFrameTexture.js</a>
  107. </p>
  108. </article>
  109. </section>
  110. <script src="../scripts/linenumber.js"></script>
  111. <script src="../scripts/page.js"></script>
  112. </body>
  113. </html>
粤ICP备19079148号