Versions in this module Expand all Collapse all v1 v1.0.1 Jun 30, 2026 v1.0.0 Jun 30, 2026 Changes in this version + var ErrDataTooShort = errors.New("data too short for image format") + var ErrInvalidData = errors.New("invalid or corrupted image data") + var ErrInvalidRowIndex = errors.New("invalid row index") + var ErrInvalidTileIndex = errors.New("invalid tile index") + var ErrNoHDRData = errors.New("no HDR extension data present") + var ErrOutputTooLarge = errors.New("decoded image size exceeds maximum limit") + var ErrStreamingNotSupported = errors.New("streaming decode not supported for this format") + var ErrUnsupportedFormat = errors.New("unsupported or unrecognized image format") + type Decoder interface + Decode func() ([]byte, error) + GetInfo func() *ImageInfo + func NewDecoder(data []byte) (Decoder, error) + func NewDecoderForFormat(data []byte, format Format) (Decoder, error) + type Format int + const FormatJPEG2000 + const FormatJPEGLS + const FormatJPEGXL + const FormatJPEGXR + const FormatJPEGXS + const FormatJPEGXT + const FormatUnknown + func DetectFormat(data []byte) (Format, error) + func (f Format) IsHDR() bool + func (f Format) IsLowLatency() bool + func (f Format) String() string + type HDRDecoder interface + DecodeHDR func() ([]float32, error) + DecodeHDR16 func() ([]uint16, error) + GetHDRInfo func() *HDRInfo + type HDRInfo struct + HasAlpha bool + HasToneMap bool + MaxLuminance float32 + MinLuminance float32 + Profile string + type ImageInfo struct + BitDepth int + Format Format + HasHDR bool + Height int + IsLowLatency bool + NumChannels int + NumTilesX int + NumTilesY int + TileHeight int + TileWidth int + Width int + type LowLatencyDecoder interface + DecodeProgressive func(callback func(lineNumber int, data []byte) error) error + GetLatencyLines func() int + GetMemoryBound func() int64 + IsLowLatency func() bool + func NewLowLatencyDecoder(data []byte) (LowLatencyDecoder, error) + func NewLowLatencyDecoderForFormat(data []byte, format Format) (LowLatencyDecoder, error) + type StreamDecoder interface + DecodeRow func(rowIdx int) ([]byte, error) + DecodeStream func(callback func(tileIdx int, data []byte) error) error + DecodeTile func(tileIdx int) ([]byte, error) + NumTiles func() int + Reset func() + TileInfo func(tileIdx int) *TileInfo + func NewStreamDecoder(data []byte) (StreamDecoder, error) + func NewStreamDecoderForFormat(data []byte, format Format) (StreamDecoder, error) + type TileInfo struct + Height int + Index int + OffsetX int + OffsetY int + Width int + X int + Y int