class format.png.Tools

Class Fields

static function build32ARGB(width:Int, height:Int, data:Bytes): Data

Creates PNG data from bytes that contains four bytes in ARGB format for each pixel.

static function build32BGRA(width:Int, height:Int, data:Bytes): Data

Creates PNG data from bytes that contains four bytes in BGRA format for each pixel.

static function buildGrey(width:Int, height:Int, data:Bytes): Data

Creates PNG data from bytes that contains one bytes (grey values) for each pixel.

static function buildRGB(width:Int, height:Int, data:Bytes): Data

Creates PNG data from bytes that contains three bytes (R,G and B values) for each pixel.

static function extract32(d:Data, ?bytes:Bytes, ?flipY:Bool): Bytes

Decode the PNG data and apply filters. By default this will output BGRA low-endian format. You can use the [reverseBytes] function to inverse the bytes to ARGB big-endian format.

static function extractGrey(d:Data): Bytes

Decode the greyscale PNG data and apply filters, extracting only the grey channel if alpha is present.

static function getHeader(d:Data): Header

Returns the PNG header informations. Throws an exception if no header found.

static function getPalette(d:Data): Bytes

Return the PNG palette colors, or null if no palette chunk was found

static function reverseBytes(b:Bytes): Void

Converts from BGRA to ARGB and the other way by reversing bytes.