Documentation ¶
Index ¶
- func InitManipulators(cfg *config.Config)
- type BrightnessManipulator
- type ContrastManipulator
- type CropManipulator
- type FaceCropManipulator
- type FitManipulator
- type FlipHorizontalManipulator
- type FlipVerticalManipulator
- type Manipulator
- type OutputManipulator
- type PasteManipulator
- type ResizeManipulator
- type RotateManipulator
- type ShearHorizontalManipulator
- type ShearVerticalManipulator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitManipulators ¶
InitManipulators initializes registered manipulators
Types ¶
type BrightnessManipulator ¶
type BrightnessManipulator struct { }
BrightnessManipulator adjusts the brightness of the image
func NewBrightnessManipulator ¶
func NewBrightnessManipulator(cfg *config.Config) *BrightnessManipulator
NewBrightnessManipulator returns a new brightness Manipulator
type ContrastManipulator ¶
type ContrastManipulator struct { }
ContrastManipulator adjusts the contrast of the image
func NewContrastManipulator ¶
func NewContrastManipulator(cfg *config.Config) *ContrastManipulator
NewContrastManipulator returns a new contrast Manipulator
type CropManipulator ¶
type CropManipulator struct { }
CropManipulator crops the image
func NewCropManipulator ¶
func NewCropManipulator(cfg *config.Config) *CropManipulator
NewCropManipulator returns a new crop Manipulator
type FaceCropManipulator ¶
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
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
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
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
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
type PasteManipulator ¶
type PasteManipulator struct { }
CropManipulator crops the image
func NewPasteManipulator ¶
func NewPasteManipulator(cfg *config.Config) *PasteManipulator
NewPasteManipulator returns a new 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
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