watercolor

package module
v0.0.0-...-9e4386a Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 14 Imported by: 0

README

watercolor

WIP: An image processing library for Go that only depends on libwebp and libavif

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidParam            = fmt.Errorf("invalid parameter")
	ErrImageIsNil              = fmt.Errorf("image is nil")
	ErrImageFormatUnknown      = fmt.Errorf("image format is unknown")
	ErrImageFormatNotSupported = fmt.Errorf("image format is not supported")
	ErrFailedToDecodeJPEG      = fmt.Errorf("failed to decode as jpeg")
	ErrFailedToDecodePNG       = fmt.Errorf("failed to decode as png")
	ErrFailedToDecodeWebP      = fmt.Errorf("failed to decode as webp")
	ErrFailedToDecodeAVIF      = fmt.Errorf("failed to decode as avif")
	ErrFailedToEncodeWebP      = fmt.Errorf("failed to encode as webp")
	ErrFailedToEncodeAVIF      = fmt.Errorf("failed to encode as avif")
)
View Source
var (
	ErrEncoderReturnedUnknownError = errors.New("error occurred while encoding WebP")
)

Functions

func ProcessStaticImage

func ProcessStaticImage(data *[]byte, targetImage *TargetImage) (*[]byte, error)

Types

type ImageFormat

type ImageFormat int
const (
	ImageFormatUnknown ImageFormat = iota
	ImageFormatJPEG
	ImageFormatPNG
	ImageFormatAnimatedPNG
	ImageFormatWebP
	ImageFormatAnimatedWebP
	ImageFormatGIF
	ImageFormatAVIF
	ImageFormatAnimatedAVIF
	ImageFormatICO
)

type TargetFormat

type TargetFormat int
const (
	TargetFormatWebP TargetFormat = iota
	TargetFormatAVIF
)

type TargetImage

type TargetImage struct {
	MaxWidth  int
	MaxHeight int
	Quality   int
	Format    TargetFormat
}

Directories

Path Synopsis
imagex
riff
Package riff implements the Resource Interchange File Format, used by media formats such as AVI, WAVE and WEBP.
Package riff implements the Resource Interchange File Format, used by media formats such as AVI, WAVE and WEBP.

Jump to

Keyboard shortcuts

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