Documentation ¶
Index ¶
- Constants
- func FinalizeResponse(ctx filters.FilterContext)
- func HandleImageResponse(ctx filters.FilterContext, f ImageFilter) error
- func NewAddBackground() filters.Spec
- func NewBlur() filters.Spec
- func NewConvertImageType() filters.Spec
- func NewCrop() filters.Spec
- func NewCropByHeight() filters.Spec
- func NewCropByWidth() filters.Spec
- func NewFinalizeResponse() filters.Spec
- func NewLongerEdgeResize() filters.Spec
- func NewOverlayImage() filters.Spec
- func NewQuality() filters.Spec
- func NewResize() filters.Spec
- func NewResizeByHeight() filters.Spec
- func NewResizeByWidth() filters.Spec
- func NewSharpen() filters.Spec
- func NewTransformFromQueryParams() filters.Spec
- type ImageFilter
- type ImageFilterContext
Constants ¶
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 )
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" )
const (
// AddBackgroundName is the name of the filter
AddBackgroundName = "addBackground"
)
const BlurName = "blur"
BlurName is the name of the filter
const ConvertImageType = "convertImageType"
ConvertImageType is the name of the filter
const CropByHeightName = "cropByHeight"
CropByHeightName is the name of the filter
const CropByWidthName = "cropByWidth"
CropByWidthName is the name of the filter
const CropName = "crop"
CropName is the name of the filter
const (
ExtractArea = "transformFromQueryParams"
)
const FinalizeResponseName = "finalizeResponse"
FinalizeResponseName is the name of the filter
const LongerEdgeResizeName = "longerEdgeResize"
LongerEdgeResizeName is the name of the filter
const QualityName = "quality"
QualityName is the name of the filter
const ResizeByHeightName = "height"
ResizeByHeightName is the name of the filter
const ResizeByWidthName = "width"
ResizeByWidthName is the name of the filter
const (
// ResizeName is the name of the filter
ResizeName = "resize"
)
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 ¶
NewAddBackground creates a new add backgroud filter
func NewConvertImageType ¶
NewConvertImageType creates a new filter of this type
func NewCropByHeight ¶
NewCropByHeight creates a new filter of this type
func NewCropByWidth ¶
NewCropByWidth creates a new filter of this type
func NewFinalizeResponse ¶
NewFinalizeResponse creates a new filter of this type
func NewLongerEdgeResize ¶
NewLongerEdgeResize creates a new filter of this type
func NewOverlayImage ¶
NewOverlayImage creates a new filter of this type
func NewResizeByHeight ¶
NewResizeByHeight creates a new filter of this type
func NewResizeByWidth ¶
NewResizeByWidth creates a new filter of this type
func NewTransformFromQueryParams ¶ added in v1.0.6
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