core

package
v0.0.0-...-211c12f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PixelLoopFx = &EffectKind{Code: 0, Name: "Pixel Loop", Description: "Loop a single pixel", AllowedParams: []*EffectParam{
		ForegroundFxParam, BackgroundFxParam, SpeedFxParam,
	}}
	RandomPixelLoopFx = &EffectKind{Code: 1, Name: "Random Pixel Loop", Description: "Loop a single pixel", AllowedParams: []*EffectParam{
		ForegroundFxParam, BackgroundFxParam, SpeedFxParam,
	}}
	ForegroundBackgroundLoopFx = &EffectKind{Code: 2, Name: "Foreground/Background Loop", Description: "Loop the foreground and the background", AllowedParams: []*EffectParam{
		ForegroundFxParam, BackgroundFxParam, SpeedFxParam,
	}}
	ForegroundBackgroundSwitchFx = &EffectKind{Code: 3, Name: "Foreground/Background Switch", Description: "Switch the foreground and the background", AllowedParams: []*EffectParam{
		ForegroundFxParam, BackgroundFxParam, SpeedFxParam,
	}}
	Fire2021Fx = &EffectKind{Code: 4, Name: "Fire 2021", Description: "Fire !!!", AllowedParams: []*EffectParam{
		SpeedFxParam, CrossfadeFxParam,
	}}
	Rainbow       = &EffectKind{Code: 5, Name: "Rainbow", Description: "Rainbow", AllowedParams: []*EffectParam{}}
	RainbowSpread = &EffectKind{Code: 6, Name: "Rainbow Spread", Description: "Rainbow Spread", AllowedParams: []*EffectParam{}}
)
View Source
var (
	ForegroundFxParam = &EffectParam{"fg", "The foreground color"}
	BackgroundFxParam = &EffectParam{"bg", "The background color"}
	SpeedFxParam      = &EffectParam{"speed", "The speed of the effect"}
	CrossfadeFxParam  = &EffectParam{"crossover", "The amount of crossover between effect cycles"}
)
View Source
var (
	ExternallySet     = &Mode{0, "External", false}
	DmxIn             = &Mode{1, "DMX in", false}
	DmxOut            = &Mode{2, "DMX out", false}
	DmxToPixelsWithIr = &Mode{3, "DMX > Pixels, IR enabled", true}
	DmxToPixels       = &Mode{4, "DMX > Pixels", false}
	RgbToPixelsWithIr = &Mode{5, "RGB > Pixels, IR enabled", true}
	RgbToPixels       = &Mode{6, "RGB > Pixels", false}
	FxToPixelsWithIr  = &Mode{7, "Fx > Pixels, IR enabled", true}
	FxToPixels        = &Mode{8, "Fx > Pixels", false}
	AutoFxWithIr      = &Mode{9, "Auto Fx, IR enabled", true}
	AutoFx            = &Mode{10, "Auto Fx", false}
	Emergency         = &Mode{11, "Emergency", false}
)

Functions

func MapInt

func MapInt(m map[string]interface{}, key string, defaultValue int) int

func MapString

func MapString(m map[string]interface{}, key string, defaultValue string) string

func ParseHexColor

func ParseHexColor(s string) (c color.RGBA, err error)

func ParseStringToUint8

func ParseStringToUint8(s string) (uint8, error)

Types

type Effect

type Effect struct {
	Kind       *EffectKind `json:"kind"`
	Speed      uint8       `json:"speed"`
	Crossfade  uint8       `json:"crossfade"`
	Foreground color.RGBA  `json:"foreground" swaggertype:"string"`
	Background color.RGBA  `json:"background" swaggertype:"string"`
}

func NewEffect

func NewEffect(kind *EffectKind, params map[string]string) (*Effect, error)

func (Effect) MarshalJSON

func (e Effect) MarshalJSON() ([]byte, error)

func (*Effect) ToBytes

func (e *Effect) ToBytes() []byte

func (*Effect) UnmarshalJSON

func (e *Effect) UnmarshalJSON(data []byte) error

type EffectKind

type EffectKind struct {
	Name          string         `json:"name"`
	Description   string         `json:"description"`
	Code          uint8          `json:"code"`
	AllowedParams []*EffectParam `json:"allowedParams"`
}

type EffectParam

type EffectParam struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Mode

type Mode struct {
	Code            int    `json:"code"`
	Name            string `json:"name"`
	InfraredEnabled bool   `json:"infraredEnabled"`
}

Jump to

Keyboard shortcuts

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