processor

package
v0.0.0-...-57218f6 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeHeic

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

DecodeHeic decodes HEIC/HEIF images

Types

type Config

type Config struct {
	DefaultQuality int
	DefaultFormat  string
}

type ImageProcessor

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

func NewImageProcessor

func NewImageProcessor() *ImageProcessor

func (*ImageProcessor) ProcessImageData

func (p *ImageProcessor) ProcessImageData(img image.Image, opts ProcessOptions) (*ProcessedImage, error)

type ProcessOptions

type ProcessOptions struct {
	Width            int
	Height           int
	ResizeMode       resize.ResizeMode
	OutputFormat     string
	Quality          int
	RemoveBackground bool
	OptimizeImage    bool
}

ProcessOptions defines the options for image processing

type ProcessedImage

type ProcessedImage struct {
	Image   image.Image
	Format  string
	Quality int
}

func (*ProcessedImage) Write

func (pi *ProcessedImage) Write(w io.Writer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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