icon

package
v1.80.1 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MPL-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scale

func Scale(img image.Image, width, height int) image.Image

Scale an image.

func ScaleDownProportionally

func ScaleDownProportionally(currentWidth, currentHeight, desiredWidth, desiredHeight int) (width, height int)

ScaleDownProportionally returns the width and height that are closest to the desired values without distorting the size, but won't increase the current values.

func ScaleProportionally

func ScaleProportionally(currentWidth, currentHeight, desiredWidth, desiredHeight int) (width, height int)

ScaleProportionally returns the width and height that are closest to the desired values without distorting the size.

func ScaleTo

func ScaleTo(img image.Image, sizes []image.Point) []image.Image

ScaleTo scales the image to the desired sizes. If an image cannot be scaled exactly to the desired size, it will be scaled proportionally and then centered within the available space.

func ScaleUpProportionally

func ScaleUpProportionally(currentWidth, currentHeight, desiredWidth, desiredHeight int) (width, height int)

ScaleUpProportionally returns the width and height that are closest to the desired values without distorting the size, but won't decrease the current values.

func Stack

func Stack(images ...image.Image) image.Image

Stack a set of images on top of each other, producing a new image. The first image in the series will be on the bottom and the last will be on the top. If the images are of different sizes, the resulting image will be the size of the largest image and all other images will be centered within that area.

func StackAt

func StackAt(images ...*ImageAt) image.Image

StackAt stacks a set of images on top of each other, producing a new image. The first image in the series will be on the bottom and the last will be on the top. The resulting image will be the size of the largest area covered based on each image's size plus origin. Note that if an origin has a negative value, it will be normalized such that the largest negative will become the new origin for the resulting image.

Types

type ImageAt

type ImageAt struct {
	Image  image.Image
	Origin image.Point
}

ImageAt provides storage for an image and an origin point.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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