Documentation
¶
Index ¶
- func DefaultConfigPath() (string, error)
- type AnimationFrame
- type Client
- type Config
- type Device
- type Model
- type Renderer
- func (r *Renderer) CalculateVerticalPadding(contentHeight int) int
- func (r *Renderer) DecodeAnimation(data []byte) ([]AnimationFrame, error)
- func (r *Renderer) RenderImage(img image.Image) string
- func (r *Renderer) RenderPlaceholder() string
- func (r *Renderer) RenderWebP(data []byte) (string, error)
- func (r *Renderer) UpdateSize(width, height int)
- type View
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultConfigPath ¶
DefaultConfigPath returns the default path to the config file.
Types ¶
type AnimationFrame ¶
AnimationFrame holds a rendered frame and its display duration
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages a WebSocket connection to a PixelGateway server.
func (*Client) Done ¶
func (c *Client) Done() <-chan struct{}
Done returns a channel that is closed when the connection is closed.
type Config ¶
type Config struct {
Devices []Device `json:"devices"`
// contains filtered or unexported fields
}
Config holds the list of configured devices and the path it was loaded from.
func LoadConfig ¶
LoadConfig reads the config file from the specified path. If path is empty, uses the default path (~/.pixelclient/config.json). Returns an empty config if the file doesn't exist.
func (*Config) AddDevice ¶
AddDevice adds a new device to the config. Returns an error if name or ID already exists, or if server is invalid.
func (*Config) FindDeviceByID ¶
FindDeviceByID returns the device with the given ID, or nil if not found.
func (*Config) FindDeviceByName ¶
FindDeviceByName returns the device with the given name, or nil if not found.
func (*Config) GetDefaultDevice ¶
GetDefaultDevice returns the device named "default", or nil if not found.
type Device ¶
type Device struct {
Name string `json:"name"`
ID string `json:"id"`
Server string `json:"server"`
}
Device represents a configured device entry.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the Bubbletea model for the application
type Renderer ¶
type Renderer struct {
// contains filtered or unexported fields
}
Renderer converts WebP images to terminal output with colored LED circles.
func NewRenderer ¶
NewRenderer creates a new Renderer with the given terminal dimensions.
func (*Renderer) CalculateVerticalPadding ¶
CalculateVerticalPadding returns the number of blank lines needed above the image to vertically center it in the terminal.
func (*Renderer) DecodeAnimation ¶
func (r *Renderer) DecodeAnimation(data []byte) ([]AnimationFrame, error)
DecodeAnimation decodes a WebP and returns all animation frames with timing.
func (*Renderer) RenderImage ¶
RenderImage converts an image to a string with colored LED circles. Each pixel is rendered as two half-circle characters to approximate a square aspect ratio.
func (*Renderer) RenderPlaceholder ¶
RenderPlaceholder returns a placeholder grid when no image is available.
func (*Renderer) RenderWebP ¶
RenderWebP decodes a WebP image and returns a string with colored LED circles.
func (*Renderer) UpdateSize ¶
UpdateSize updates the terminal dimensions.