ImageBuffer is a simple object for storing image data.

For higher-level operations, use the Image class.

Constructor

@:value({ format : null, bitsPerPixel : 32, height : 0, width : 0, data : null })new(?data:UInt8Array, width:Int = 0, height:Int = 0, bitsPerPixel:Int = 32, ?format:PixelFormat)

Creates a new ImageBuffer instance

Parameters:

data

(Optional) Initial UInt8Array data

width

(Optional) An initial width value

height

(Optional) An initial height value

bitsPerPixel

(Optional) The bitsPerPixel of the data (default is 32)

format

(Optional) The PixelFormat of this image buffer

Variables

bitsPerPixel:Int

The number of bits per pixel in this image data

data:UInt8Array

The data for this image, represented as a UInt8Array

format:PixelFormat

The PixelFormat for this image data

height:Int

The height of this image data

premultiplied:Bool

Whether the image data has premultiplied alpha

src:Dynamic

The data for this image, represented as a js.html.CanvasElement, js.html.Image or flash.display.BitmapData

read onlystride:Int

The stride, or number of data values (in bytes) per row in the image data

transparent:Bool

Whether this image data is transparent

width:Int

The width of this image data

Methods

clone():ImageBuffer

Creates a duplicate of this ImageBuffer

If the current ImageBuffer has data or src information, this will be cloned as well.

Returns:

A new ImageBuffer with duplicate values