Documentation ¶
Index ¶
- func NewText2Pixeldisplay(display Pixeldisplay) *text2pixeldisplay
- type BrightnessArgs
- type ColorArgs
- type EffectArgs
- type ImageArgs
- type OpConfig
- type OpPixelDisplay
- func (op *OpPixelDisplay) DrawImage(ctx *base.Context, input *base.OperatorIO, args ImageArgs) *base.OperatorIO
- func (op *OpPixelDisplay) DrawText(ctx *base.Context, input *base.OperatorIO, args TextArgs) *base.OperatorIO
- func (op *OpPixelDisplay) GetBackgroundColor(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) GetBrightness(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) GetColor(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) GetDefaultConfig() interface{}
- func (op *OpPixelDisplay) GetDimensions(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) GetMaxPictureSize(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)
- func (op *OpPixelDisplay) IsOn(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) SetBackgroundColor(ctx *base.Context, input *base.OperatorIO, args ColorArgs) *base.OperatorIO
- func (op *OpPixelDisplay) SetBrightness(ctx *base.Context, input *base.OperatorIO, args BrightnessArgs) *base.OperatorIO
- func (op *OpPixelDisplay) SetColor(ctx *base.Context, input *base.OperatorIO, args ColorArgs) *base.OperatorIO
- func (op *OpPixelDisplay) SetEffect(ctx *base.Context, input *base.OperatorIO, args EffectArgs) *base.OperatorIO
- func (op *OpPixelDisplay) Shutdown(ctx *base.Context)
- func (op *OpPixelDisplay) StartListening(ctx *base.Context)
- func (op *OpPixelDisplay) TurnOff(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- func (op *OpPixelDisplay) TurnOn(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
- type Pixeldisplay
- type TextArgs
- type WLEDMatrixDisplay
- func (d *WLEDMatrixDisplay) DrawImage(img image.Image, returnPNG bool) *base.OperatorIO
- func (d *WLEDMatrixDisplay) DrawPixel(x, y int, color color.Color) *base.OperatorIO
- func (d *WLEDMatrixDisplay) GetBackgroundColor() color.Color
- func (d *WLEDMatrixDisplay) GetBrightness() int
- func (d *WLEDMatrixDisplay) GetColor() color.Color
- func (d *WLEDMatrixDisplay) GetDimensions() image.Point
- func (d *WLEDMatrixDisplay) GetImage() *image.RGBA
- func (d *WLEDMatrixDisplay) GetMaxPictureSize() image.Point
- func (d *WLEDMatrixDisplay) IsOn() bool
- func (d *WLEDMatrixDisplay) SetBackgroundColor(color color.Color) *base.OperatorIO
- func (d *WLEDMatrixDisplay) SetBrightness(brightness int) *base.OperatorIO
- func (d *WLEDMatrixDisplay) SetColor(color color.Color) *base.OperatorIO
- func (d *WLEDMatrixDisplay) SetEffect(fx int) *base.OperatorIO
- func (d *WLEDMatrixDisplay) Shutdown()
- func (d *WLEDMatrixDisplay) TurnOff() *base.OperatorIO
- func (d *WLEDMatrixDisplay) TurnOn() *base.OperatorIO
- type WLEDMatrixDisplayConfig
- type WLEDRequest
- type WLEDResponse
- type WLEDSegmentConfig
- type WLEDSegmentHolder
- type WLEDSegmentReqeust
- type WLEDSegmentResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewText2Pixeldisplay ¶
func NewText2Pixeldisplay(display Pixeldisplay) *text2pixeldisplay
Types ¶
type BrightnessArgs ¶
type BrightnessArgs struct {
Brightness int
}
type EffectArgs ¶
type EffectArgs struct {
Fx int
}
EffectArgs is a struct to hold the effect to set
type OpConfig ¶
type OpConfig struct { Enabled bool `json:"enabled"` WLEDMatrixDisplay WLEDMatrixDisplayConfig `json:"wledMatrixDisplay"` }
OpConfig contains all parameters to initialize the available displays
type OpPixelDisplay ¶
type OpPixelDisplay struct {
// contains filtered or unexported fields
}
OpPixelDisplay implements base.FreepsOperatorWithShutdown, wraps all functions of the Pixeldisplay interface and calls them on the default display
func (*OpPixelDisplay) DrawImage ¶
func (op *OpPixelDisplay) DrawImage(ctx *base.Context, input *base.OperatorIO, args ImageArgs) *base.OperatorIO
func (*OpPixelDisplay) DrawText ¶
func (op *OpPixelDisplay) DrawText(ctx *base.Context, input *base.OperatorIO, args TextArgs) *base.OperatorIO
func (*OpPixelDisplay) GetBackgroundColor ¶
func (op *OpPixelDisplay) GetBackgroundColor(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) GetBrightness ¶
func (op *OpPixelDisplay) GetBrightness(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) GetColor ¶
func (op *OpPixelDisplay) GetColor(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) GetDefaultConfig ¶
func (op *OpPixelDisplay) GetDefaultConfig() interface{}
func (*OpPixelDisplay) GetDimensions ¶
func (op *OpPixelDisplay) GetDimensions(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) GetMaxPictureSize ¶
func (op *OpPixelDisplay) GetMaxPictureSize(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) InitCopyOfOperator ¶
func (op *OpPixelDisplay) InitCopyOfOperator(ctx *base.Context, config interface{}, name string) (base.FreepsOperatorWithConfig, error)
func (*OpPixelDisplay) IsOn ¶
func (op *OpPixelDisplay) IsOn(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) SetBackgroundColor ¶
func (op *OpPixelDisplay) SetBackgroundColor(ctx *base.Context, input *base.OperatorIO, args ColorArgs) *base.OperatorIO
func (*OpPixelDisplay) SetBrightness ¶
func (op *OpPixelDisplay) SetBrightness(ctx *base.Context, input *base.OperatorIO, args BrightnessArgs) *base.OperatorIO
func (*OpPixelDisplay) SetColor ¶
func (op *OpPixelDisplay) SetColor(ctx *base.Context, input *base.OperatorIO, args ColorArgs) *base.OperatorIO
func (*OpPixelDisplay) SetEffect ¶
func (op *OpPixelDisplay) SetEffect(ctx *base.Context, input *base.OperatorIO, args EffectArgs) *base.OperatorIO
SetEffect sets the effect
func (*OpPixelDisplay) Shutdown ¶
func (op *OpPixelDisplay) Shutdown(ctx *base.Context)
Shutdown shuts down the display
func (*OpPixelDisplay) StartListening ¶
func (op *OpPixelDisplay) StartListening(ctx *base.Context)
StartListening is a noop
func (*OpPixelDisplay) TurnOff ¶
func (op *OpPixelDisplay) TurnOff(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
func (*OpPixelDisplay) TurnOn ¶
func (op *OpPixelDisplay) TurnOn(ctx *base.Context, input *base.OperatorIO) *base.OperatorIO
type Pixeldisplay ¶
type Pixeldisplay interface { // TurnOn turns the display on TurnOn() *base.OperatorIO // TurnOff turns the display off TurnOff() *base.OperatorIO // SetColor sets the color of active pixels on the display SetColor(color color.Color) *base.OperatorIO // SetBackground sets the color of inactive pixels on the display SetBackgroundColor(color color.Color) *base.OperatorIO // SetBrightness sets the brightness of the display SetBrightness(brightness int) *base.OperatorIO // SetEffect sets a pre-defined effect on the display SetEffect(fx int) *base.OperatorIO // SetPicture sets the picture of the display DrawImage(image image.Image, returnPNG bool) *base.OperatorIO // DrawPixel sets a pixel of the display DrawPixel(x, y int, color color.Color) *base.OperatorIO // GetMaxPictureSize returns the maximum size of a picture that can be displayed GetMaxPictureSize() image.Point // GetDimensions returns the dimensions of the display GetDimensions() image.Point // GetColor returns the color set for active pixels on the display GetColor() color.Color // GetBackground returns the color set for inactive pixels on the display GetBackgroundColor() color.Color // GetBrightness returns the brightness of the display GetBrightness() int // GetImage returns the current image of the display GetImage() *image.RGBA // IsOn returns true if the display is on IsOn() bool Shutdown() }
Pixeldisplay is the interface for the pixel display, it provides functions to turn the display on and off, and to set the color, set a string of text, and set a RGB image.
type WLEDMatrixDisplay ¶
type WLEDMatrixDisplay struct {
// contains filtered or unexported fields
}
func NewWLEDMatrixDisplay ¶
func NewWLEDMatrixDisplay(cfg WLEDMatrixDisplayConfig) (*WLEDMatrixDisplay, error)
NewWLEDMatrixDisplay creates a connection to a WLED instance with multiple segments
func (*WLEDMatrixDisplay) DrawImage ¶
func (d *WLEDMatrixDisplay) DrawImage(img image.Image, returnPNG bool) *base.OperatorIO
func (*WLEDMatrixDisplay) DrawPixel ¶
func (d *WLEDMatrixDisplay) DrawPixel(x, y int, color color.Color) *base.OperatorIO
func (*WLEDMatrixDisplay) GetBackgroundColor ¶
func (d *WLEDMatrixDisplay) GetBackgroundColor() color.Color
func (*WLEDMatrixDisplay) GetBrightness ¶
func (d *WLEDMatrixDisplay) GetBrightness() int
func (*WLEDMatrixDisplay) GetColor ¶
func (d *WLEDMatrixDisplay) GetColor() color.Color
func (*WLEDMatrixDisplay) GetDimensions ¶
func (d *WLEDMatrixDisplay) GetDimensions() image.Point
func (*WLEDMatrixDisplay) GetImage ¶
func (d *WLEDMatrixDisplay) GetImage() *image.RGBA
func (*WLEDMatrixDisplay) GetMaxPictureSize ¶
func (d *WLEDMatrixDisplay) GetMaxPictureSize() image.Point
func (*WLEDMatrixDisplay) IsOn ¶
func (d *WLEDMatrixDisplay) IsOn() bool
func (*WLEDMatrixDisplay) SetBackgroundColor ¶
func (d *WLEDMatrixDisplay) SetBackgroundColor(color color.Color) *base.OperatorIO
func (*WLEDMatrixDisplay) SetBrightness ¶
func (d *WLEDMatrixDisplay) SetBrightness(brightness int) *base.OperatorIO
func (*WLEDMatrixDisplay) SetColor ¶
func (d *WLEDMatrixDisplay) SetColor(color color.Color) *base.OperatorIO
func (*WLEDMatrixDisplay) SetEffect ¶
func (d *WLEDMatrixDisplay) SetEffect(fx int) *base.OperatorIO
func (*WLEDMatrixDisplay) Shutdown ¶
func (d *WLEDMatrixDisplay) Shutdown()
func (*WLEDMatrixDisplay) TurnOff ¶
func (d *WLEDMatrixDisplay) TurnOff() *base.OperatorIO
func (*WLEDMatrixDisplay) TurnOn ¶
func (d *WLEDMatrixDisplay) TurnOn() *base.OperatorIO
type WLEDMatrixDisplayConfig ¶
type WLEDMatrixDisplayConfig struct { Segments []WLEDSegmentConfig Address string MinDisplayDuration time.Duration MaxPictureWidthFactor int }
type WLEDRequest ¶
type WLEDRequest struct {
Seg WLEDSegmentReqeust `json:"seg,omitempty"`
}
type WLEDResponse ¶
type WLEDResponse struct { Seg []WLEDSegmentResponse `json:"seg,omitempty"` On bool `json:"on"` Brightness int `json:"bri"` }
type WLEDSegmentConfig ¶
type WLEDSegmentHolder ¶
type WLEDSegmentHolder struct {
// contains filtered or unexported fields
}
func (*WLEDSegmentHolder) SendToWLEDSegment ¶
func (h *WLEDSegmentHolder) SendToWLEDSegment(address string, dst image.RGBA) *base.OperatorIO
type WLEDSegmentReqeust ¶
Click to show internal directories.
Click to hide internal directories.