RGBMatrix.Engine (rgb_matrix v0.1.0) View Source

Renders Animations and outputs colors to be displayed by anything that registers itself with register_paintable/2.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Sends interaction events to the engine. Animations may or may not respond to these interaction events.

Register a paint function for the engine to send frames to.

Sets the given animation as the currently active animation.

Start the engine.

Unregister a paint function so the engine no longer sends frames to it.

Link to this section Types

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

interact(led :: KeyboardLayout.LED.t()) :: :ok

Sends interaction events to the engine. Animations may or may not respond to these interaction events.

Link to this function

register_paintable(paint_fn)

View Source

Specs

register_paintable(paint_fn :: function()) :: {:ok, function(), frame()}

Register a paint function for the engine to send frames to.

This function is idempotent.

Link to this function

set_animation(animation)

View Source

Specs

set_animation(animation :: RGBMatrix.Animation.t()) :: :ok

Sets the given animation as the currently active animation.

Specs

start_link(any()) :: GenServer.on_start()

Start the engine.

This module registers its process globally and is expected to be started by a supervisor.

Link to this function

unregister_paintable(paint_fn)

View Source

Specs

unregister_paintable(paint_fn :: function()) :: :ok

Unregister a paint function so the engine no longer sends frames to it.

This function is idempotent.