sdf

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyRGBA_Alpha

func ApplyRGBA_Alpha(m *image.RGBA, radius int)

ApplyRGBA_Alpha uses alpha channel to spread rgba radius

func Blend

func Blend(top, base color.RGBA, targetAlpha uint8) color.RGBA

func Compare

func Compare(field *Field, p *Point, x, y int, xoff, yoff int)

func Flood

func Flood(src *image.RGBA, radius int) *image.RGBA

Flood returns new image where colors have been flooded for radius

func FloodStep

func FloodStep(prev, next *image.RGBA)

func Process

func Process(field *Field)

Types

type Field

type Field struct {
	Width  int
	Height int
	Pix    []Point
}

func NewField

func NewField(w, h int) *Field

func (*Field) Get

func (field *Field) Get(x, y int) Point

func (*Field) Set

func (field *Field) Set(x, y int, p Point)

type Point

type Point struct{ Dx, Dy float64 }

func (Point) Distance2

func (p Point) Distance2() float64

func (Point) Offset

func (p Point) Offset(v float64) Point

Jump to

Keyboard shortcuts

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