Class: InkLayer
(abstract) Rendering.WebGL.InkLayer(inkGLContext, options)
WebGL primitives controller
Constructor
(abstract) new InkLayer(inkGLContext, options)
Parameters:
Name | Type | Description |
---|---|---|
inkGLContext | Rendering.WebGL.InkGLContext | |
options | Rendering.WebGL.InkLayerOptions |
Properties:
Name | Type | Description |
---|---|---|
width | int | Layer width |
height | int | Layer height |
graphicsBounds | Rendering.WebGL.RectGL | RectGL(0, 0, width, height) |
storageWidth | int | Layer width * InkLayerOptions.scaleFactor |
storageHeight | int | Layer height * InkLayerOptions.scaleFactor |
storageBounds | Rendering.WebGL.RectGL | RectGL(0, 0, storageWidth, storageHeight) |
framebuffer | WebGLFramebuffer | Attached framebuffer if availble |
renderbuffer | WebGLRenderbuffer | Attached renderbuffer if availble |
texture | WebGLTexture | Attached texture if availble. Not availble when the layer uses a renderbuffer as a storage. |
Extends
Methods
delete()
Release allocated WebGL resources
(async, abstract) getExportCanvas()
Overrides:
isDeleted() → {boolean}
Returns:
Is underlying WebGL resources are deleted
Type
boolean
resize(width, height)
Resize layer
Parameters:
Name | Type | Description |
---|---|---|
width | int | |
height | int |
setTransform(matrix)
Configures ink transformation over underlying layer
Parameters:
Name | Type | Description |
---|---|---|
matrix | Common.Matrix |
Overrides:
(async) toBlob(rectopt, mimeTypeopt, qualityopt) → {Blob}
Exports layer content. Compatible in web environment.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rect | Common.Rect | <optional> | bounds | Area to read |
mimeType | string | <optional> | image/png | Supported values are image/png, image/jpeg and image/webp. |
quality | float | <optional> | 0.92 | A Number between 0 and 1 indicating image quality if the requested type is image/jpeg or image/webp.If this argument is anything else, the default values 0.92 and 0.80 are used for image/jpeg and image/webp respectively. |
Overrides:
Returns:
Layer content
Type
Blob
(async) toBuffer(rectopt, mimeTypeopt, options) → {Buffer}
Exports layer content. Compatible in nodejs environment.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rect | Common.Rect | <optional> | bounds | Area to read |
mimeType | string | <optional> | image/png | Supported values are image/png and image/jpeg. |
options | Rendering.Layer.PNGOptions|Rendering.Layer.JPEGOptions |
Overrides:
Returns:
Layer content
Type
Buffer