codec

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flags

func Flags(flags []cli.Flag) []cli.Flag

func NormalizeAnimationFrames added in v0.4.6

func NormalizeAnimationFrames(frames []image.Image, width, height int) []image.Image

func Register

func Register(c Codec)

Types

type AnimatedDecoder added in v0.4.4

type AnimatedDecoder interface {
	DecodeAll(io.Reader) (*Animation, error)
}

AnimatedDecoder can decode all frames from an input.

type AnimatedEncoder added in v0.4.4

type AnimatedEncoder interface {
	EncodeAll(io.Writer, *Animation, opts.Common) error
}

AnimatedEncoder can encode all frames into an animated output.

type Animation added in v0.4.4

type Animation struct {
	Frames     []image.Image
	Delays     []int
	LoopCount  int
	Background color.RGBA
}

Animation represents a simple multi-frame image. Delays are in milliseconds.

type Codec

type Codec interface {
	String() string

	Flags([]cli.Flag) []cli.Flag
	Extensions() []string

	CanEncode() bool

	Sniff(io.ReaderAt) (int, []byte, error)
	Decode(io.Reader) (image.Image, error)
	Encode(io.Writer, image.Image, opts.Common) error
}

func All

func All() []Codec

func Detect

func Detect(output, override string) (Codec, string, error)

func FindCodec added in v0.3.2

func FindCodec(ext string, requireEncode bool) (Codec, error)

func Get

func Get(name string) (Codec, bool)

type Sniffed

type Sniffed struct {
	Header     []byte
	Confidence int
	Codec      Codec
}

func Sniff

func Sniff(reader io.Reader, input, force string, ignoreExtension bool) (*Sniffed, io.Reader, error)

func (*Sniffed) String

func (s *Sniffed) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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