imagetools

package
v0.0.0-...-2b7049b Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DilateMaskFromImage

func DilateMaskFromImage(img image.Image, padding int) image.Image

DilateMaskFromImage takes a src image, and runs the dilation algorithm with the specified padding It returns a new image and does not modify the original

func DrawFilledCircle

func DrawFilledCircle(r int, c color.Color) *image.NRGBA

DrawFilledCircle returns a new image of a filled circle with radius r and fill color c

func ImageWithPadding

func ImageWithPadding(img image.Image, padding int) image.Image

ImageWithPadding returns a new image, padded by the given padding

Types

type AlphaImageMatrix

type AlphaImageMatrix struct {
	// contains filtered or unexported fields
}

func NewAlphaImageMatrix

func NewAlphaImageMatrix(img image.Image) *AlphaImageMatrix

NewAlphaImageMatrix creates a new AlphaImageMatrix from the specified src image

func (*AlphaImageMatrix) Clone

func (m *AlphaImageMatrix) Clone() *AlphaImageMatrix

Clone returns a copy of the matrix

func (*AlphaImageMatrix) DilateMask

func (m *AlphaImageMatrix) DilateMask(padding uint32) *image.Alpha

DilateMask returns an Alpha mask with the specified padding around the source image. This does not modify the original matrix or image.

func (*AlphaImageMatrix) Get

func (m *AlphaImageMatrix) Get(x int, y int) uint32

Get gets the alpha value at point (x,y)

func (*AlphaImageMatrix) GetManhattanMatrix

func (m *AlphaImageMatrix) GetManhattanMatrix() *AlphaImageMatrix

GetManhattanMatrix generates a new matrix containing the manhattan distance away from the nearest pixel with an alpha value of at least alphaCutoff

func (*AlphaImageMatrix) ImageBounds

func (m *AlphaImageMatrix) ImageBounds() image.Rectangle

ImageBounds returns the bounding image.Rectangle of the image

func (*AlphaImageMatrix) In

func (m *AlphaImageMatrix) In(x int, y int) bool

In returns whether an (x,y) point lies within the image bounds

func (*AlphaImageMatrix) NumColumns

func (m *AlphaImageMatrix) NumColumns() int

NumColumns returns the number of columns of the matrix

func (*AlphaImageMatrix) NumRows

func (m *AlphaImageMatrix) NumRows() int

NumRows returns the number of rows of the matrix

func (*AlphaImageMatrix) Set

func (m *AlphaImageMatrix) Set(x int, y int, value uint32)

Set sets the alpha value at point (x,y)

type Number

type Number interface {
	int64 | int32 | int16 | int8 | int | uint64 | uint32 | uint16 | uint8 | uint
}

Jump to

Keyboard shortcuts

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