pgrid

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const GridLinesTotal = uint8(5)
View Source
const MaxModifiedPoints = 32 * 1024
View Source
const OverflowOffset = 1024
View Source
const X = 0
View Source
const Y = 1

Variables

View Source
var AxisNames = [25]string{
	"A", "B", "C", "D", "E",
	"F", "G", "H", "I", "J",
	"K", "L", "M", "N", "O",
	"P", "Q", "R", "S", "T",
	"U", "V", "W", "X", "Y",
}

Functions

func ClearZeros added in v0.3.0

func ClearZeros()

func Get

func Get(axes GridAxes) uint8

func ResetValues

func ResetValues()

func Set

func Set(axes GridAxes, value uint8)

func Set0 added in v0.3.0

func Set0(axes GridAxes, value uint8)

func Uniq

func Uniq() (uniq uint64)

Types

type CommandType

type CommandType int
const (
	Reset CommandType = iota
)

type Field

type Field struct {
	Rules        []bool
	Limit        uint8
	InitialPoint string
	// contains filtered or unexported fields
}

func New

func New(r float64, rules []bool, initialPoint string) *Field

func (*Field) ControlledInfiniteStepper

func (f *Field) ControlledInfiniteStepper(modifiedImagesCh chan<- *image.RGBA, commandCh <-chan CommandType, palette []color.RGBA)

func (*Field) DryRunStepper added in v0.3.0

func (f *Field) DryRunStepper(maxSteps, minCleanStreak, maxNoisyDots uint64)

func (*Field) ModifiedImagesStepper

func (f *Field) ModifiedImagesStepper(modifiedImagesCh chan<- *image.RGBA, maxSteps int, palette []color.RGBA)

func (*Field) ModifiedPointsStepper

func (f *Field) ModifiedPointsStepper(
	modifiedImagesCh chan<- ModifiedImage,
	palette []color.RGBA,
	maxSteps, partialSteps, minCleanStreak, maxNoisyDots uint64,
)

func (*Field) Run

func (f *Field) Run(maxSteps uint64) iter.Seq2[GridPoint, uint8]

func (*Field) RunAxes added in v0.3.0

func (f *Field) RunAxes(maxSteps uint64) iter.Seq[GridAxes]

func (*Field) RunPoint added in v0.3.0

func (f *Field) RunPoint(maxSteps uint64) iter.Seq2[GridAxes, image.Point]

type GridAxes

type GridAxes struct {
	Axis0  uint8
	Axis1  uint8
	Coords GridCoords
}

func (*GridAxes) String added in v0.2.0

func (ga *GridAxes) String() string

type GridCoords added in v0.3.0

type GridCoords struct {
	Offset0 offsetInt
	Offset1 offsetInt
}

type GridLine

type GridLine struct {
	Axis   uint8
	Offset offsetInt
}

func (*GridLine) Print

func (gl *GridLine) Print()

func (*GridLine) String

func (gl *GridLine) String() string

type GridOffsets

type GridOffsets [GridLinesTotal]offsetInt

type GridPoint

type GridPoint struct {
	Axes    GridAxes
	Offsets GridOffsets
	Point   Point
}

func (*GridPoint) String

func (gp *GridPoint) String() string

type Line

type Line [2]Point

type ModifiedImage

type ModifiedImage struct {
	Img   *image.RGBA
	Steps uint64
	Save  bool
}

type Point

type Point [2]float64

Jump to

Keyboard shortcuts

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