shadow

package module
v0.0.0-...-5d5882f Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

README

shadow

Using Skia from Go via WASM and wagu.

Building

Not needed unless you've changed something.

The generated Go is under the internal directory.

If you do want to rebuild, make sure that emscripten is installed.

Then do the following:

bash dload_deps.sh
cd _build
bash compile.sh

Sample

See cmd/sample/main.go. Nothing fancy there, but it's a start.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

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

func (*Canvas) Clear

func (c *Canvas) Clear(r, g, b, a uint8)

func (*Canvas) Concat

func (c *Canvas) Concat(m Matrix)

func (*Canvas) DrawPath

func (c *Canvas) DrawPath(path *Path, paint *Paint)

func (*Canvas) DrawRect

func (c *Canvas) DrawRect(x, y, w, h float32, paint *Paint)

func (*Canvas) Flush

func (c *Canvas) Flush()

func (*Canvas) Restore

func (c *Canvas) Restore()

func (*Canvas) Save

func (c *Canvas) Save()

func (*Canvas) Scale

func (c *Canvas) Scale(sx, sy float32)

func (*Canvas) SetMatrix

func (c *Canvas) SetMatrix(m Matrix)

func (*Canvas) TotalMatrix

func (c *Canvas) TotalMatrix() Matrix

func (*Canvas) Translate

func (c *Canvas) Translate(dx, dy float32)

type Context

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

func NewContext

func NewContext() *Context

func (*Context) Dispose

func (c *Context) Dispose() error

func (*Context) InverseMatrix

func (c *Context) InverseMatrix(m Matrix) (Matrix, bool)

func (*Context) NewPaint

func (c *Context) NewPaint() *Paint

func (*Context) NewPath

func (c *Context) NewPath() *Path

func (*Context) NewRGBAPremultipliedSurface

func (c *Context) NewRGBAPremultipliedSurface(width, height int) *Surface

func (*Context) NewRGBASurface

func (c *Context) NewRGBASurface(width, height int) *Surface

func (*Context) StackAllocPaint

func (c *Context) StackAllocPaint() (paint *Paint, dispose func())

func (*Context) StackAllocPath

func (c *Context) StackAllocPath() (path *Path, dispose func())

func (*Context) SurfaceIsBGRA

func (c *Context) SurfaceIsBGRA() bool

type Matrix

type Matrix struct {
	ScaleX float32
	SkewX  float32
	TransX float32
	SkewY  float32
	ScaleY float32
	TransY float32
}

func IdentityMatrix

func IdentityMatrix() Matrix

func (*Matrix) Reset

func (m *Matrix) Reset()

type Paint

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

func (*Paint) Alpha

func (p *Paint) Alpha() uint8

func (*Paint) Color

func (p *Paint) Color() uint32

func (*Paint) Dispose

func (p *Paint) Dispose()

func (*Paint) IsAntiAlias

func (p *Paint) IsAntiAlias() bool

func (*Paint) Reset

func (p *Paint) Reset()

func (*Paint) SetAlpha

func (p *Paint) SetAlpha(a uint8)

func (*Paint) SetAntiAlias

func (p *Paint) SetAntiAlias(aa bool)

func (*Paint) SetColor

func (p *Paint) SetColor(r, g, b, a uint8)

func (*Paint) SetStrokeCap

func (p *Paint) SetStrokeCap(c StrokeCap)

func (*Paint) SetStrokeJoin

func (p *Paint) SetStrokeJoin(j StrokeJoin)

func (*Paint) SetStrokeMiter

func (p *Paint) SetStrokeMiter(m float32)

func (*Paint) SetStrokeWidth

func (p *Paint) SetStrokeWidth(w float32)

func (*Paint) SetStyle

func (p *Paint) SetStyle(s PaintStyle)

func (*Paint) StrokeCap

func (p *Paint) StrokeCap() StrokeCap

func (*Paint) StrokeJoin

func (p *Paint) StrokeJoin() StrokeJoin

func (*Paint) StrokeMiter

func (p *Paint) StrokeMiter() float32

func (*Paint) StrokeWidth

func (p *Paint) StrokeWidth() float32

func (*Paint) Style

func (p *Paint) Style() PaintStyle

type PaintStyle

type PaintStyle uint8
const (
	PaintStyleFill PaintStyle = iota
	PaintStyleStroke
	PaintStyleStrokeAndFill
)

type Path

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

func (*Path) Bounds

func (p *Path) Bounds() Rect

func (*Path) Close

func (p *Path) Close()

func (*Path) ComputeTightBounds

func (p *Path) ComputeTightBounds() Rect

func (*Path) ConicTo

func (p *Path) ConicTo(x1, y1, x2, y2, weight float32)

func (*Path) CubicTo

func (p *Path) CubicTo(x1, y1, x2, y2, x3, y3 float32)

func (*Path) Dispose

func (p *Path) Dispose()

func (*Path) FillType

func (p *Path) FillType() PathFillType

func (*Path) LineTo

func (p *Path) LineTo(x, y float32)

func (*Path) MoveTo

func (p *Path) MoveTo(x, y float32)

func (*Path) NumPoints

func (p *Path) NumPoints() int

func (*Path) NumVerbs

func (p *Path) NumVerbs() int

func (*Path) Point

func (p *Path) Point(idx int) Point

func (*Path) Points

func (p *Path) Points(peek bool) []Point

func (*Path) QuadTo

func (p *Path) QuadTo(x1, y1, x2, y2 float32)

func (*Path) Reset

func (p *Path) Reset()

func (*Path) Rewind

func (p *Path) Rewind()

func (*Path) SetFillType

func (p *Path) SetFillType(ft PathFillType)

func (*Path) Verbs

func (p *Path) Verbs(peek bool) []PathVerb

type PathFillType

type PathFillType uint8
const (
	PathFillTypeWinding PathFillType = iota
	PathFillTypeEvenOdd
)

type PathVerb

type PathVerb uint8
const (
	PathVerbMove PathVerb = iota
	PathVerbLine
	PathVerbQuad
	PathVerbConic
	PathVerbCubic
	PathVerbClose
	PathVerbDone
)

type Point

type Point struct {
	X, Y float32
}

type Rect

type Rect struct {
	Left, Top, Right, Bottom float32
}

type StrokeCap

type StrokeCap uint8
const (
	StrokeCapButt StrokeCap = iota
	StrokeCapRound
	StrokeCapSquare
)

type StrokeJoin

type StrokeJoin uint8
const (
	StrokeJoinMiter StrokeJoin = iota
	StrokeJoinRound
	StrokeJoinBevel
)

type Surface

type Surface struct {
	Canvas *Canvas
	// contains filtered or unexported fields
}

func (*Surface) Data

func (s *Surface) Data(peek bool) []uint8

func (*Surface) Dispose

func (s *Surface) Dispose()

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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