Documentation ¶
Overview ¶
Package jpegxl implements an JPEG XL image decoder based on libjxl compiled to WASM.
Index ¶
Constants ¶
const DefaultEffort = 7
DefaultEffort is the default effort encoding parameter.
const DefaultQuality = 75
DefaultQuality is the default quality encoding parameter.
Variables ¶
var ( ErrMemRead = errors.New("jpegxl: mem read failed") ErrMemWrite = errors.New("jpegxl: mem write failed") ErrDecode = errors.New("jpegxl: decode failed") ErrEncode = errors.New("jpegxl: encode failed") )
Errors .
Functions ¶
func DecodeConfig ¶
DecodeConfig returns the color model and dimensions of a JPEG XL image without decoding the entire image.
func Dynamic ¶ added in v0.2.1
func Dynamic() error
Dynamic returns error (if there was any) during opening dynamic/shared library.
func InitDecoder ¶ added in v0.4.1
func InitDecoder()
InitDecoder initializes wazero runtime and compiles the module. This function does nothing if a dynamic/shared library is used and Dynamic() returns nil. There is no need to explicitly call this function, first Decode will initialize the runtime.
func InitEncoder ¶ added in v0.4.1
func InitEncoder()
InitEncoder initializes wazero runtime and compiles the module. This function does nothing if a dynamic/shared library is used and Dynamic() returns nil. There is no need to explicitly call this function, first Encode will initialize the runtime.
Types ¶
type JXL ¶ added in v0.1.4
type JXL struct { // Decoded images, NRGBA or NRGBA64. Image []image.Image // Delay times, one per frame, in seconds of a tick. Delay []int }
JXL represents the possibly multiple images stored in a JXL file.
type Options ¶ added in v0.2.4
type Options struct { // Quality in the range [0,100]. Quality of 100 enables lossless. Default is 75. Quality int // Effort in the range [1,10]. Sets encoder effort/speed level without affecting decoding speed. Default is 7. Effort int }
Options are the encoding parameters.