Documentation ¶
Overview ¶
potty is a little pixel library and set of toilet effects for pixelslinger
Index ¶
- Constants
- Variables
- func Clamp(s float64) float64
- func ColorFromBytes(r, g, b byte) colorful.Color
- func FloatToByte(x byte) float64
- func MakeEffectFaderPattern(locations []float64) func(bytesIn chan []byte, bytesOut chan []byte, midiState *midi.MidiState)
- func MakeWaterPattern(locations []float64) func(bytesIn chan []byte, bytesOut chan []byte, midiState *midi.MidiState)
- func NextColorPicker() colorPicker
- func RandBlue() colorful.Color
- func RandGreen() colorful.Color
- func RandRed() colorful.Color
- func RandVal(low, high float64) float64
- type Bubble
- type BubbleEffect
- type Circle
- type ColorDanceEffect
- type FlushEffect
- type Pixel
- type PixelSpace
- func (b *PixelSpace) NormalDistance(p1, p2 *Pixel) float64
- func (b *PixelSpace) RandomPixel() *Pixel
- func (b *PixelSpace) SetFromBytes(bytes []byte)
- func (b *PixelSpace) ToBytes(bytes []byte) []byte
- func (b *PixelSpace) XFlatNormal(pixel *Pixel) float64
- func (b *PixelSpace) XNormal(pixel *Pixel) float64
- func (b *PixelSpace) ZNormal(pixel *Pixel) float64
- type Renderer
- type WaterEffect
Constants ¶
View Source
const ( CSpeed = 0.004 // How fast they go up CSpeedVar = 0.004 // Speed variation each time a circle starts over CLifeSpan = 0.75 CircleButton = config.BLINK_CIRCLE_PAD )
View Source
const ( DrainingComplete = 4.0 // seconds RefillStarting = 8.0 // seconds RefillComplete = 16.0 // seconds RefillDuration = RefillComplete - RefillStarting // seconds // Size of falling water streams when draining FlushStreamerSize = 0.15 FlushControlPad = config.FLUSH_PAD )
View Source
const BSpeed = 0.008 // How fast they go up
View Source
const BSpeedVar = 0.004 // Speed variation each time a bubble starts over
View Source
const BSpread = 9 // How spread out the buubbles are (aka few can you see)
Variables ¶
View Source
var ( White = colorful.LinearRgb(1, 1, 1) Black = colorful.LinearRgb(0, 0, 0) )
View Source
var ( LightCyan = colorful.LinearRgb(0.6, 0.7, 0.8) DarkCyan = colorful.LinearRgb(0.1, 0.4, 0.8) Aquamarine = colorful.LinearRgb(0.1, 0.25, 0.75) Teal = colorful.LinearRgb(0.4, 0.7, 0.55) )
View Source
var RandGen = rand.New(rand.NewSource(9))
make persistant random values
Functions ¶
func ColorFromBytes ¶
func FloatToByte ¶
func MakeEffectFaderPattern ¶
func MakeWaterPattern ¶
func NextColorPicker ¶
func NextColorPicker() colorPicker
Types ¶
type BubbleEffect ¶
type BubbleEffect struct {
// contains filtered or unexported fields
}
func NewBubbleEffect ¶
func NewBubbleEffect(space *PixelSpace) *BubbleEffect
type Circle ¶
type Circle struct { Pixel Speed float64 Strength float64 EndTime float64 Dead bool // contains filtered or unexported fields }
func NewCircle ¶
func NewCircle(space *PixelSpace, t float64) *Circle
type ColorDanceEffect ¶
type ColorDanceEffect struct {
// contains filtered or unexported fields
}
func NewColorDanceEffect ¶
func NewColorDanceEffect(space *PixelSpace) *ColorDanceEffect
type FlushEffect ¶
type FlushEffect struct {
// contains filtered or unexported fields
}
func NewFlushEffect ¶
func NewFlushEffect(space *PixelSpace) *FlushEffect
func (*FlushEffect) SetFlushState ¶
func (f *FlushEffect) SetFlushState(midiState *midi.MidiState, t float64)
type Pixel ¶
type PixelSpace ¶
type PixelSpace struct { Pixels []*Pixel // Pixels all in a row Strips [][]*Pixel // Same Pixels organized by strips Len int // Total number of pixels // Bounding Box MaxX float64 MaxY float64 MaxZ float64 MinX float64 MinY float64 MinZ float64 MaxXFlat float64 MinXFlat float64 }
func NewPixelSpace ¶
func NewPixelSpace(locations []float64) *PixelSpace
NewPixelSpace takes a slice of xyz coordinates and returns a slice of pixels in a bounding box.
func (*PixelSpace) NormalDistance ¶
func (b *PixelSpace) NormalDistance(p1, p2 *Pixel) float64
Distance between two pixels in [0,1] space
func (*PixelSpace) RandomPixel ¶
func (b *PixelSpace) RandomPixel() *Pixel
Z coord for pixel in [0,1] space
func (*PixelSpace) SetFromBytes ¶
func (b *PixelSpace) SetFromBytes(bytes []byte)
func (*PixelSpace) ToBytes ¶
func (b *PixelSpace) ToBytes(bytes []byte) []byte
ToBytes writes the Pixel to the output buffer
func (*PixelSpace) XFlatNormal ¶
func (b *PixelSpace) XFlatNormal(pixel *Pixel) float64
XFlat coord for pixel in [0,1] space
func (*PixelSpace) XNormal ¶
func (b *PixelSpace) XNormal(pixel *Pixel) float64
X coord for pixel in [0,1] space
func (*PixelSpace) ZNormal ¶
func (b *PixelSpace) ZNormal(pixel *Pixel) float64
Z coord for pixel in [0,1] space
type WaterEffect ¶
type WaterEffect struct {
// contains filtered or unexported fields
}
func NewWaterEffect ¶
func NewWaterEffect(space *PixelSpace) *WaterEffect
Click to show internal directories.
Click to hide internal directories.