Documentation ¶
Index ¶
- func Arrow(ctx Ctx, pt d2.Pt, v d2.V)
- func BoxModel(ctx Ctx, model boxmodel.BoxModel)
- func Call(gen func() *Context, funcs ...func(*Context))
- func Color(r, g, b float64) color.Color
- func OnPt1(ctx Ctx, pt1 d2.Pt1, ts []float64, radius float64)
- func Pt1(ctx Ctx, pt1 d2.Pt1, r iter.FloatRange)
- func Pt2(ctx Ctx, pt2 d2.Pt2, r0, r1 iter.FloatRange)
- func V1(ctx Ctx, pt1 d2.Pt1, r iter.FloatRange, scale float64)
- type Context
- func (c *Context) Arrow(pt d2.Pt, v d2.V)
- func (c *Context) BoxModel(model boxmodel.BoxModel)
- func (c *Context) Circle(pt d2.Pt, radius float64)
- func (c *Context) LinePts(pts ...d2.Pt)
- func (c *Context) OnPt1(pt1 d2.Pt1, ts []float64, radius float64)
- func (c *Context) Pt1(pt1 d2.Pt1)
- func (c *Context) Pt2(pt2 d2.Pt2, r iter.FloatRange)
- func (c *Context) Pts(pts ...d2.Pt)
- func (c *Context) V1(pt1 d2.Pt1, r iter.FloatRange, scale float64)
- type ContextGenerator
- type Ctx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Call ¶
Call is a helper function that uses relection for generating images. It needs a Context generator. For each function passed in, a go routine starts that generates a context and passes into the function, then the image is saved with the name of the function.
Types ¶
type Context ¶
type Context struct { Ctx iter.FloatRange PointSize float64 }
Context passes in the Ctx and FloatRange to simplify calling the draw functions.
type ContextGenerator ¶
ContextGenerator is a helper for generating Contexts
func (*ContextGenerator) Generate ¶
func (g *ContextGenerator) Generate() *Context
Generate a Context of the defined size, set the background color and set the active color.
func (*ContextGenerator) GenerateForCtx ¶
func (g *ContextGenerator) GenerateForCtx(ctx *gg.Context) *Context
GenerateForCtx clears the gg.Context and uses it as Ctx in the returned Context.
func (*ContextGenerator) GenerateForImage ¶
func (g *ContextGenerator) GenerateForImage(img image.Image) *Context
GenerateForImage takes in an image and returns a Context. If img is nil, a call to Generate is returned.