generators

package
v0.0.0-...-bb68497 Latest Latest
Warning

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

Go to latest
Published: May 25, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BiSymetry = map[string]int{
	"horizontal": 0,
	"vertical":   1,
	"diagonal":   2,
}

BiSymetry contains possible symetries for BiSymetric generators

View Source
var Colors = map[string]color.RGBA64{
	"empty": color.RGBA64{0x0000, 0x0000, 0x0000, 0x0000},
	"white": color.RGBA64{0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF},
	"black": color.RGBA64{0x0000, 0x0000, 0x0000, 0xFFFF},
}

Colors is a list of basic colors

View Source
var ColorsPacks = map[string][]color.RGBA64{
	"trisummer": []color.RGBA64{
		color.RGBA64{0xF400, 0x4300, 0x3600, 0xFFFF},
		color.RGBA64{0xFF00, 0xC100, 0x0700, 0xFFFF},
		color.RGBA64{0xEF00, 0x6C00, 0x0000, 0xFFFF},
	},
	"green": []color.RGBA64{
		color.RGBA64{0x4C00, 0xAF00, 0x5000, 0xFFFF},
		color.RGBA64{0x3300, 0x6900, 0x1E00, 0xFFFF},
		color.RGBA64{0x9C00, 0xCC00, 0x6500, 0xFFFF},
		color.RGBA64{0x0000, 0x8900, 0x7B00, 0xFFFF},
	},
	"space": []color.RGBA64{
		color.RGBA64{0x0500, 0x3700, 0x7b00, 0xFFFF},
		color.RGBA64{0x0400, 0x2c00, 0x6200, 0xFFFF},
		color.RGBA64{0x0300, 0x2100, 0x4a00, 0xFFFF},
		color.RGBA64{0x0200, 0x1600, 0x3100, 0xFFFF},
		color.RGBA64{0x0100, 0x0B00, 0x1900, 0xFFFF},
	},
	"rainbow": []color.RGBA64{
		color.RGBA64{0xF400, 0x4300, 0x3600, 0xFFFF},
		color.RGBA64{0xFF00, 0x9800, 0x0000, 0xFFFF},
		color.RGBA64{0xFF00, 0xEB00, 0x3B00, 0xFFFF},
		color.RGBA64{0x4C00, 0xAF00, 0x5000, 0xFFFF},
		color.RGBA64{0x2100, 0x9600, 0xF300, 0xFFFF},
		color.RGBA64{0x3F00, 0x5100, 0xB500, 0xFFFF},
		color.RGBA64{0x9C00, 0x2700, 0xB000, 0xFFFF},
	},
	"beach": []color.RGBA64{
		color.RGBA64{0x2100, 0x9600, 0xF300, 0xFFFF},
		color.RGBA64{0xFF00, 0xC100, 0x0700, 0xFFFF},
	},
	"synthwave": []color.RGBA64{
		color.RGBA64{0x9200, 0x0000, 0x7500, 0xFFFF},
		color.RGBA64{0xFF00, 0x6C00, 0x1100, 0xFFFF},
		color.RGBA64{0x0D00, 0x0200, 0x2100, 0xFFFF},
	},
	"grey": []color.RGBA64{
		Colors["white"],
		Colors["black"],
	},
}

ColorsPacks are group of colors

Functions

func AddToDegressiveLine

func AddToDegressiveLine(img *image.RGBA64, x0, y0, x1, y1 int, c color.RGBA64)

AddToDegressiveLine draws line by Bresenham's algorithm.

func AddToLine

func AddToLine(img *image.RGBA64, x0, y0, x1, y1 int, c color.RGBA64)

AddToLine draws line by Bresenham's algorithm.

func AddToSandLine

func AddToSandLine(img *image.RGBA64, p0, p1 Point, c color.RGBA64, sandCoef int)

AddToSandLine draws line by Bresenham's algorithm.

func AddToSandSpiralLine

func AddToSandSpiralLine(img *image.RGBA64, p0, p1 Point, c color.RGBA64, sandCoef int)

AddToSandSpiralLine draws line by Bresenham's algorithm.

func AddToSandTunnelLine

func AddToSandTunnelLine(img *image.RGBA64, p0, p1 Point, c color.RGBA64, sandCoef int)

AddToSandTunnelLine draws line by Bresenham's algorithm.

func AddToWuLine

func AddToWuLine(img *image.RGBA64, x1, y1, x2, y2 float64, w int, col color.RGBA64)

AddToWuLine draws line with Xialang Wu algorithm

func AutomoveLines

func AutomoveLines(coef int, nbLines int, c color.RGBA64)

AutomoveLines draws a diamond grid

func BasicDiagonalLine

func BasicDiagonalLine()

BasicDiagonalLine draws an image with diagonal lines

func BasicDiamondGrid

func BasicDiamondGrid()

BasicDiamondGrid draws a diamond grid

func BasicPointPerPoint

func BasicPointPerPoint()

BasicPointPerPoint draws an random image point per point

func BasicRoundLine

func BasicRoundLine()

BasicRoundLine draws an image with a round line

func BiSymDiagonalLine

func BiSymDiagonalLine()

BiSymDiagonalLine draws an image with diagonal lines, with a simple symetry

func BiSymInversedSurroundedDiagonalLine

func BiSymInversedSurroundedDiagonalLine()

BiSymInversedSurroundedDiagonalLine draws an image with diagonal lines and bi symetry

func BiSymSurroundedDiagonalLine

func BiSymSurroundedDiagonalLine(coef int, colors []color.RGBA64, symetryType int)

BiSymSurroundedDiagonalLine draws an image with diagonal lines and bi symetry

func DiamondBigger

func DiamondBigger(img *image.RGBA64, cx, cy, size int, c color.RGBA64)

DiamondBigger draw a diamond around a center, with a bigger size than normal

func DrawPoint

func DrawPoint(img *image.RGBA64, cx, cy int, c color.RGBA64)

DrawPoint just draws a point of a color

func DrawSandCurve

func DrawSandCurve(img *image.RGBA64, points []Point, c color.RGBA64, sandCoef int)

DrawSandCurve draw a diamond around a center, with a bigger size than normal

func DrawSandSpiralCurve

func DrawSandSpiralCurve(img *image.RGBA64, points []Point, c color.RGBA64, sandCoef int)

DrawSandSpiralCurve draw a diamond around a center, with a bigger size than normal

func DrawSandTunnelCurve

func DrawSandTunnelCurve(img *image.RGBA64, points []Point, c color.RGBA64, sandCoef int)

DrawSandTunnelCurve draw a diamond around a center, with a bigger size than normal

func ImageOpacity

func ImageOpacity(img *image.RGBA64, c color.RGBA64)

ImageOpacity change opacity of drawn pixels

func InversedSurroundedDiagonalLine

func InversedSurroundedDiagonalLine()

InversedSurroundedDiagonalLine draws an image with diagonal lines

func Line

func Line(img *image.RGBA64, x0, y0, x1, y1 int, c color.RGBA64)

Line draws line by Bresenham's algorithm.

func QuadSymDiagonalLine

func QuadSymDiagonalLine()

QuadSymDiagonalLine draws an image with diagonal lines with quad symetry

func QuadSymInversedSurroundedDiagonalLine

func QuadSymInversedSurroundedDiagonalLine()

QuadSymInversedSurroundedDiagonalLine draws an image with diagonal lines and quad symetry

func QuadSymSurroundedDiagonalLine

func QuadSymSurroundedDiagonalLine(coef int, colors []color.RGBA64)

QuadSymSurroundedDiagonalLine draws an image with diagonal lines and quad symetry

func Round

func Round(img *image.RGBA64, x0, y0, x1, y1 int, c color.RGBA64)

Round do a round

func SetBaseColor

func SetBaseColor(color color.RGBA64)

SetBaseColor sets the base color of image

func SetCycles

func SetCycles(nb int)

SetCycles sets number of cycles of the generator to do

func SetDrawer

func SetDrawer(f func(*image.RGBA64))

SetDrawer sets drawing function

func SetImage

func SetImage(i *image.RGBA64)

SetImage sets the target image

func SetNumberSeed

func SetNumberSeed(s int)

SetNumberSeed sets the seed for number generator

func SetParam1

func SetParam1(p int)

SetParam1 sets the first parameter for generator

func SetParam2

func SetParam2(p int)

SetParam2 sets the second parameter for generator

func SetParam3

func SetParam3(p int)

SetParam3 sets the third parameter for generator

func SetParamColors

func SetParamColors(c []color.RGBA64)

SetParamColors sets the colors parameter for generator

func Spiral

func Spiral()

Spiral draws a turning shape

func Subdivision

func Subdivision(coef int, colors []color.RGBA64)

Subdivision divide the image

func SurroundedDiagonalLine

func SurroundedDiagonalLine(coef int, colors []color.RGBA64)

SurroundedDiagonalLine draws an image with diagonal lines

func Tunnel

func Tunnel()

Tunnel draws a turning shape

func TurningHazardousShape

func TurningHazardousShape()

TurningHazardousShape draws a turning shape

Types

type CartesianPoint

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

CartesianPoint is a cartesian representation of point

type Point

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

Point is a mathematical point

type PolarPoint

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

PolarPoint is an polar representation of point

Jump to

Keyboard shortcuts

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