VideoFrameTexture.html 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <base href="../../../" />
  6. <script src="page.js"></script>
  7. <link type="text/css" rel="stylesheet" href="page.css" />
  8. </head>
  9. <body>
  10. [page:VideoTexture] &rarr;
  11. <h1>[name]</h1>
  12. <p class="desc">
  13. This class can be used as an alternative way to define video data. Instead of using
  14. an instance of `HTMLVideoElement` like with `VideoTexture`, [name] expects each frame is
  15. defined manually via [page:.setFrame setFrame](). A typical use case for this module is when
  16. video frames are decoded with the WebCodecs API.
  17. </p>
  18. <h2>Code Example</h2>
  19. <code>
  20. const texture = new THREE.VideoFrameTexture();
  21. texture.setFrame( frame );
  22. </code>
  23. <h2>Examples</h2>
  24. <p>
  25. [example:webgpu_video_frame video / frame]
  26. </p>
  27. <h2>Constructor</h2>
  28. <h3>
  29. [name]( [param:Constant mapping], [param:Constant wrapS],
  30. [param:Constant wrapT], [param:Constant magFilter], [param:Constant minFilter],
  31. [param:Constant format], [param:Constant type], [param:Number anisotropy] )
  32. </h3>
  33. <p>
  34. [page:Constant mapping] -- How the image is applied to the object. An
  35. object type of [page:Textures THREE.UVMapping].
  36. See [page:Textures mapping constants] for other choices.<br />
  37. [page:Constant wrapS] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  38. See [page:Textures wrap mode constants] for
  39. other choices.<br />
  40. [page:Constant wrapT] -- The default is [page:Textures THREE.ClampToEdgeWrapping].
  41. See [page:Textures wrap mode constants] for
  42. other choices.<br />
  43. [page:Constant magFilter] -- How the texture is sampled when a texel
  44. covers more than one pixel. The default is [page:Textures THREE.LinearFilter].
  45. See [page:Textures magnification filter constants]
  46. for other choices.<br />
  47. [page:Constant minFilter] -- How the texture is sampled when a texel
  48. covers less than one pixel. The default is [page:Textures THREE.LinearFilter].
  49. See [page:Textures minification filter constants] for
  50. other choices.<br />
  51. [page:Constant format] -- The default is [page:Textures THREE.RGBAFormat].
  52. See [page:Textures format constants] for other choices.<br />
  53. [page:Constant type] -- Default is [page:Textures THREE.UnsignedByteType].
  54. See [page:Textures type constants] for other choices.<br />
  55. [page:Number anisotropy] -- The number of samples taken along the axis
  56. through the pixel that has the highest density of texels. By default, this
  57. value is `1`. A higher value gives a less blurry result than a basic mipmap,
  58. at the cost of more texture samples being used. Use
  59. [page:WebGLrenderer.getMaxAnisotropy renderer.getMaxAnisotropy]() to find
  60. the maximum valid anisotropy value for the GPU; this value is usually a
  61. power of 2.<br /><br />
  62. </p>
  63. <h2>Properties</h2>
  64. <p>See the base [page:VideoTexture VideoTexture] class for common properties.</p>
  65. <h3>[property:Boolean isVideoFrameTexture]</h3>
  66. <p>Read-only flag to check if a given object is of type [name].</p>
  67. <h2>Methods</h2>
  68. <p>See the base [page:VideoTexture VideoTexture] class for common methods.</p>
  69. <h3>[method:undefined setFrame]( [param:VideoFrame frame] )</h3>
  70. <p>
  71. Sets the current frame of the video. This will automatically update the texture
  72. so the data can be used for rendering.
  73. </p>
  74. <h2>Source</h2>
  75. <p>
  76. [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
  77. </p>
  78. </body>
  79. </html>
粤ICP备19079148号