sketch

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	Iterations         int
	Width              int
	Height             int
	PolygonSidesMin    int
	PolygonSidesMax    int
	PolygonFillChance  float64
	PolygonColorChance float64
	PolygonSizeRatio   float64
	PixelShake         float64
	Greyscale          bool
}

Params represents the configuration of a sketch.

type Sketch

type Sketch struct {
	Params
	// contains filtered or unexported fields
}

Sketch draws onto a destination image from a source image.

func NewSketch

func NewSketch(source image.Image, config Params) *Sketch

NewSketch returns a blank Sketch based on the source image.

func (*Sketch) Draw

func (s *Sketch) Draw()

Draw iterates over the source image, creating the destination image.

func (*Sketch) Image

func (s *Sketch) Image() image.Image

Image returns the destination image.

Jump to

Keyboard shortcuts

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