Class: ImagePrimitive
Experimental
A single fitted image. ready resolves (never rejects) once the current source has loaded or failed; nothing is drawn until then, or after a failure.
Implements
Constructors
Constructor
new ImagePrimitive(
context,
data,
options?
): ImagePrimitive;Experimental
Parameters
| Parameter | Type |
|---|---|
context | PrimitiveContext |
data | Pick<ImageQuadData, "source" | "x0" | "y0" | "x1" | "y1"> & Partial<ImageQuadData> |
options | ImageOptions |
Returns
ImagePrimitive
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
object | readonly | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, ShaderMaterial> | Experimental Root object to add to a viewport's scene. |
Accessors
naturalHeight
Get Signature
get naturalHeight(): number;Experimental
Natural pixel height of the loaded image (0 until loaded).
Returns
number
naturalWidth
Get Signature
get naturalWidth(): number;Experimental
Natural pixel width of the loaded image (0 until loaded).
Returns
number
ready
Get Signature
get ready(): Promise<void>;Experimental
Resolves once the current source has loaded or failed (never rejects).
Returns
Promise<void>
status
Get Signature
get status(): ImageStatus;Experimental
Returns
Methods
dispose()
dispose(): void;Experimental
Release GPU resources. The primitive must not be used afterwards.
Returns
void
Implementation of
setTransform()
setTransform(transform): void;Experimental
Set the data → world transform (cheap: uniforms only, no buffer uploads).
Parameters
| Parameter | Type |
|---|---|
transform | DataTransform |
Returns
void
Implementation of
setViewport()
setViewport(size): void;Experimental
Images have no screen-space sizing.
Parameters
| Parameter | Type |
|---|---|
size | ViewportSize |
Returns
void
Implementation of
update()
update(patch): void;Experimental
Replace or patch the primitive's data. Omitted fields keep their previous values.
Parameters
| Parameter | Type |
|---|---|
patch | Partial<ImageQuadData> |
Returns
void