canvas

package module
v0.0.0-...-0fbd57b Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2013 License: GPL-2.0 Imports: 4 Imported by: 1

README

gocanvas

my simple canvas implementation with DrawLine and stuff. initial code and ideas from @felixpalmer.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Canvas

type Canvas struct {
	image.RGBA
}

func NewCanvas

func NewCanvas(r image.Rectangle) *Canvas

func (Canvas) Blur

func (c Canvas) Blur(radius int, weight WeightFunction)

effects

func (Canvas) BlurPixel

func (c Canvas) BlurPixel(x, y, radius int, weight WeightFunction) color.Color

func (Canvas) Clone

func (c Canvas) Clone() *Canvas

func (Canvas) DrawCircle

func (c Canvas) DrawCircle(color color.RGBA, center Vector, radius int)

func (Canvas) DrawGradient

func (c Canvas) DrawGradient()

func (Canvas) DrawLine

func (c Canvas) DrawLine(col color.RGBA, from, to Vector)

func (Canvas) DrawRect

func (c Canvas) DrawRect(col color.RGBA, from, to Vector)

func (Canvas) DrawSpiral

func (c Canvas) DrawSpiral(col color.RGBA, where Vector)

type Vector

type Vector struct {
	X, Y float64
}

func (*Vector) Add

func (v1 *Vector) Add(v2 *Vector) Vector

func (*Vector) Length

func (v *Vector) Length() float64

func (*Vector) Rotate

func (v *Vector) Rotate(angle float64)

func (*Vector) Scale

func (v *Vector) Scale(a float64)

func (*Vector) ScaleVector

func (v *Vector) ScaleVector(v2 *Vector)

func (Vector) String

func (v Vector) String() string

func (*Vector) Sub

func (v1 *Vector) Sub(v2 *Vector) Vector

type WeightFunction

type WeightFunction interface {
	Weight(x int, y int) float64
}

Jump to

Keyboard shortcuts

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