Constructor
new Framebuffer(handler, optionsopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
handler | Handler | WebGL handler. | |
options | IFrameBufferParams | <optional> | Framebuffer options: |
- Source
Methods
bindOutputTexture(texture, glAttachmentopt)
Bind buffer texture.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
texture | WebGLTexture | Output texture. | ||
glAttachment | number | <optional> | 0 | color attachment index. |
- Source
getImage() → {HTMLImageElement}
Gets JavaScript image that in the framebuffer.
- Source
Returns:
- Type:
- HTMLImageElement
init()
Framebuffer initialization.
- Source
readAllPixels(res, attachmentIndexopt)
Reads all pixels(RGBA colors) from framebuffer.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
res | Uint8Array | Result array. | ||
attachmentIndex | number | <optional> | 0 | color attachment index. |
- Source
readPixels(res, nx, ny, wopt, hopt, indexopt)
Gets pixel RGBA color from framebuffer by coordinates.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
res | Uint8Array | Normalized x - coordinate. | ||
nx | number | Normalized x - coordinate. | ||
ny | number | Normalized y - coordinate. | ||
w | number | <optional> | 1 | Normalized width. |
h | number | <optional> | 1 | Normalized height. |
index | number | <optional> | 0 | color attachment index. |
- Source