Documentation
¶
Overview ¶
Package qoi implements a QOI image encoder and decoder.
The QOI specification is at https://qoiformat.org/qoi-specification.pdf
This package registers the decoder on import to be used by the standard library's image.Decode.
Index ¶
Constants ¶
const ChannelsRGB = 3
const ChannelsRGBA = 4
const ColorspaceLinear = 1
const ColorspaceSRGB = 0
const Magic = "qoif"
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
Decode decodes a QOI image. The returned image.Image is always an *image.NRGBAImage.
func DecodeBytes ¶
DecodeBytes decodes a QOI image. It is similar to Decode but is faster and should be preferred if you already have the data in a byte slice.
func DecodeConfig ¶
DecodeConfig returns the dimensions of a QOI image without decoding the entire image. The color model is always color.NRGBAModel as QOI always uses this model when decoding.
Types ¶
type ConfigExtra ¶
ConfigExtra represents the standard library's image.Config extended with QOI-specific metadata.
func DecodeConfigExtra ¶
func DecodeConfigExtra(r io.Reader) (ConfigExtra, error)
DecodeConfigExtra returns the extra config data embedded in a QOI header.
type Options ¶
type Options struct { // Channels should be [ChannelsRGB] or [ChannelsRGBA]. It is only used to // set the metadata in the header and has no impact on the encoding. Channels int // Colorspace should be [ColorspaceSRGB] or [ColorspaceLinear]. It is only // used to set the metadata in the header and has no impact on the encoding. Colorspace int }
Options are encoding options.