gojxl

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2023 License: MIT Imports: 6 Imported by: 0

README

go-jxl-decode

A Golang wrapper for (the decoding part of) libjxl. Made in 3 hours as an experiment.

Building

On Windows, download the latest release of libjxl and extract the DLLs to the same directory as your application. You need all of them.

After building, the application might be statically linked? I'm not sure about that but it seems to be the case.

On Linux, install libbrotli-dev and, if your distro has it, libjxl-dev. (If not, get the package from the above link.)

Usage

This library registers itself with image and additionally exports Decode and DecodeConfig, which work as you might expect.

Note that only Gray, RGBA, and NRGBA color models and their 16-bit counterparts are identitifed by the library.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(r io.Reader) (image.Image, error)

func DecodeConfig

func DecodeConfig(r io.Reader) (image.Config, error)

Types

type FormatError

type FormatError string

func (FormatError) Error

func (e FormatError) Error() string

type JxlDecoder added in v1.1.0

type JxlDecoder struct {
	// contains filtered or unexported fields
}

func NewJxlDecoder added in v1.1.0

func NewJxlDecoder(r io.Reader, blockSize int) *JxlDecoder

func (*JxlDecoder) Destroy added in v1.1.0

func (d *JxlDecoder) Destroy()

func (*JxlDecoder) Info added in v1.1.0

func (d *JxlDecoder) Info() (JxlInfo, error)

func (*JxlDecoder) Read added in v1.1.0

func (d *JxlDecoder) Read() ([]byte, error)

func (*JxlDecoder) Reset added in v1.1.0

func (d *JxlDecoder) Reset(r io.Reader)

func (*JxlDecoder) Rewind added in v1.1.0

func (d *JxlDecoder) Rewind()

type JxlInfo added in v1.1.0

type JxlInfo struct {
	H, W               int
	BitDepth           int
	Channels           int
	Alpha              int
	AlphaPremult       bool
	Orientation        int
	PreviewH, PreviewW int
	Animated           bool
	FrameDelay         time.Duration
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL