For AI agents: a documentation index is available at /llms.txt. Markdown versions of all pages are available by appending .md to any URL.
Class RGBAImage
Constructors
constructor
- new RGBAImage(
size: Size,
data?: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>,
): RGBAImageParameters
- size: Size
Optionaldata: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>
Returns RGBAImage
Properties
data
data: Uint8Array
data must be a Uint8Array instead of Uint8ClampedArray because texImage2D does not support Uint8ClampedArray in all browsers.
height
height: number
width
width: number
Methods
clone
Returns RGBAImage
replace
- replace(
data: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>,
copy?: boolean,
): voidParameters
- data: Uint8Array<ArrayBufferLike> | Uint8ClampedArray<ArrayBufferLike>
Optionalcopy: boolean
Returns void
resize
Parameters
- size: Size
Returns void
setPixel
Parameters
- row: number
- col: number
- value: Color
Returns void
An object to store image data not premultiplied, because ImageData is not premultiplied. Premultiplication is applied in JS before uploading to a texture.