native

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: BSD-2-Clause, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnsupportedPlatform = errors.New("goopenjpeg: no prebuilt native library for this platform")

ErrUnsupportedPlatform reports that this GOOS/GOARCH has no prebuilt native library, so nothing can be decoded or encoded. Every entry point wraps it, and the wrapped error names the platform. Test for it with errors.Is.

Functions

func Encode added in v1.1.0

func Encode(src []byte, opts EncodeOptions) ([]byte, error)

func Version

func Version() (string, error)

Types

type DecodeResult

type DecodeResult struct {
	Output      []byte
	Width       int
	Height      int
	Components  int
	Precision   int
	IsSigned    bool
	ColourSpace int
}

func Decode

func Decode(data []byte, codec int) (*DecodeResult, error)

type EncodeOptions added in v1.1.0

type EncodeOptions struct {
	Columns          int
	Rows             int
	SamplesPerPixel  int
	BitsStored       int
	IsSigned         bool
	ColourSpace      int
	UseMCT           bool
	Codec            int
	ProgressionOrder int
	// CompressionRatios empty => lossless.
	CompressionRatios []float64
}

type ImageParams

type ImageParams struct {
	Width       int
	Height      int
	Components  int
	Precision   int
	IsSigned    bool
	ColourSpace int
}

func GetParameters

func GetParameters(data []byte, codec int) (*ImageParams, error)

type StatusError

type StatusError struct {
	Op   string
	Code int
}

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

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