filters

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2018 License: MIT Imports: 14 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// North Gravity
	North = "north"
	// South Gravity
	South = "south"
	// East Gravity
	East = "east"
	// West Gravity
	West = "west"
	// Center Gravity
	Center = "center"
	// Quality used by default if not specified
	Quality = 100
)
View Source
const (
	// OverlayImageName is the name of the filter
	OverlayImageName = "overlayImage"
	// NE North East
	NE = "NE"
	// NC North Center
	NC = "NC"
	// NW North West
	NW = "NW"
	// CE Centre East
	CE = "CE"
	// CC Centre Center
	CC = "CC"
	// CW Centre West
	CW = "CW"
	// SE South East
	SE = "SE"
	// SC South Center
	SC = "SC"
	// SW South West
	SW = "SW"
)
View Source
const (
	// AddBackgroundName is the name of the filter
	AddBackgroundName = "addBackground"
)
View Source
const BlurName = "blur"

BlurName is the name of the filter

View Source
const ConvertImageType = "convertImageType"

ConvertImageType is the name of the filter

View Source
const CropByHeightName = "cropByHeight"

CropByHeightName is the name of the filter

View Source
const CropByWidthName = "cropByWidth"

CropByWidthName is the name of the filter

View Source
const CropName = "crop"

CropName is the name of the filter

View Source
const (
	ExtractArea = "transformFromQueryParams"
)
View Source
const FinalizeResponseName = "finalizeResponse"

FinalizeResponseName is the name of the filter

View Source
const LongerEdgeResizeName = "longerEdgeResize"

LongerEdgeResizeName is the name of the filter

View Source
const QualityName = "quality"

QualityName is the name of the filter

View Source
const ResizeByHeightName = "height"

ResizeByHeightName is the name of the filter

View Source
const ResizeByWidthName = "width"

ResizeByWidthName is the name of the filter

View Source
const (
	// ResizeName is the name of the filter
	ResizeName = "resize"
)
View Source
const SharpenName = "sharpen"

SharpenName is the name of the filter

Variables

This section is empty.

Functions

func FinalizeResponse

func FinalizeResponse(ctx filters.FilterContext)

FinalizeResponse is called at the end of the transformations on an image to empty the queue of operations to perform

func HandleImageResponse

func HandleImageResponse(ctx filters.FilterContext, f ImageFilter) error

HandleImageResponse should be called by the Response of every filter. It transforms the image

func NewAddBackground

func NewAddBackground() filters.Spec

NewAddBackground creates a new add backgroud filter

func NewBlur

func NewBlur() filters.Spec

NewBlur creates a new filter of this type

func NewConvertImageType

func NewConvertImageType() filters.Spec

NewConvertImageType creates a new filter of this type

func NewCrop

func NewCrop() filters.Spec

NewCrop creates a new filter of this type

func NewCropByHeight

func NewCropByHeight() filters.Spec

NewCropByHeight creates a new filter of this type

func NewCropByWidth

func NewCropByWidth() filters.Spec

NewCropByWidth creates a new filter of this type

func NewFinalizeResponse

func NewFinalizeResponse() filters.Spec

NewFinalizeResponse creates a new filter of this type

func NewLongerEdgeResize

func NewLongerEdgeResize() filters.Spec

NewLongerEdgeResize creates a new filter of this type

func NewOverlayImage

func NewOverlayImage() filters.Spec

NewOverlayImage creates a new filter of this type

func NewQuality

func NewQuality() filters.Spec

NewQuality creates a new filter of this type

func NewResize

func NewResize() filters.Spec

NewResize creates a new filter of this type

func NewResizeByHeight

func NewResizeByHeight() filters.Spec

NewResizeByHeight creates a new filter of this type

func NewResizeByWidth

func NewResizeByWidth() filters.Spec

NewResizeByWidth creates a new filter of this type

func NewSharpen

func NewSharpen() filters.Spec

NewSharpen creates a new filter of this type

func NewTransformFromQueryParams added in v1.0.6

func NewTransformFromQueryParams() filters.Spec

Types

type ImageFilter

type ImageFilter interface {
	CreateOptions(imageContext *ImageFilterContext) (*bimg.Options, error)
	CanBeMerged(other *bimg.Options, self *bimg.Options) bool
	Merge(other *bimg.Options, self *bimg.Options) *bimg.Options
}

ImageFilter defines what a filter should implement

type ImageFilterContext added in v1.0.4

type ImageFilterContext struct {
	Image      *bimg.Image
	Parameters map[string][]string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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