An extension class for aseprite data.

Available since

0.1.0

.

See also:

Static methods

staticgetVisibleData(cel:Cel, aseprite:Ase):CelVisibleData

Returns the trimmed version of an ase.Cel.

The trimmed version has all pixels that are outside the canvas discarded and an area reduced to visible pixels.

Parameters:

cel

The ase.Cel for the trimmed version.

aseprite

The ase.Ase associated with cel.

Returns:

A trimmed version of cel as a nb.ext.AseExt.CelVisibleData instance.

staticgreyscaleToRGBA(bytes:Bytes):Bytes

Converts pixels data from a 16 bit grayscale color format to a 32 bit RGBA format then returns it.

The grayscale format is defined as a format where for each 16 bit pixel 0xCCAA, CC is the grayscale value and AA the alpha value.

Parameters:

bytes

An haxe.io.Bytes instance in a 16 bit grayscale color format.

Returns:

A new haxe.io.Bytes instance in a 32 bit RGBA format.

staticindexedToRGBA(bytes:Bytes, aseprite:Ase):Bytes

Converts pixels data from an 8 bit indexed color format to a 32 bit RGBA format then returns it.

The 8 bit indexed color format is defined as a format where each 8 bit value refers to a color in an aseprite color palette.

Parameters:

bytes

An haxe.io.Bytes instance in an 8 bit indexed color format.

aseprite

An ase.Ase instance to get the palette from.

Returns:

A new haxe.io.Bytes instance in a 32 bit RGBA format.

statictoRGBA(bytes:Bytes, aseprite:Ase):Bytes

Converts pixels data from an unknown format to a 32 bit RGBA format then returns it.

The format is assumed to be the same as the pixel format of the ase.Ase instance given as a parameter. If the format is already a 32 bit RGBA format, no conversion is done and the same bytes given as a parameter will be returned.

An error is thrown if it is an unknown the format.

Parameters:

bytes

An haxe.io.Bytes instance.

aseprite

An ase.Ase instance to deduce bytes pixel format from.

Returns:

A new haxe.io.Bytes instance in a 32 bit RGBA format if a conversion is done, bytes otherwise.