45#define RGBX_ABI_VERSION 1u
48#define RGBX_MAX_PARAMS 16u
51#define RGBX_MAX_STRING_PARAMS 4u
55#define RGBX_PARAM_STRING_MAX 32u
59#define RGBX_AUDIO_NUM_BANDS 4u
62#define RGBX_AUDIO_NUM_DISPLAY_BUCKETS 20u
195#define RGBX_PARAM(name_, type_, default_u32_) \
196 {(name_), (type_), {.u32 = (default_u32_)}}
205#define RGBX_PARAM_STR(name_, default_str_) \
206 {(name_), RGBX_PARAM_STRING, {.str = (default_str_)}}
221#define RGBX_PARAM_F32(name_, default_f32_) \
222 {(name_), RGBX_PARAM_FLOAT, {.f32 = (default_f32_)}}
237#define RGBX_PIXEL_INDEX(w, x, y) ((((size_t)(y) * (size_t)(w)) + (size_t)(x)) * 3u)
277#define RGBX_SYM_MANIFEST "rgbx_manifest"
279#define RGBX_SYM_INPUTS "rgbx_inputs"
281#define RGBX_SYM_FRAMEBUFFER "rgbx_framebuffer"
283#define RGBX_SYM_INIT "rgbx_init"
285#define RGBX_SYM_TICK "rgbx_tick"
314#define RGBX_SYM_GOOD_MOMENT "rgbx_good_moment"
#define RGBX_MAX_PARAMS
Fixed capacity of the per-extension parameter block.
Definition rgbx_api.h:48
#define RGBX_MAX_STRING_PARAMS
Maximum number of RGBX_PARAM_STRING parameters per extension.
Definition rgbx_api.h:51
void rgbx_tick(void)
Called once per frame, on the sandboxed thread.
void rgbx_init(void)
Called once, on the sandboxed thread, after every (re)load and before the first tick.
uint8_t rgbx_good_moment
OPTIONAL.
#define RGBX_AUDIO_NUM_BANDS
Number of coarse audio bands (energy + beat flag each).
Definition rgbx_api.h:59
uint8_t rgbx_framebuffer[]
The scratch framebuffer the extension renders into, sized exactly width * height * 3 bytes (see RGBX_...
#define RGBX_AUDIO_NUM_DISPLAY_BUCKETS
Number of fine-grained audio display buckets (bar-graph style).
Definition rgbx_api.h:62
rgbx_param_type
Parameter types, mapped by the host onto the same BLE characteristic presentation formats (CPF) the b...
Definition rgbx_api.h:68
@ RGBX_PARAM_UINT32
plain unsigned integer (4-byte BLE value)
Definition rgbx_api.h:69
@ RGBX_PARAM_STRING
UTF-8 string, at most RGBX_PARAM_STRING_MAX-1 bytes (text field in the companion app)
Definition rgbx_api.h:74
@ RGBX_PARAM_FLOAT
IEEE-754 float32 (numeric field in the companion app).
Definition rgbx_api.h:76
@ RGBX_PARAM_COLOR
0x00RRGGBB, high byte ignored (color picker in the companion app)
Definition rgbx_api.h:70
@ RGBX_PARAM_BOOL
0 or 1 (toggle in the companion app; 1-byte BLE value)
Definition rgbx_api.h:72
#define RGBX_PARAM_STRING_MAX
Fixed storage size of one string parameter value, INCLUDING the NUL terminator (so the longest usable...
Definition rgbx_api.h:55
Extension self-description.
Definition rgbx_api.h:128
uint32_t width
framebuffer width the extension renders at; must match the host display (40 on proto0)
Definition rgbx_api.h:131
const struct rgbx_param_desc * params
NULL iff param_count == 0.
Definition rgbx_api.h:137
uint32_t param_count
entries in params, <= RGBX_MAX_PARAMS; at most RGBX_MAX_STRING_PARAMS of them may be RGBX_PARAM_STRIN...
Definition rgbx_api.h:134
const char * name
animation display name (BLE "Animation Name")
Definition rgbx_api.h:130
uint32_t abi_version
must be RGBX_ABI_VERSION
Definition rgbx_api.h:129
uint32_t height
framebuffer height (12 on proto0)
Definition rgbx_api.h:133
One user-tunable parameter, surfaced as a BLE characteristic named name on the extension's auto-gener...
Definition rgbx_api.h:111
const char * name
display name (CUD string); must be a string literal inside the extension image
Definition rgbx_api.h:112
union rgbx_param_default default_value
value before any BLE write arrives, keyed by type
Definition rgbx_api.h:119
enum rgbx_param_type type
value type.
Definition rgbx_api.h:115
Default value for one parameter; which member is read is keyed by the parameter's rgbx_param_type.
Definition rgbx_api.h:95
uint32_t u32
RGBX_PARAM_UINT32.
Definition rgbx_api.h:96
uint32_t boolean
RGBX_PARAM_BOOL, 0 or 1.
Definition rgbx_api.h:98
uint32_t color
RGBX_PARAM_COLOR, 0x00RRGGBB.
Definition rgbx_api.h:97
const char * str
RGBX_PARAM_STRING; must point at a NUL-terminated string literal inside the extension image,...
Definition rgbx_api.h:102
float f32
RGBX_PARAM_FLOAT (same 4-byte slot: sizeof(float) == sizeof(uint32_t) on both ABI targets,...
Definition rgbx_api.h:99