module
Eagle::Codecs::PNG
Overview
PNG decoding and encoding. Decodes every standard color type and bit depth, palettes and Adam7 interlacing. Encodes 8-bit RGBA.
Defined in:
eagle/assets/codecs/png.crConstant Summary
-
SIGNATURE =
Bytes[137, 80, 78, 71, 13, 10, 26, 10] -
The eight bytes every PNG file starts with.
Class Method Summary
-
.crc32(data : Bytes, crc : UInt32 = 0_u32) : UInt32
CRC-32 as used by PNG chunks.
-
.decode(data : Bytes) : Image
Decodes PNG bytes into an RGBA image.
-
.encode(img : Image, level : Int32 = 6) : Bytes
Encodes an image as an RGBA PNG.
-
.png?(data : Bytes) : Bool
True when data starts with the PNG signature.
Class Method Detail
Encodes an image as an RGBA PNG. level is the zlib compression level from 0 to 9.