canvas

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 25, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas interface {
	Path() PathPainter
	Rect() RectPainter
	Circle() CirclePainter
	Text() TextPainter

	Reset()
	Cleanup()
}

Canvas

type CirclePainter

type CirclePainter interface {
	Circle(center point.Point, radius float64) CirclePainter

	// Fill the circle
	Fill(Style)
}

CirclePainter

type PathPainter

type PathPainter interface {
	// Set up the path to be painted.
	// Then use Fill and/or Stroke to actually paint it.
	Path(points []point.Point) PathPainter

	// Fill the path
	Fill(Style)

	// Stroke the outline of the path.
	// Key "stroke-width" is supported in style.
	Stroke(Style)
}

PathPainter

type RectPainter

type RectPainter interface {
	Rect(width, height float64) RectPainter
	CornerRadius(rx, ry float64) RectPainter

	// Fill the rect
	Fill(Style)
}

RectPainter

type Style

type Style = map[string]string

type TextPainter

type TextPainter interface {
	// FillText
	// transform is an affine matrix approximating a 3D transform
	// 	of the plane on which the text is to be painted.
	// text is the text to be painted.
	// Style supports the following keys: "fill", "font", "text-anchor"
	FillText(transform affine.Matrix, text string, style Style)
}

TextPainter

Jump to

Keyboard shortcuts

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