engine

package
v0.0.0-...-ce4b01d Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: MIT Imports: 6 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AvailableEngines       = []string{"ImageMagick"}
	ErrUnknownResizeEngine = errors.New("specify unknown resize engine.")
)

Functions

func Finalize

func Finalize()

func Initialize

func Initialize()

Types

type ImageMagickEngine

type ImageMagickEngine struct {
	ResizeEngine
	// contains filtered or unexported fields
}

func (*ImageMagickEngine) Close

func (e *ImageMagickEngine) Close()

func (*ImageMagickEngine) Crop

func (e *ImageMagickEngine) Crop(width int, height int, startX int, startY int) error

func (*ImageMagickEngine) Generate

func (e *ImageMagickEngine) Generate() ([]byte, error)

func (*ImageMagickEngine) GetImageHeight

func (e *ImageMagickEngine) GetImageHeight() int

func (*ImageMagickEngine) GetImageWidth

func (e *ImageMagickEngine) GetImageWidth() int

func (*ImageMagickEngine) Open

func (e *ImageMagickEngine) Open() error

func (*ImageMagickEngine) RemoveAlpha

func (e *ImageMagickEngine) RemoveAlpha() error

func (*ImageMagickEngine) Resize

func (e *ImageMagickEngine) Resize(width int, height int) error

func (*ImageMagickEngine) SetCompressionQuality

func (e *ImageMagickEngine) SetCompressionQuality(quality int)

func (*ImageMagickEngine) SetFormat

func (e *ImageMagickEngine) SetFormat(format string)

func (*ImageMagickEngine) SetSizeHint

func (e *ImageMagickEngine) SetSizeHint(width int, height int)

type ResizeEngine

type ResizeEngine interface {
	Open() error
	Close()

	SetSizeHint(width, height int)
	SetFormat(format string)
	SetCompressionQuality(quality int)

	GetImageHeight() int
	GetImageWidth() int

	RemoveAlpha() error
	Resize(width int, height int) error
	Crop(width int, height int, startX int, startY int) error
	Generate() ([]byte, error)
}

func New

func New(image []byte) (ResizeEngine, error)

Jump to

Keyboard shortcuts

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