manipulators

package
v0.0.0-...-10288ee Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitManipulators

func InitManipulators(cfg *config.Config)

InitManipulators initializes registered manipulators

Types

type CropManipulator

type CropManipulator struct {
}

CropManipulator crops the image

func NewCropManipulator

func NewCropManipulator(cfg *config.Config) *CropManipulator

NewCropManipulator returns a new crop Manipulator

func (*CropManipulator) Execute

func (manipulator *CropManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the flip horizontal manipulator and flips the image horizontally

type FaceCropManipulator

type FaceCropManipulator struct {
	DefaultProvider string
	Cfg             *config.Config
}

FaceCropManipulator crops the image in a smart way to include most of the faces in the image

Supported parameters: - debug (boolean - 0/1) - enable debug view to see what faces were detected and how the cropping will be performed - pp (float 0.x-1.0) - factor with which to enlarge the crop area (default 0.2 = 20%) - provider (string) - force a specific provider as defined in the config - useCache (boolean - 0/1) - enable/disable the use of cache for the Facial detection API result - kio (boolean - 0/1) - Keep image orientation - keep the face croped with the same orientation as the original image

func NewFaceCropManipulator

func NewFaceCropManipulator(cfg *config.Config) *FaceCropManipulator

NewFaceCropManipulator returns a new face crop Manipulator

func (*FaceCropManipulator) Execute

func (m *FaceCropManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the fit manipulator and fits the image to the specified size

type FitManipulator

type FitManipulator struct {
}

FitManipulator fits the image to the specified size

func NewFitManipulator

func NewFitManipulator(cfg *config.Config) *FitManipulator

NewFitManipulator returns a new fit Manipulator

func (*FitManipulator) Execute

func (manipulator *FitManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the fit manipulator and fits the image to the specified size

type FlipHorizontalManipulator

type FlipHorizontalManipulator struct {
}

FlipHorizontalManipulator flips the image horizontally

func NewFlipHorizontalManipulator

func NewFlipHorizontalManipulator(cfg *config.Config) *FlipHorizontalManipulator

NewFlipHorizontalManipulator returns a new flip horizontal Manipulator

func (*FlipHorizontalManipulator) Execute

func (manipulator *FlipHorizontalManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the flip horizontal manipulator and flips the image horizontally

type FlipVerticalManipulator

type FlipVerticalManipulator struct {
}

FlipVerticalManipulator flips the image vertically

func NewFlipVerticalManipulator

func NewFlipVerticalManipulator(cfg *config.Config) *FlipVerticalManipulator

NewFlipVerticalManipulator returns a new flip vertical Manipulator

func (*FlipVerticalManipulator) Execute

func (manipulator *FlipVerticalManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the flip vertical manipulator and flips the image vertically

type Manipulator

type Manipulator interface {
	Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)
}

Manipulator interface

func GetManipulatorByName

func GetManipulatorByName(name string) Manipulator

GetManipulatorByName returns a manipulator from the registered manipulators list

type OutputManipulator

type OutputManipulator struct {
}

OutputManipulator sets the content-type that will be used as the output for the image processing format

func NewOutputManipulator

func NewOutputManipulator(cfg *config.Config) *OutputManipulator

NewOutputManipulator returns a new Output Manipulator

func (*OutputManipulator) Execute

func (manipulator *OutputManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the output format manipulator, setting the content-type that will be used to save the resulting image

type PasteManipulator

type PasteManipulator struct {
}

CropManipulator crops the image

func NewPasteManipulator

func NewPasteManipulator(cfg *config.Config) *PasteManipulator

NewPasteManipulator returns a new Paste Manipulator

func (*PasteManipulator) Execute

func (manipulator *PasteManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the paste manipulator

type ResizeManipulator

type ResizeManipulator struct {
}

ResizeManipulator resizes the image based on given parameters. If only 1 parameter is given, proportions are saved

func NewResizeManipulator

func NewResizeManipulator(cfg *config.Config) *ResizeManipulator

NewResizeManipulator returns a new Resize Manipulator

func (*ResizeManipulator) Execute

func (manipulator *ResizeManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the resize manipulator and resizes the image. If only width or height are specified, image proportions will be saved w - Width h - Height r - resampling filter (one of resamplingFilters values)

type RotateManipulator

type RotateManipulator struct {
}

RotateManipulator rotates the image

func NewRotateManipulator

func NewRotateManipulator(cfg *config.Config) *RotateManipulator

NewRotateManipulator returns a new Rotate Manipulator

func (*RotateManipulator) Execute

func (manipulator *RotateManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the rotate manipulator and allows rotating an image Supported Parameters: a - Angle = +/- 360.0 (float) r - resize bounds = 0/1 p - pivot point x|y format TODO: support "p" parameter to specify pivot point

type ShearHorizontalManipulator

type ShearHorizontalManipulator struct {
}

ShearHorizontalManipulator shears the image horizontally

func NewShearHorizontalManipulator

func NewShearHorizontalManipulator(cfg *config.Config) *ShearHorizontalManipulator

NewShearHorizontalManipulator returns a new shear horizontal Manipulator

func (*ShearHorizontalManipulator) Execute

func (manipulator *ShearHorizontalManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the shear horizontal manipulator and shears the image horizontally

type ShearVerticalManipulator

type ShearVerticalManipulator struct {
}

ShearVerticalManipulator shears the image vertically

func NewShearVerticalManipulator

func NewShearVerticalManipulator(cfg *config.Config) *ShearVerticalManipulator

NewShearVerticalManipulator returns a new shear vertical Manipulator

func (*ShearVerticalManipulator) Execute

func (manipulator *ShearVerticalManipulator) Execute(c echo.Context, params map[string]string, img image.Image) (image.Image, error)

Execute runs the shear horizontal manipulator and shears the image horizontally

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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