Documentation
¶
Index ¶
- Constants
- Variables
- func DrawDigits(c *gg.Context, dd DigitDrawer, digitSize, stride geom.Point2f, digits []int)
- func DrawDigits2D(c *gg.Context, dd DigitDrawer, digitSize, stride geom.Point2f, d2d *Digits2D)
- func DrawGreedGG(c *gg.Context, nx, ny int, greedWidth float64)
- func ImageEncodePNG(m image.Image) ([]byte, error)
- func ImageSavePNG(m image.Image, filename string) error
- func MakeDigitsImage(dic DigitsImageConfig, digits []int) (image.Image, error)
- func MakeDigitsImage2D(dic DigitsImageConfig, d2d *Digits2D) (image.Image, error)
- func RandDigits(r *random.Rand, n int) []int
- func RandTrit(r *random.Rand) int
- func StrideHalfX(digitSize geom.Point2f) geom.Point2f
- type Coord
- type DigitDrawer
- type DigitDrawer1
- type DigitDrawer2
- type DigitDrawer3
- type DigitDrawer4
- type DigitDrawer5
- type DigitDrawer6
- type DigitDrawer7
- type Digits2D
- type DigitsImageConfig
- type GG_Context
Constants ¶
View Source
const AspectRatio = 2.0 // dy / dx
Variables ¶
View Source
var ( ColorTransparent = color.Transparent ColorWhite = color.White ColorBlack = color.Black DefaultColorBG = color.Transparent DefaultColorFG = color.Black )
View Source
var DrawGreedEnable = false
Functions ¶
func DrawDigits ¶
func DrawDigits2D ¶
func MakeDigitsImage ¶
func MakeDigitsImage(dic DigitsImageConfig, digits []int) (image.Image, error)
func MakeDigitsImage2D ¶
func MakeDigitsImage2D(dic DigitsImageConfig, d2d *Digits2D) (image.Image, error)
Types ¶
type DigitDrawer ¶
type DigitDrawer1 ¶
type DigitDrawer1 struct{}
type DigitDrawer2 ¶
type DigitDrawer2 struct{}
type DigitDrawer3 ¶
type DigitDrawer3 struct{}
type DigitDrawer4 ¶
type DigitDrawer4 struct{}
type DigitDrawer5 ¶
type DigitDrawer5 struct{}
type DigitDrawer6 ¶
type DigitDrawer6 struct{}
type DigitDrawer7 ¶
type DigitDrawer7 struct{}
type Digits2D ¶
func NewDigits2D ¶
type DigitsImageConfig ¶
type GG_Context ¶
type GG_Context struct {
// contains filtered or unexported fields
}
func NewGG_Context ¶
func NewGG_Context(c *gg.Context) *GG_Context
func (*GG_Context) SetFontSize ¶
func (p *GG_Context) SetFontSize(fontSize float64) error
func (*GG_Context) SetFontSizeFactor ¶
func (p *GG_Context) SetFontSizeFactor(dX, dY float64, fontSizeFactor float64) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.