transform

package
v2.7.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2016 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GrayRotator

type GrayRotator struct {
	Img *image.Gray
}

GrayRotator decorates *image.Gray with rotation functions

func (*GrayRotator) Image

func (r *GrayRotator) Image() image.Image

Image returns the underlying image as an image.Image value

func (*GrayRotator) Mirror

func (r *GrayRotator) Mirror()

Mirror flips the image around its vertical axis

func (*GrayRotator) Rotate180

func (r *GrayRotator) Rotate180()

Rotate180 does a simple 180-degree clockwise rotation

func (*GrayRotator) Rotate270

func (r *GrayRotator) Rotate270()

Rotate270 does a simple 270-degree clockwise rotation

func (*GrayRotator) Rotate90

func (r *GrayRotator) Rotate90()

Rotate90 does a simple 90-degree clockwise rotation

type RGBARotator

type RGBARotator struct {
	Img *image.RGBA
}

RGBARotator decorates *image.RGBA with rotation functions

func (*RGBARotator) Image

func (r *RGBARotator) Image() image.Image

Image returns the underlying image as an image.Image value

func (*RGBARotator) Mirror

func (r *RGBARotator) Mirror()

Mirror flips the image around its vertical axis

func (*RGBARotator) Rotate180

func (r *RGBARotator) Rotate180()

Rotate180 does a simple 180-degree clockwise rotation

func (*RGBARotator) Rotate270

func (r *RGBARotator) Rotate270()

Rotate270 does a simple 270-degree clockwise rotation

func (*RGBARotator) Rotate90

func (r *RGBARotator) Rotate90()

Rotate90 does a simple 90-degree clockwise rotation

type Rotator

type Rotator interface {
	Image() image.Image
	Rotate90()
	Rotate180()
	Rotate270()
	Mirror()
}

Rotator implements simple 90-degree rotations in addition to mirroring for IIIF compliance. After each operation, the underlying image is replaced with the new image. It's important to note, however, that the source image is never directly changed. A new image is drawn, and the old is simply forgotten by the Rotator.

Jump to

Keyboard shortcuts

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