morphing

package
v0.0.0-...-bbf78bc Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BowyerWatson

func BowyerWatson(mesh *Mesh, points []Vertex)

func Morph

func Morph(src, dst image.Image, srcPoints, dstPoints []Vertex, numSteps int) []image.Image

Morph applies a cross disolve on the given images, based on the given slices of points along the given number of steps

Types

type Circle

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

type CollisionTriangle

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

type Edge

type Edge struct {
	Start, End Vertex
}

func (*Edge) Equal

func (e *Edge) Equal(oe Edge) bool

type Mesh

type Mesh struct {
	Triangles []Triangle
}

func NewMesh

func NewMesh() *Mesh

func NewMeshForImage

func NewMeshForImage(texture image.Image) *Mesh

func (*Mesh) Edges

func (m *Mesh) Edges() ([]Edge, map[Edge][]Triangle)

func (*Mesh) Vertexes

func (m *Mesh) Vertexes() ([]Vertex, map[Vertex][]Triangle)

type MeshDeformation

type MeshDeformation struct {
	PrimitiveMapping map[Triangle]Triangle
	// contains filtered or unexported fields
}

func NewMeshDeformation

func NewMeshDeformation(mesh *Mesh, vertexMapping map[Vertex]Vertex, t float64) *MeshDeformation

func (*MeshDeformation) Deform

func (def *MeshDeformation) Deform(img image.Image) image.Image

type Triangle

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

func NewTriangle

func NewTriangle(p0, p1, p2 Vertex) *Triangle

func (*Triangle) Edges

func (t *Triangle) Edges() [3]Edge

func (*Triangle) HasVertex

func (t *Triangle) HasVertex(v Vertex) bool

func (*Triangle) IsEdge

func (t *Triangle) IsEdge(e Edge) bool

func (*Triangle) IsVertex

func (t *Triangle) IsVertex(p Vertex) bool

type Vertex

type Vertex struct {
	X, Y float64
}

func Vx

func Vx(X, Y float64) Vertex

func (Vertex) Dist

func (p Vertex) Dist(q Vertex) float64

func (Vertex) DistSq

func (p Vertex) DistSq(q Vertex) float64

func (Vertex) Equal

func (p Vertex) Equal(q Vertex) bool

Jump to

Keyboard shortcuts

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