Documentation ¶
Index ¶
- func Brightness(g *gift.GIFT, qsArgs []string) bool
- func Contrast(g *gift.GIFT, qsArgs []string) bool
- func Crop(g *gift.GIFT, qsArgs []string) bool
- func FlipHorizontal(g *gift.GIFT, qsArgs []string) bool
- func FlipVertical(g *gift.GIFT, qsArgs []string) bool
- func Hue(g *gift.GIFT, qsArgs []string) bool
- func ParseFilters(q string) (*gift.GIFT, bool, error)
- func Resize(g *gift.GIFT, qsArgs []string) bool
- func Rotate(g *gift.GIFT, qsArgs []string) bool
- func Saturation(g *gift.GIFT, qsArgs []string) bool
- func Transpose(g *gift.GIFT, qsArgs []string) bool
- func Transverse(g *gift.GIFT, qsArgs []string) bool
- type Filter
- type FilterArgs
- type QueryString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Brightness ¶
Brightness creates a filter that changes the brightness of an image. The first (and only) parameter (percentage) must be in range (-100, 100). The percentage = 0 gives the original image. The percentage = -100 gives solid black image. The percentage = 100 gives solid white image.
func Contrast ¶
Contrast creates a filter that changes the contrast of an image. The first (and only) parameter (percentage) must be in range (-100, 100). The percentage = 0 gives the original image. The percentage = -100 gives solid grey image. The percentage = 100 gives an overcontrasted image.
func FlipHorizontal ¶
FlipHorizontal creates a filter that flips an image horizontally.
func FlipVertical ¶
FlipVertical creates a filter that flips an image vertically.
func Hue ¶
Hue creates a filter that rotates the hue of an image. The shift parameter is the hue angle shift, typically in range (-180, 180). The shift = 0 gives the original image.
func ParseFilters ¶
ProcessImage loads a file from storage, decodes it as an image, parses the query string, processes/filters the image and returns the result wrapped in a bytes.NewReader instance.
func Resize ¶
Resize resizes the given image to the specified size with the configured resampling algorithm (defaults to lanczos).
func Rotate ¶
Rotate creates a filter that rotates an image by the given angle counter-clockwise. The angle parameter is the rotation angle in degrees. The only allowed values for this fuction are 90, 180 and 270
func Saturation ¶
Saturation creates a filter that changes the saturation of an image. The percentage parameter must be in range (-100, 500). The percentage = 0 gives the original image.
Types ¶
type FilterArgs ¶
func NewFilterArgs ¶
func NewFilterArgs(filter, args string) *FilterArgs
type QueryString ¶
type QueryString string
QueryString is a convenience wrapper designed to be wrapped around a url.RawQuery, providing ordered access to all key/value pairs.
func (*QueryString) Values ¶
func (qs *QueryString) Values() ([]*FilterArgs, error)
Values returns a slice of *FilterArgs, each []string will have a length of 2 and will represent a single key/value pair parsed from the query string.