dgdr

package
v0.0.0-...-0f6939a Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DrawGreedEnable = false

Functions

func CairoMakeDigitImage

func CairoMakeDigitImage(filename string, dd CairoDigitDrawer, digitHeight float64, digit int) error

func CairoMakeDigitsImageMatrix

func CairoMakeDigitsImageMatrix(filename string, dd CairoDigitDrawer,
	xn, yn int, digitHeight float64, digits []int) error

func DrawGreedCairo

func DrawGreedCairo(c *cairo.Canvas, nx, ny int, greedWidth float64)

func DrawGreedGG

func DrawGreedGG(c *gg.Context, nx, ny int, greedWidth float64)

func MakeDigitImage

func MakeDigitImage(filename string, dd DigitDrawer, digitHeight float64, digit int) error

func MakeDigitsImage

func MakeDigitsImage(filename string, dd DigitDrawer, digitHeight float64, digits []int) error

func MakeDigitsImageMatrix

func MakeDigitsImageMatrix(filename string, dd DigitDrawer, xn, yn int, digitHeight float64, digits []int) error

Types

type Arc

type Arc struct {
	Center geom.Point2f
	Radius float64
	Angle1 float64
	Angle2 float64
}

func MakeArc

func MakeArc(x, y float64, r float64, angle1, angle2 float64) Arc

func (Arc) DrawCairo

func (v Arc) DrawCairo(c *cairo.Canvas)

func (Arc) DrawGG

func (v Arc) DrawGG(c *gg.Context)

type CairoDigitDrawer

type CairoDigitDrawer interface {
	// ratio = digitHeight / digitWidth
	// digitWidth = digitHeight / ratio
	Ratio() float64

	DrawDigit(c *cairo.Canvas, x, y float64, digitHeight float64, digit int)
}

type Circle

type Circle struct {
	Center geom.Point2f
	Radius float64
}

func MakeCircle

func MakeCircle(x, y float64, r float64) Circle

func (Circle) DrawCairo

func (x Circle) DrawCairo(c *cairo.Canvas)

func (Circle) DrawGG

func (x Circle) DrawGG(c *gg.Context)

type DigitDrawer

type DigitDrawer interface {
	// Digit Width
	Width(digitHeight float64) (digitWidth float64)

	DrawDigit(c *gg.Context, x, y float64, digitHeight float64, digit int)
}

type DrawerCairo

type DrawerCairo interface {
	DrawCairo(c *cairo.Canvas)
}

type DrawerCairoGG

type DrawerCairoGG interface {
	DrawerCairo
	DrawerGG
}

type DrawerGG

type DrawerGG interface {
	DrawGG(c *gg.Context)
}

type Line

type Line struct {
	A, B geom.Point2f
}

func MakeLine

func MakeLine(x1, y1 float64, x2, y2 float64) Line

func (Line) DrawCairo

func (l Line) DrawCairo(c *cairo.Canvas)

func (Line) DrawGG

func (l Line) DrawGG(c *gg.Context)

Jump to

Keyboard shortcuts

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