TextureReader
Reader of image texture
Helper class reading data from texture. Used withing image processing pipeline to get texture data on the client side.
Constructors
new TextureReader()
new TextureReader(
gl
):TextureReader
Constructor
Parameters
• gl: WebGL2RenderingContext
WebGL context where program is instantiated
Returns
Properties
frameBuffer
protected
frameBuffer:null
|WebGLFramebuffer
=null
Frame buffer
gl
protected
gl:WebGL2RenderingContext
WebGL context where program is instantiated
pixelBuffer
protected
pixelBuffer:null
|WebGLBuffer
=null
Methods
dispose()
dispose():
void
Dispose texture reader
Releases resources and instances allocated by reader. Reader object cannot be used after calling dispose().
Returns
void
read()
read(
image
,level
):null
|Uint8Array
Read texture data
Parameters
• image: ImageTexture
Image texture
• level: number
= 0
Mipmap level
Returns
null
| Uint8Array
Texture data
readAsync()
readAsync(
image
,level
):Promise
<null
|Uint8Array
>
Non-blocking read of texture data
Parameters
• image: ImageTexture
Image texture
• level: number
= 0
Mipmap level
Returns
Promise
<null
| Uint8Array
>
Texture data