draw2dgl

package
v0.0.0-...-34cdf21 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2015 License: BSD-2-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package draw2dgl provides a graphic context that can draw vector graphics and text on OpenGL.

Index

Constants

View Source
const M16 uint32 = 1<<16 - 1

Variables

This section is empty.

Functions

This section is empty.

Types

type GraphicContext

type GraphicContext struct {
	*draw2dbase.StackGraphicContext
	// contains filtered or unexported fields
}

func NewGraphicContext

func NewGraphicContext(width, height int) *GraphicContext

NewGraphicContext creates a new Graphic context from an image.

func (*GraphicContext) Clear

func (gc *GraphicContext) Clear()

func (*GraphicContext) ClearRect

func (gc *GraphicContext) ClearRect(x1, y1, x2, y2 int)

func (*GraphicContext) CreateStringPath

func (gc *GraphicContext) CreateStringPath(s string, x, y float64) float64

func (*GraphicContext) DrawImage

func (gc *GraphicContext) DrawImage(img image.Image)

func (*GraphicContext) Fill

func (gc *GraphicContext) Fill(paths ...*draw2d.Path)

func (*GraphicContext) FillString

func (gc *GraphicContext) FillString(text string) (cursor float64)

func (*GraphicContext) FillStringAt

func (gc *GraphicContext) FillStringAt(text string, x, y float64) (cursor float64)

func (*GraphicContext) FillStroke

func (gc *GraphicContext) FillStroke(paths ...*draw2d.Path)

func (*GraphicContext) GetDPI

func (gc *GraphicContext) GetDPI() int

func (*GraphicContext) GetStringBounds

func (gc *GraphicContext) GetStringBounds(s string) (left, top, right, bottom float64)

func (*GraphicContext) SetDPI

func (gc *GraphicContext) SetDPI(dpi int)

func (*GraphicContext) Stroke

func (gc *GraphicContext) Stroke(paths ...*draw2d.Path)

func (*GraphicContext) StrokeString

func (gc *GraphicContext) StrokeString(text string) (cursor float64)

func (*GraphicContext) StrokeStringAt

func (gc *GraphicContext) StrokeStringAt(text string, x, y float64) (cursor float64)

type Painter

type Painter struct {
	// The Porter-Duff composition operator.
	Op draw.Op
	// contains filtered or unexported fields
}

func NewPainter

func NewPainter() *Painter

NewRGBAPainter creates a new RGBAPainter for the given image.

func (*Painter) Flush

func (p *Painter) Flush()

func (*Painter) Paint

func (p *Painter) Paint(ss []raster.Span, done bool)

Paint satisfies the Painter interface by painting ss onto an image.RGBA.

func (*Painter) SetColor

func (p *Painter) SetColor(c color.Color)

SetColor sets the color to paint the spans.

Jump to

Keyboard shortcuts

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