Documentation
¶
Overview ¶
Package qoi provides a bounded adapter around Karty's pinned QOI codec.
Index ¶
Constants ¶
View Source
const ( Magic = "qoif" ChannelsRGB = uint8(3) ChannelsRGBA = uint8(4) ColorspaceSRGB = uint8(0) ColorspaceLinear = uint8(1) MaxEncodedBytes = asset.MaxTexturePixels*maximumBytesPerPixel + headerSize + endMarkerSize )
Variables ¶
View Source
var (
ErrInvalid = errors.New("QOI data is invalid")
)
Functions ¶
This section is empty.
Types ¶
type Metadata ¶
type Metadata struct {
Width uint32
Height uint32
Channels uint8
Colorspace uint8
DecodedBytes uint64
}
Metadata describes validated QOI content and its bounded decoded cost.
func Decode ¶
Decode returns straight-alpha NRGBA pixels only after bounded preflight, allocation-free stream validation and complete dependency decoding. Panics from malformed dependency input are contained and reported as ErrInvalid.
func Encode ¶
Encode converts a bounded image into deterministic QOI and validates the complete output before returning it. Panics from custom image implementations or the dependency are contained and reported as ErrInvalid.
Click to show internal directories.
Click to hide internal directories.