PNG::Header
Inherits Struct / Value / Object
Constructors
new(width : UInt32, height : UInt32, bit_depth : UInt8 = 8_u8, color_type : PNG::ColorType = ColorType::TrueColor, compression_method : PNG::CompressionMethod = CompressionMethod::Deflate, filter_type : PNG::FilterType = FilterType::Adaptive, interlacing : PNG::Interlacing = Interlacing::None)
SourceClass methods
parse(io : IO)
SourceInstance methods
bit_depth
Sourcebit_depth=(bit_depth : UInt8)
Sourcebytes_per_pixel
Number of bytes to represent a pixel. Ex: 4bits @ rgb color would be ceil((4 * 3) / 8) = 2
This includes extra padding.
bytes_per_row(width : Int = @width)
Row size including padding where bit depth doesn't align to bytes. Not including filter byte.
channels(*args, **options)
Sourcechannels(*args, **options, &)
Sourcecolor_type
Sourcecolor_type=(color_type : ColorType)
Sourcecolorize(colors : Indexable(UInt8), palette : Palette | Nil = nil)
Convert bytes into a color struct
compression_method
Sourcecompression_method=(compression_method : CompressionMethod)
Sourcefilter_type
Sourcefilter_type=(filter_type : FilterType)
Sourceheight
Sourceheight=(height : UInt32)
Sourceinterlacing
Sourceinterlacing=(interlacing : Interlacing)
Sourcewidth
Sourcewidth=(width : UInt32)
Sourcewrite(io : IO)
Source