Static methods

@:value({ level : 9 })staticbuild32ARGB(width:Int, height:Int, data:Bytes, level:Int = 9):Data

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

@:value({ level : 9 })staticbuild32BGRA(width:Int, height:Int, data:Bytes, level:Int = 9):Data

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

@:value({ level : 9 })staticbuildGrey(width:Int, height:Int, data:Bytes, level:Int = 9):Data

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

@:value({ level : 9 })staticbuildIndexed(width:Int, height:Int, data:Bytes, palette:Bytes, level:Int = 9):Data

Creates PNG data from bytes that contains a one byte palette index for each pixel and a separate palette with 3 RGB bytes per color.

@:value({ level : 9 })staticbuildRGB(width:Int, height:Int, data:Bytes, level:Int = 9):Data

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

@:noDebugstaticextract32(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.

@:noDebugstaticextractGrey(d:Data):Bytes

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

staticgetHeader(d:Data):Header

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

staticgetPalette(d:Data):Bytes

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

staticreverseBytes(b:Bytes):Void

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