-
Name Type Description helper
module:ol/webgl/Helper~WebGLHelper WebGL helper; mandatory.
size
Array.<number> Expected size of the render target texture; note: this can be changed later on.
Methods
-
This will cause following calls to
#readAll
or#readPixel
to download the content of the render target into memory, which is an expensive operation. This content will be kept in cache but should be cleared after each new render. -
Returns the size of the render target texture
Returns:
Size of the render target texture
-
Returns the full content of the frame buffer as a series of r, g, b, a components in the 0-255 range (unsigned byte).
Returns:
Integer array of color values
-
Reads one pixel of the frame buffer as an array of r, g, b, a components in the 0-255 range (unsigned byte). If x and/or y are outside of existing data, an array filled with 0 is returned.
Name Type Description x
number Pixel coordinate
y
number Pixel coordinate
Returns:
Integer array with one color value (4 components)
-
Changes the size of the render target texture. Note: will do nothing if the size is already the same.
Name Type Description size
Array.<number> Expected size of the render target texture