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
Section titled “Constructors”Constructor
Section titled “Constructor”new TextureReader(
gl
):TextureReader
Constructor
Parameters
Section titled “Parameters”WebGL2RenderingContext
WebGL context where program is instantiated
Returns
Section titled “Returns”TextureReader
Properties
Section titled “Properties”frameBuffer
Section titled “frameBuffer”
protected
frameBuffer:null
|WebGLFramebuffer
=null
Frame buffer
protected
gl:WebGL2RenderingContext
WebGL context where program is instantiated
pixelBuffer
Section titled “pixelBuffer”
protected
pixelBuffer:null
|WebGLBuffer
=null
Methods
Section titled “Methods”dispose()
Section titled “dispose()”dispose():
void
Dispose texture reader
Releases resources and instances allocated by reader. Reader object cannot be used after calling dispose().
Returns
Section titled “Returns”void
read()
Section titled “read()”read(
image
,level
):null
|Uint8Array
<ArrayBuffer
>
Read texture data
Parameters
Section titled “Parameters”Image texture
number
= 0
Mipmap level
Returns
Section titled “Returns”null
| Uint8Array
<ArrayBuffer
>
Texture data
readAsync()
Section titled “readAsync()”readAsync(
image
,level
):Promise
<null
|Uint8Array
<ArrayBuffer
>>
Non-blocking read of texture data
Parameters
Section titled “Parameters”Image texture
number
= 0
Mipmap level
Returns
Section titled “Returns”Promise
<null
| Uint8Array
<ArrayBuffer
>>
Texture data