Documentation ¶
Overview ¶
Package models describs necessary models
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Canvas ¶
type Canvas struct { Length int // First dimension Width int // Second dimension Elements []*Element // Canvas data }
Canvas descrbes a patchwork that consists of samples and can be rendered. Here comes coordinates structure
X 0 1 2 | Y +-----------+---- 0 | 0 1 2 | ^ 1 | 3 4 5 | | LENGTH=4 2 | 6 7 8 | | 3 | 9 10 11 | V +-----------+--- |< WIDTH=3 >|
func (*Canvas) Compose ¶
Compose composes canvas elements out of samples based on particular composition logic
func (*Canvas) IndexForXY ¶
IndexForXY returns patch index by its coordinates. Opposite to GetXY
type Element ¶
type Element struct { Rotation int // 0-3 means multiplication per 90 degree clockwise Sample Sample }
Element describes a sample placed in a canvas
Click to show internal directories.
Click to hide internal directories.