gg

package
v0.0.0-...-efdd1d7 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DitherPixel

func DitherPixel(grayLevel int, x, y int) color.Color

DitherPixel converts a gray level to black or white using Bayer dithering

func DrawTestPattern

func DrawTestPattern(img *image.Gray, width, height int)

func DrawTestPatternBW

func DrawTestPatternBW(img *image.Gray, width, height int)

func LoadFontFace

func LoadFontFace(path string, points float64) (font.Face, error)

func SavePNG

func SavePNG(path string, im image.Image) error

Types

type Context

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

func NewContext

func NewContext(width, height int) *Context

func NewContextForGray

func NewContextForGray(im *image.Gray) *Context

func (*Context) Clear

func (dc *Context) Clear()

func (*Context) DrawStringAnchored

func (dc *Context) DrawStringAnchored(s string, x, y, ax, ay float64)

func (*Context) LoadFontFace

func (dc *Context) LoadFontFace(path string, points float64) error

func (*Context) MeasureString

func (dc *Context) MeasureString(s string) (w, h float64)

func (*Context) SavePNG

func (dc *Context) SavePNG(path string) error

func (*Context) SetRGB

func (dc *Context) SetRGB(r float64)

func (*Context) SetRGBA

func (dc *Context) SetRGBA(r float64)

type FillRule

type FillRule int
const (
	FillRuleWinding FillRule = iota
)

type LineCap

type LineCap int

type LineJoin

type LineJoin int

type Matrix

type Matrix struct {
	XX, YX, XY, YY, X0, Y0 float64
}

func Identity

func Identity() Matrix

func Rotate

func Rotate(angle float64) Matrix

func Scale

func Scale(x, y float64) Matrix

func Shear

func Shear(x, y float64) Matrix

func Translate

func Translate(x, y float64) Matrix

func (Matrix) Multiply

func (a Matrix) Multiply(b Matrix) Matrix

func (Matrix) Rotate

func (a Matrix) Rotate(angle float64) Matrix

func (Matrix) Scale

func (a Matrix) Scale(x, y float64) Matrix

func (Matrix) Shear

func (a Matrix) Shear(x, y float64) Matrix

func (Matrix) TransformPoint

func (a Matrix) TransformPoint(x, y float64) (tx, ty float64)

func (Matrix) TransformVector

func (a Matrix) TransformVector(x, y float64) (tx, ty float64)

func (Matrix) Translate

func (a Matrix) Translate(x, y float64) Matrix

type Pattern

type Pattern interface {
	ColorAt(x, y int) color.Color
}

func NewSolidPattern

func NewSolidPattern(color color.Color) Pattern

type Point

type Point struct {
	X, Y float64
}

func (Point) Distance

func (a Point) Distance(b Point) float64

func (Point) Fixed

func (a Point) Fixed() fixed.Point26_6

func (Point) Interpolate

func (a Point) Interpolate(b Point, t float64) Point

type RepeatOp

type RepeatOp int

Jump to

Keyboard shortcuts

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