create MethodStatic

Create a new ImageBuffer.

create(data: Uint8Array, format: ImageBufferFormat, width: number): ImageBuffer | undefined

note The ImageBuffer takes ownership of the input Uint8Array.

Parameter Type Description
data Uint8Array The uncompressed image bytes. Must be a multiple of the width times the number of bytes per pixel specified by the format.
format ImageBufferFormat The format of the image.
width number The width of the image in pixels.

Returns - A new ImageBuffer, or undefined if the length of the Uint8Array is not appropriate for the specified width and format.

Defined in

Last Updated: 08 January, 2020