Documentation
¶
Index ¶
- Constants
- type BruteForceMinDistanceFinder
- type Canvas
- type ClockDirection
- type Config
- type Contour
- type Coords
- type CubicBezier
- func (cb *CubicBezier) CurvatureAt(t float64) Point
- func (c CubicBezier) GetDirectionVector() *Vector
- func (c CubicBezier) GetLowResPoints() []fixed.Point26_6
- func (c *CubicBezier) GetSignedArea() float64
- func (c *CubicBezier) IsConnected(c2 Curve) bool
- func (c1 *CubicBezier) IsCorner(c2 Curve, threshold float64) bool
- func (cb *CubicBezier) PointAt(t float64) Point
- func (cb *CubicBezier) Split() (Curve, Curve)
- func (cb CubicBezier) String() string
- func (cb *CubicBezier) TangentAt(t float64) Point
- type Curve
- type CurveSampler
- type Edge
- type EdgeColor
- type EdgeColorPalette
- type EdgeColorizer
- type EdgeKind
- type Glyph
- type GlyphOptions
- type Line
- func (l *Line) CurvatureAt(t float64) Point
- func (c Line) GetDirectionVector() *Vector
- func (c Line) GetLowResPoints() []fixed.Point26_6
- func (c *Line) GetSignedArea() float64
- func (c *Line) IsConnected(c2 Curve) bool
- func (c1 *Line) IsCorner(c2 Curve, threshold float64) bool
- func (ln *Line) PointAt(t float64) Point
- func (l *Line) Split() (Curve, Curve)
- func (l Line) String() string
- func (l *Line) TangentAt(t float64) Point
- type Metadata
- type MetadataAtlas
- type MetadataMetrics
- type Metrics
- func (e *Metrics) GetAdvance() float64
- func (e *Metrics) GetBounds() image.Rectangle
- func (e *Metrics) GetPlaneBounds() fixed.Rectangle26_6
- func (e *Metrics) GetRange() (float64, float64)
- func (e *Metrics) Scale(p fixed.Point26_6, bounds image.Rectangle, padding int) (int, int)
- func (e *Metrics) ToFloat(x, y int) (float64, float64)
- type MinDistanceFinder
- type Msdf
- type Point
- type QuadraticBezier
- func (qb *QuadraticBezier) CurvatureAt(t float64) Point
- func (c QuadraticBezier) GetDirectionVector() *Vector
- func (c QuadraticBezier) GetLowResPoints() []fixed.Point26_6
- func (c *QuadraticBezier) GetSignedArea() float64
- func (c *QuadraticBezier) IsConnected(c2 Curve) bool
- func (c1 *QuadraticBezier) IsCorner(c2 Curve, threshold float64) bool
- func (qb *QuadraticBezier) PointAt(t float64) Point
- func (qb *QuadraticBezier) Split() (Curve, Curve)
- func (qb QuadraticBezier) String() string
- func (qb *QuadraticBezier) TangentAt(t float64) Point
- type SimpleEdgeColorizer
- type SubvisionMinDistanceFinder
- type Vector
Constants ¶
View Source
const ( RED EdgeColor = 1 << 0 // = 1 (bit 0) GREEN = 1 << 1 // = 2 (bit 1) BLUE = 1 << 2 // = 4 (bit 2) WHITE = RED | GREEN | BLUE CYAN = GREEN | BLUE MAGENTA = RED | BLUE YELLOW = RED | GREEN CLEAR = 0x00 )
View Source
const ( DEG = 180.0 / math.Pi RAD = math.Pi / 180.0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BruteForceMinDistanceFinder ¶
type BruteForceMinDistanceFinder struct {
Step float64
}
type ClockDirection ¶
type ClockDirection int
const ( CW ClockDirection = 1 CCW ClockDirection = 0 )
func (ClockDirection) String ¶
func (c ClockDirection) String() string
type Config ¶
type Config struct {
Seed uint
Size float64
DistanceField float64
Scale float64
DebugArtifactDir string
DistanceFinder MinDistanceFinder
EdgeColorizer EdgeColorizer
// contains filtered or unexported fields
}
type Contour ¶
type Contour struct {
Symbol rune
Edges []*Edge
Winding ClockDirection
}
func (*Contour) Ensure3Edges ¶
func (c *Contour) Ensure3Edges()
type CubicBezier ¶
type CubicBezier struct {
P0, P1, P2, P3 fixed.Point26_6
// contains filtered or unexported fields
}
func (*CubicBezier) CurvatureAt ¶
func (cb *CubicBezier) CurvatureAt(t float64) Point
func (CubicBezier) GetDirectionVector ¶
func (c CubicBezier) GetDirectionVector() *Vector
func (CubicBezier) GetLowResPoints ¶
func (*CubicBezier) GetSignedArea ¶
func (c *CubicBezier) GetSignedArea() float64
func (*CubicBezier) IsConnected ¶
func (*CubicBezier) PointAt ¶
func (cb *CubicBezier) PointAt(t float64) Point
func (*CubicBezier) Split ¶
func (cb *CubicBezier) Split() (Curve, Curve)
func (CubicBezier) String ¶
func (cb CubicBezier) String() string
func (*CubicBezier) TangentAt ¶
func (cb *CubicBezier) TangentAt(t float64) Point
type CurveSampler ¶
type Edge ¶
type EdgeColorPalette ¶
type EdgeColorPalette struct {
// contains filtered or unexported fields
}
func (*EdgeColorPalette) Init ¶
func (cp *EdgeColorPalette) Init() EdgeColor
func (*EdgeColorPalette) Shuffle ¶
func (cp *EdgeColorPalette) Shuffle(color *EdgeColor)
func (*EdgeColorPalette) ShuffleEx ¶
func (cp *EdgeColorPalette) ShuffleEx(color *EdgeColor, banned EdgeColor)
type EdgeColorizer ¶
type EdgeColorizer interface {
Colorize(contours []*Contour, palette *EdgeColorPalette)
}
type Glyph ¶
type Glyph struct {
Canvas *Canvas
Options *GlyphOptions
}
type GlyphOptions ¶
type Line ¶
func (*Line) CurvatureAt ¶
func (Line) GetDirectionVector ¶
func (c Line) GetDirectionVector() *Vector
func (Line) GetLowResPoints ¶
func (*Line) GetSignedArea ¶
func (c *Line) GetSignedArea() float64
func (*Line) IsConnected ¶
type Metadata ¶
type Metadata struct {
Atlas MetadataAtlas `json:"atlas"`
Metrics MetadataMetrics `json:"metrics"`
Glyphs []GlyphOptions `json:"glyphs"`
}
type MetadataAtlas ¶
type MetadataMetrics ¶
type Metrics ¶
type Metrics struct {
// contains filtered or unexported fields
}
func (*Metrics) GetAdvance ¶
func (*Metrics) GetPlaneBounds ¶
func (e *Metrics) GetPlaneBounds() fixed.Rectangle26_6
type MinDistanceFinder ¶
type Msdf ¶
type Msdf struct {
// contains filtered or unexported fields
}
func (*Msdf) CreateAtlas ¶
type QuadraticBezier ¶
type QuadraticBezier struct {
P0, P1, P2 fixed.Point26_6
// contains filtered or unexported fields
}
func (*QuadraticBezier) CurvatureAt ¶
func (qb *QuadraticBezier) CurvatureAt(t float64) Point
func (QuadraticBezier) GetDirectionVector ¶
func (c QuadraticBezier) GetDirectionVector() *Vector
func (QuadraticBezier) GetLowResPoints ¶
func (*QuadraticBezier) GetSignedArea ¶
func (c *QuadraticBezier) GetSignedArea() float64
func (*QuadraticBezier) IsConnected ¶
func (*QuadraticBezier) PointAt ¶
func (qb *QuadraticBezier) PointAt(t float64) Point
func (*QuadraticBezier) Split ¶
func (qb *QuadraticBezier) Split() (Curve, Curve)
func (QuadraticBezier) String ¶
func (qb QuadraticBezier) String() string
func (*QuadraticBezier) TangentAt ¶
func (qb *QuadraticBezier) TangentAt(t float64) Point
type SimpleEdgeColorizer ¶
type SimpleEdgeColorizer struct{}
func (SimpleEdgeColorizer) Colorize ¶
func (sc SimpleEdgeColorizer) Colorize(contours []*Contour, palette *EdgeColorPalette)
type SubvisionMinDistanceFinder ¶
Click to show internal directories.
Click to hide internal directories.