backend

package
v0.0.0-...-4692f6a Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MethodNotImplementedError = errors.New("Not implemented")

MethodNotImplementedError is an error returned if method is not implemented

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Fit(img *image.ImageFile, options *Options) ([]byte, error)
	Flat(background *image.ImageFile, options *Options) ([]byte, error)
	Flip(img *image.ImageFile, options *Options) ([]byte, error)
	Resize(img *image.ImageFile, options *Options) ([]byte, error)
	Rotate(img *image.ImageFile, options *Options) ([]byte, error)
	String() string
	Thumbnail(img *image.ImageFile, options *Options) ([]byte, error)
}

Engine is an interface to define an image engine

type Gifsicle

type Gifsicle struct {
	Path string
}

Gifsicle is the gifsicle backend.

func (*Gifsicle) Fit

func (b *Gifsicle) Fit(*image.ImageFile, *Options) ([]byte, error)

Fit implements Backend.

func (*Gifsicle) Flat

func (b *Gifsicle) Flat(*image.ImageFile, *Options) ([]byte, error)

Flat implements Backend.

func (*Gifsicle) Flip

func (b *Gifsicle) Flip(*image.ImageFile, *Options) ([]byte, error)

Flip implements Backend.

func (*Gifsicle) Resize

func (b *Gifsicle) Resize(imgfile *image.ImageFile, opts *Options) ([]byte, error)

Resize implements Backend.

func (*Gifsicle) Rotate

func (b *Gifsicle) Rotate(*image.ImageFile, *Options) ([]byte, error)

Rotate implements Backend.

func (*Gifsicle) String

func (b *Gifsicle) String() string

func (*Gifsicle) Thumbnail

func (b *Gifsicle) Thumbnail(imgfile *image.ImageFile, opts *Options) ([]byte, error)

Thumbnail implements Backend.

type GoImage

type GoImage struct{}

func (*GoImage) Fit

func (e *GoImage) Fit(img *imagefile.ImageFile, options *Options) ([]byte, error)

func (*GoImage) Flat

func (e *GoImage) Flat(backgroundFile *imagefile.ImageFile, options *Options) ([]byte, error)

func (*GoImage) Flip

func (e *GoImage) Flip(img *imagefile.ImageFile, options *Options) ([]byte, error)

func (*GoImage) Resize

func (e *GoImage) Resize(img *imagefile.ImageFile, options *Options) ([]byte, error)

func (*GoImage) Rotate

func (e *GoImage) Rotate(img *imagefile.ImageFile, options *Options) ([]byte, error)

func (*GoImage) String

func (e *GoImage) String() string

func (*GoImage) Thumbnail

func (e *GoImage) Thumbnail(img *imagefile.ImageFile, options *Options) ([]byte, error)

type Options

type Options struct {
	Color    string
	Degree   int
	Format   imaging.Format
	Height   int
	Images   []image.ImageFile
	Position string
	Quality  int
	Stick    string
	Upscale  bool
	Width    int
}

Options is the engine options

func (Options) String

func (o Options) String() string

Jump to

Keyboard shortcuts

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