xform

package
v0.0.0-...-e64c4a3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2024 License: GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blur

func Blur(img image.Image) *blur

Blur is a simple blur. Every pixel is averaged with its 8 neighbors.

func InvertColors

func InvertColors(img image.Image) *invertColors

InvertColors invert colors.

func MirrorHorizontal

func MirrorHorizontal(img image.Image) *mirrorHorizontal

MirrorHorizontal flips an image along its X-axis.

func MirrorVertical

func MirrorVertical(img image.Image) *mirrorVertical

MirrorVertical flips an image along its Y-axis.

func Rotate

func Rotate(img image.Image, degrees float64, center *image.Point, keepBounds bool) *rotate

Rotate rotates img by degrees amount about center. Positive degrees result in a counter-clockwise rotation. keepBounds specifies if the original bounds of img should be kept (true) or if new bounds should be calculated based on the rotated image (false). If center is nil, the center of img is used. If you repeatedly rotate an image.Image with keepBounds false, the image bounds will continue to grow. For example, doing Rotate(Rotate(img, 45, nil, false), -45, nil false) will get you an image that appears in the same orientation as img, but will have bounds nearly 3x the original.

func Rotate180

func Rotate180(img image.Image) *rotate180

Rotate180 efficiently (compared to Rotate) rotates an image 180 degrees.

func Rotate90

func Rotate90(img image.Image) *rotate90

Rotate90 efficiently (compared to Rotate) rotates an image 90 degrees counter-clockwise. Not currently working and I CBA.

func SubImage

func SubImage(img draw.Image, r image.Rectangle) draw.Image

SubImage tries to use the SubImage method of img, if it has one otherwise, return same image wrapped so that r becomes the new bounds.

func Translate

func Translate(img image.Image, by image.Point) *translate

Translate shifts pixels around by 'by'. The bounds are also shifted.

func WrapEdges

func WrapEdges(img image.Image) *wrapEdges

WrapEdges uses modulus to make an image infinitely repeat. The boundaries are kept the same.

Types

type Number

type Number interface {
	constraints.Integer | constraints.Float
}

Jump to

Keyboard shortcuts

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