gorey

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Black = color.Black
	White = color.White

	Red   = colorf.MustParseColor("#f00")
	Green = colorf.MustParseColor("#070")
	Blue  = colorf.MustParseColor("#00f")

	// Tp - transparent
	RedTp50 = colorf.MakeColorf(1, 0, 0, 0.5)
)
View Source
var DrawLevelArea = false

Functions

func BesierCubic

func BesierCubic(c *cairo.Canvas, p0, p1, p2, p3 geom.Point2f)

func BesierQuad

func BesierQuad(c *cairo.Canvas, p0, p1, p2 geom.Point2f)

Quadratic Bézier

Types

type AspectRatio

type AspectRatio struct {
	X int
	Y int
}

func MakeAspectRatio

func MakeAspectRatio(x, y int) AspectRatio

func MustParseAspectRatio

func MustParseAspectRatio(s string) AspectRatio

func ParseAspectRatio

func ParseAspectRatio(s string) (AspectRatio, error)

func (AspectRatio) CalcDx

func (a AspectRatio) CalcDx(dy float64) (dx float64, ok bool)

func (AspectRatio) CalcDy

func (a AspectRatio) CalcDy(dx float64) (dy float64, ok bool)

func (AspectRatio) Normalize

func (a AspectRatio) Normalize() AspectRatio

func (AspectRatio) String

func (a AspectRatio) String() string

type Aspector

type Aspector struct {
	AspectRatio float64 // dy / dx

	Content Object
}

------------------------------------------------------------------------------ Factorer

func (Aspector) Draw

func (v Aspector) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Aspector) IsObject

func (Aspector) IsObject()

type Caret

type Caret struct {
	Content Object
}

rune: '^'

func (Caret) Draw

func (v Caret) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Caret) IsObject

func (Caret) IsObject()

type Circle

type Circle struct {
	Content Object
}

func (Circle) Draw

func (v Circle) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Circle) IsObject

func (Circle) IsObject()

type CurlyBrackets

type CurlyBrackets struct {
	Content Object
}

Curly brackets or braces

func (CurlyBrackets) Draw

func (v CurlyBrackets) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (CurlyBrackets) IsObject

func (CurlyBrackets) IsObject()

type DigitV1

type DigitV1 struct {
	Value int
}

func (DigitV1) Draw

func (d DigitV1) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (DigitV1) IsObject

func (DigitV1) IsObject()

type DigitV2

type DigitV2 struct {
	Value int
}

func (DigitV2) Draw

func (d DigitV2) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (DigitV2) IsObject

func (DigitV2) IsObject()

type DigitV3

type DigitV3 struct {
	Value int
}

func (DigitV3) Draw

func (d DigitV3) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (DigitV3) IsObject

func (DigitV3) IsObject()

type DigitV4

type DigitV4 struct {
	Value int
}

func (DigitV4) Draw

func (d DigitV4) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (DigitV4) IsObject

func (DigitV4) IsObject()

type Greed

type Greed struct {
	Cells [][]Object
}

func (Greed) Draw

func (v Greed) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Greed) IsObject

func (Greed) IsObject()

type HBox

type HBox struct {
	Objects []Object
}

func (HBox) Draw

func (v HBox) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (HBox) IsObject

func (HBox) IsObject()

type Heart

type Heart struct{}

func (Heart) Draw

func (v Heart) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Heart) IsObject

func (Heart) IsObject()

type HexagoneOrientation

type HexagoneOrientation int
const (
	Angled HexagoneOrientation = iota
	Flat
)

type ICanvas

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

func NewICanvas

func NewICanvas(c *cairo.Canvas, r geom.Rectangle2f, nx, ny int) *ICanvas

func (*ICanvas) BesierCubic

func (d *ICanvas) BesierCubic(ps [4]image.Point)

func (*ICanvas) BesierQuad

func (d *ICanvas) BesierQuad(ps [3]image.Point)

func (*ICanvas) Circle

func (d *ICanvas) Circle(x, y int, radius float64)

func (*ICanvas) LineTo

func (d *ICanvas) LineTo(xi, yi int)

func (*ICanvas) MoveTo

func (d *ICanvas) MoveTo(xi, yi int)

type Infinity

type Infinity struct{}

func (Infinity) Draw

func (v Infinity) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Infinity) IsObject

func (Infinity) IsObject()

type Invert

type Invert struct {
	Content Object
}

func (Invert) Draw

func (v Invert) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Invert) IsObject

func (Invert) IsObject()

type Object

type Object interface {
	IsObject()

	Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)
}

func Dig1

func Dig1(x int) Object

func ISO216

func ISO216(o Object) Object

------------------------------------------------------------------------------ Standard ISO216 (A0, A1, ... A4, ... A7)

func Square

func Square(o Object) Object

------------------------------------------------------------------------------

func SquareAspector

func SquareAspector(o Object) Object

------------------------------------------------------------------------------

func Triangle

func Triangle(object Object) Object

type Rectangle

type Rectangle struct {
	Content Object
}

func (Rectangle) Draw

func (v Rectangle) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Rectangle) IsObject

func (Rectangle) IsObject()

type RegularPolygon

type RegularPolygon struct {
	N       int
	Phase   float64 // [0..1]
	Content Object
}

func (RegularPolygon) Draw

func (v RegularPolygon) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (RegularPolygon) IsObject

func (RegularPolygon) IsObject()

type Rhombus

type Rhombus struct {
	Content Object
}

func (Rhombus) Draw

func (v Rhombus) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Rhombus) IsObject

func (Rhombus) IsObject()

type RoundRect

type RoundRect struct {
	Content Object
}

func (RoundRect) Draw

func (v RoundRect) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (RoundRect) IsObject

func (RoundRect) IsObject()

type Tilde

type Tilde struct {
	Content Object
}

func (Tilde) Draw

func (v Tilde) Draw(c *cairo.Canvas, r geom.Rectangle2f, level int)

func (Tilde) IsObject

func (Tilde) IsObject()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳