imgmanip

package
v0.0.0-...-e1cee33 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GrayAlphaModel grayAlphaModel

Functions

func DrawAsNrgbaWithBackground

func DrawAsNrgbaWithBackground(img image.Image, bg color.Color) *image.NRGBA

func FlipVertically

func FlipVertically[T Boundser](img Boundser, data []byte)

Rewrites the given input image flipping it vertically.

func IsTransparent

func IsTransparent(img *image.NRGBA) bool

func MustDumpImage

func MustDumpImage(img image.Image, filePath string)

func Scale

func Scale(img image.Image, xratio, yratio float32) image.Image

func ToNRGBA

func ToNRGBA(img image.Image) *image.NRGBA

Types

type Boundser

type Boundser interface {
	Bounds() image.Rectangle
}

type GrayAlpha

type GrayAlpha struct {
	// Pix holds the image's pixels, as gray values. The pixel at
	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
	Pix []uint8
	// Stride is the Pix stride (in bytes) between vertically adjacent pixels.
	Stride int
	// Rect is the image's bounds.
	Rect image.Rectangle
}

func NewGrayAlpha

func NewGrayAlpha(r image.Rectangle) *GrayAlpha

func (*GrayAlpha) At

func (p *GrayAlpha) At(x, y int) color.Color

func (*GrayAlpha) Bounds

func (p *GrayAlpha) Bounds() image.Rectangle

func (*GrayAlpha) ColorModel

func (p *GrayAlpha) ColorModel() color.Model

func (*GrayAlpha) PixOffset

func (p *GrayAlpha) PixOffset(x, y int) int

PixOffset returns the index of the first element of Pix that corresponds to the pixel at (x, y).

func (*GrayAlpha) Set

func (p *GrayAlpha) Set(x, y int, c color.Color)

type InvertedCanvas

type InvertedCanvas struct {
	draw.Image
}

func NewInvertedCanvas

func NewInvertedCanvas(img draw.Image) *InvertedCanvas

func (*InvertedCanvas) At

func (canv *InvertedCanvas) At(x, y int) color.Color

func (*InvertedCanvas) Set

func (canv *InvertedCanvas) Set(x, y int, c color.Color)

type VertFlipped

type VertFlipped struct {
	image.Image
}

An image.Image that looks vertically flipped w.r.t. the embedded image.Image.

func (VertFlipped) At

func (v VertFlipped) At(x, y int) color.Color

Jump to

Keyboard shortcuts

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