rotate

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RotateAny

type RotateAny struct {
	Angle string `json:"angle,omitempty"`
	Color string `json:"color,omitempty"`
}

RotateAny rotates an image by a specific angle counter-clockwise. Uncovered areas after the rotation are filled with the specified color.

func (RotateAny) Apply

func (f RotateAny) Apply(repl *caddy.Replacer, img image.Image) (image.Image, error)

Apply applies the image filter to an image and returns the new image.

type RotateAnyFactory

type RotateAnyFactory struct{}

RotateAnyFactory creates RotateAny instances.

func (RotateAnyFactory) Name

func (ff RotateAnyFactory) Name() string

Name returns the name of the filter, which is also the directive used in the image filter block.

func (RotateAnyFactory) New

func (ff RotateAnyFactory) New(args ...string) (imagefilter.Filter, error)

New initialises and returns a configured Fit instance.

Syntax:

rotate_any <angle> <color>

Parameters:

angle is the angle as floating point number in degrees by which the image is rotated counter-clockwise.

color is the color which is used to fill uncovered areas after the rotation. Supported formats are:

"#FFAADD" (in quotes because otherwise it will be a comment in a caddyfile)
rgb(255,170,221)
rgba(255,170,221,0.5)
transparent, black, white, blue or about 140 more

(see for many more supported color words https://www.w3schools.com/colors/colors_names.asp)

func (RotateAnyFactory) Unmarshal

func (ff RotateAnyFactory) Unmarshal(data []byte) (imagefilter.Filter, error)

Unmarshal decodes JSON data and returns a RotateAny instance.

Jump to

Keyboard shortcuts

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