ImageRenderable
A textured plane that draws one 2D slice of scalar image data.
Image renderable maps a scalar texture through a single channel's color, contrast limits, and opacity. ImageLayer constructs and pools one instance per visible chunk, so most applications never create these directly.
Extends RenderableObject and inherits all public properties and methods.
Constructor
Creates an image renderable drawing the given texture. The texture's data type selects the matching scalar image shader.
new ImageRenderable(props): ImageRenderable;| Parameter | Description |
|---|---|
props: ImageRenderableProps | Initialization properties. |
Types
ImageRenderableProps
Initialization properties for constructing an image renderable.
| Property | Description |
|---|---|
width: number | Width of the image in texels. |
height: number | Height of the image in texels. |
texture: Texture | The scalar image texture to draw. |
channelProps?: ChannelProps[] | Channel appearance settings. Defaults to []. |
Properties
worldToTexCoord
A matrix mapping world space to the texture's normalized coordinate space. Layers derive it from the chunk's offset, scale, and shape.
worldToTexCoord: mat4;Accessors
type string overrides
Identifies the renderable type as ImageRenderable.
get type(): string;Methods
setChannelProps() void
Replaces the channel appearance settings and revalidates them against the current texture. Only the first entry affects rendering.
setChannelProps(channels): void;| Parameter | Description |
|---|---|
channels: ChannelProps[] | The new channel settings. |
setChannelProperty() void
Updates one property of the channel at the given index and revalidates the channel against the current texture.
setChannelProperty<K>(channelIndex, property, value): void;Type Parameters
| Type Parameter |
|---|
K extends keyof ChannelProps |
| Parameter | Description |
|---|---|
channelIndex: number | The channel to update. |
property: K | The property name to set. |
value: Required<ChannelProps>[K] | The new value. |
getUniforms() UniformValues overrides
Returns the sampler, contrast, color, opacity, and world-to-texture uniforms for the scalar image shaders.
getUniforms(): UniformValues;