C

WebGLImageNodeStyle

An image node style for use in WebGL2 rendering.
ImplementsInheritance Hierarchy

Remarks

Note that unlike other INodeStyle implementations, this class is immutable. All properties are read-only and immutable, and the class cannot be subclassed, either.

See Also

Developer's Guide

API

WebGLShapeNodeStyle, WebGLGroupNodeStyle

Members

No filters for this type

Constructors

Creates a new image node style that is rendered with WebGL2.

This style can be applied to nodes that are rendered by the WebGLGraphModelManager.

The preferred way of calling the constructor is using option arguments, as there are many defaults and optional arguments. To use the default value for a color option, set it to null.

Parameters

image: ImageData
The mandatory image data for the image.
imageColor?: Color
The fill color of the image, or null. If this parameter is null, the original color of the image is used. Otherwise, the alpha values of the image will be combined with the color values from this value. Defaults to null.
preserveAspectRatio?: boolean
Whether to preserve the image aspect ratio. Defaults to false.
backgroundShape?: WebGLShapeNodeShape
The shape of the node. Defaults to ELLIPSE.
backgroundFill?: Color
The background color of the node. Defaults to WHITE.
backgroundStroke?: WebGLStroke
The border color of the node. Defaults to BLACK.
effect?: WebGLEffect
The effect around the node. Defaults to NONE.
textureRendering?: WebGLTextureRendering
Rendering hint on how to resolve blurriness of images on large zoom values. Defaults to INTERPOLATED We recommend not using SDF for images that contain gradients.

Properties

Gets the fill color for the background shape.
readonlyfinal
Gets the background shape of the style.
readonlyfinal
Gets the stroke around the background shape.
readonlyfinal
Gets the set of applied effects on this style.
readonlyfinal
Gets the ImageData of the image.
readonlyfinal
Gets the fill color for the image, or null.
If null is specified, the original color of the image is used. Setting this to a non-null value will use the alpha values from the image and combine them with the RGB color specified here.
readonlyfinal
Gets a value that specifies whether to preserve the aspect ratio of the image and the backgroundShape.
readonlyfinal
Gets the renderer implementation that can be queried for implementations that provide details about the visual appearance and visual behavior for a given node and this style instance.
The idiom for retrieving, e.g. an IVisualCreator implementation for a given style is:
const creator = style.renderer.getVisualCreator(node, style)
const visual = creator.createVisual(context)
readonlyfinal
Gets the rendering hint on how to resolve blurriness of images on large zoom values.
Default value is INTERPOLATED We recommend not using SDF for images that contain gradients.
readonlyfinal

Methods

Create a clone of this object.
final

Return Value

Object
A clone of this object.