effect

package
v0.0.0-...-a545287 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter struct {
	canvas.Canvas
	// contains filtered or unexported fields
}

Adapter is a Canvas wrapper to replace pixels with Effect implementation

func NewAdapter

func NewAdapter(canvas canvas.Canvas, effect Effect) *Adapter

func (Adapter) Set

func (a Adapter) Set(x, y int, ledColor color.Color)

type ColorFaderEffect

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

func NewColorFaderMask

func NewColorFaderMask() *ColorFaderEffect

func (*ColorFaderEffect) AdaptPixel

func (m *ColorFaderEffect) AdaptPixel() func(canvas Canvas, x int, y int, color color.Color)

func (*ColorFaderEffect) SetFade

func (m *ColorFaderEffect) SetFade(fade float64)

type DynamicEffect

type DynamicEffect interface {
	Effect
	Update(elapsedBetweenUpdate time.Duration) bool
}

type Effect

type Effect interface {
	AdaptPixel() func(canvas canvas.Canvas, x int, y int, color color.Color)
}

type FadeInOutDynamicEffect

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

func NewFadeInOutSceneEffect

func NewFadeInOutSceneEffect(sceneDuration time.Duration) *FadeInOutDynamicEffect

func (*FadeInOutDynamicEffect) AdaptPixel

func (e *FadeInOutDynamicEffect) AdaptPixel() func(canvas canvas.Canvas, x int, y int, color color.Color)

func (*FadeInOutDynamicEffect) Update

func (e *FadeInOutDynamicEffect) Update(elapsedBetweenUpdate time.Duration) bool

type ShadedColorMask

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

ShadedColorMask is used in clock.go to color the hours and minutes

func NewShadedColorMask

func NewShadedColorMask(bounds image.Rectangle) *ShadedColorMask

func (*ShadedColorMask) AdaptPixel

func (m *ShadedColorMask) AdaptPixel() func(canvas Canvas, x int, y int, color color.Color)

type VisibleMask

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

func NewVisibleMask

func NewVisibleMask(visibleArea image.Rectangle) *VisibleMask

func (*VisibleMask) AdaptPixel

func (c *VisibleMask) AdaptPixel() func(canvas Canvas, x int, y int, color color.Color)

func (*VisibleMask) GetOffset

func (c *VisibleMask) GetOffset() image.Point

func (*VisibleMask) SetOffset

func (c *VisibleMask) SetOffset(offset image.Point)

Jump to

Keyboard shortcuts

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