PixelKey
NeoPixel USB Key
Loading...
Searching...
No Matches
Blink Keyframe

Keyframe to blink between two colors. More...

Data Structures

struct  keyframe_blink_t
 Blink keyframe. More...
 

Macros

#define DUTY_CYCLE_DEFAULT   (50U)
 

Functions

static bool keyframe_blink_render_frame (keyframe_base_t *const p_keyframe, timestep_t time, color_rgb_t *p_color_out)
 
static void keyframe_blink_render_init (keyframe_base_t *const p_keyframe, framerate_t framerate, color_rgb_t current_color)
 
static keyframe_base_t * keyframe_blink_clone (keyframe_base_t const *const p_keyframe)
 
keyframe_base_t * keyframe_blink_parse (char *p_str)
 Parses a command string into a Blink Keyframe. More...
 
keyframe_base_t * keyframe_blink_ctor (keyframe_blink_t *p_blink)
 Initialize a Blink keyframe with the appropriate keyframe_base_t and state values. More...
 

Variables

static const keyframe_base_api_t keyframe_blink_api
 
static const keyframe_blink_t keyframe_blink_init
 

Detailed Description

Keyframe to blink between two colors.

Macro Definition Documentation

◆ DUTY_CYCLE_DEFAULT

#define DUTY_CYCLE_DEFAULT   (50U)

Default duty cycle if not specified.

Function Documentation

◆ keyframe_blink_ctor()

keyframe_base_t * keyframe_blink_ctor ( keyframe_blink_t p_blink)

Initialize a Blink keyframe with the appropriate keyframe_base_t and state values.

Parameters
[in]p_blinkPointer to the blink keyframe to construct, or NULL to allocate a new one.
Returns
Pointer to the keyframe base portion of the blink keyframe.

◆ keyframe_blink_parse()

keyframe_base_t * keyframe_blink_parse ( char *  p_str)

Parses a command string into a Blink Keyframe.

Parameters
[in]p_strPointer to the command string.
Returns
Pointer to the parsed keyframe or NULL on error.

◆ keyframe_blink_render_frame()

static bool keyframe_blink_render_frame ( keyframe_base_t *const  p_keyframe,
timestep_t  time,
color_rgb_t p_color_out 
)
static

Renders the frame. See keyframe_base_api_t::render_frame

◆ keyframe_blink_render_init()

static void keyframe_blink_render_init ( keyframe_base_t *const  p_keyframe,
framerate_t  framerate,
color_rgb_t  current_color 
)
static

Initialize the keyframe for rendering. See keyframe_base_api_t::render_init

Variable Documentation

◆ keyframe_blink_api

const keyframe_base_api_t keyframe_blink_api
static
Initial value:
=
{
.render_frame = keyframe_blink_render_frame,
.clone = keyframe_blink_clone,
}

Blink keyframe API function pointers.

◆ keyframe_blink_init

const keyframe_blink_t keyframe_blink_init
static
Initial value:
=
{
.base =
{
.p_api = &keyframe_blink_api,
.modifiers = { .repeat_count = -1 }
},
.args =
{
.color2_provided = false,
.color1_provided = false,
.duty_cycle = 50,
.period = 1,
}
}

Default values for blink keyframe structs.