imageencoder

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompressionLevel

type CompressionLevel string
const (
	CompressionLevelUnspecified CompressionLevel = ""
	CompressionLevelNone        CompressionLevel = "none"
	CompressionLevelLow         CompressionLevel = "low"
	CompressionLevelMedium      CompressionLevel = "medium"
	CompressionLevelHigh        CompressionLevel = "high"
)

type Encoder

type Encoder interface {
	Encode(writer io.Writer, img image.Image, opts Options) error
}

type Format

type Format string
const (
	FormatUnspecified Format = ""
	FormatPNG         Format = "png"
	FormatJPEG        Format = "jpeg"
)

func (Format) Valid

func (f Format) Valid() bool

type JPEG

type JPEG struct{}

func (*JPEG) Encode

func (j *JPEG) Encode(w io.Writer, img image.Image, opts Options) error

type Manager

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

func NewManager

func NewManager() *Manager

func (*Manager) For

func (m *Manager) For(format Format) (Encoder, error)

type Options

type Options struct {
	CompressionLevel CompressionLevel
}

type PNG

type PNG struct{}

func (*PNG) Encode

func (p *PNG) Encode(w io.Writer, img image.Image, opts Options) error

Jump to

Keyboard shortcuts

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