libkate 0.4.3
Functions
Tracker

Functions

int kate_tracker_init (kate_tracker *kin, const kate_info *ki, kate_const kate_event *ev)
 
int kate_tracker_clear (kate_tracker *kin)
 
int kate_tracker_morph_styles (kate_style *style, kate_float t, const kate_style *from, const kate_style *to)
 
int kate_tracker_remap (const kate_tracker *kin, kate_motion_mapping x_mapping, kate_motion_mapping y_mapping, kate_float *x, kate_float *y)
 
int kate_tracker_update_property_at_duration (const kate_tracker *kin, kate_float duration, kate_float t, kate_motion_semantics semantics, kate_float *x, kate_float *y)
 
int kate_tracker_update (kate_tracker *kin, kate_float t, int window_w, int window_h, int frame_x, int frame_y, int frame_w, int frame_h)
 
int kate_tracker_get_text_path_position (kate_tracker *kin, size_t glyph, int *x, int *y)
 

Detailed Description

Function Documentation

◆ kate_tracker_clear()

int kate_tracker_clear ( kate_tracker kin)

Clears a tracker.

Parameters
kinthe tracker to clear, must have been initialized with kate_tracker_init
Returns
0 success
KATE_E_* error

References kate_tracker::event, KATE_E_INIT, and KATE_E_INVALID_PARAMETER.

◆ kate_tracker_get_text_path_position()

int kate_tracker_get_text_path_position ( kate_tracker kin,
size_t  glyph,
int *  x,
int *  y 
)

Finds the position of a particular glyph along a path.

Parameters
kinthe tracker to use
glyphthe index of the glyph to get the position of
xwill return the first coordinate of the position
ywill return the second coordinate of the position
Returns
0 success
KATE_E_* error

References kate_tracker::has, KATE_E_INVALID_PARAMETER, kate_motion_semantics_text_path, kate_tracker_update_property_at_duration(), kate_tracker::path, kate_tracker::path_end, and kate_tracker::path_start.

◆ kate_tracker_init()

int kate_tracker_init ( kate_tracker kin,
const kate_info ki,
kate_const kate_event ev 
)

Initializes a tracker with the given event. When done, it should be cleared using kate_tracker_clear.

Parameters
kinthe tracker to initialize
kithe kate_info structure for the stream
evthe event to track
Returns
0 success
KATE_E_INVALID_PARAMETER when kin, ki or ev is NULL.
KATE_E_OUT_OF_MEMORY when unable to allocate memory.

References kate_tracker::event, KATE_E_INVALID_PARAMETER, KATE_E_OUT_OF_MEMORY, kate_text_get_character(), kate_tracker::ki, kate_event::len0, kate_event::text, and kate_event::text_encoding.

◆ kate_tracker_morph_styles()

int kate_tracker_morph_styles ( kate_style style,
kate_float  t,
const kate_style from,
const kate_style to 
)

Morphs between two styles. t should be between 0 and 1

Parameters
stylethe style that will hold the morphed style
tthe amount of morping from the from style (eg, 0 yields from, 1 yields to)
fromthe style to morph from
tothe style to morph to
Returns
0 success
KATE_E_* error

References kate_style::font, and KATE_E_INVALID_PARAMETER.

Referenced by kate_tracker_update().

◆ kate_tracker_remap()

int kate_tracker_remap ( const kate_tracker kin,
kate_motion_mapping  x_mapping,
kate_motion_mapping  y_mapping,
kate_float *  x,
kate_float *  y 
)

◆ kate_tracker_update()

int kate_tracker_update ( kate_tracker kin,
kate_float  t,
int  window_w,
int  window_h,
int  frame_x,
int  frame_y,
int  frame_w,
int  frame_h 
)

Tracks changes in an event at the given time.

Parameters
kinthe tracker to update
tthe time (between 0 and the duration of the motion) to update to
window_wthe width of the window
window_hthe height of the window
frame_xthe horizontal offset of the video frame within the window
frame_ythe vertical offset of the video frame within the window
frame_wthe width of the video frame
frame_hthe height of the video frame
Returns
0 success
KATE_E_* error

References kate_style::background_color, kate_tracker::background_color, kate_tracker::bitmap_pos, kate_tracker::bitmap_size, kate_tracker::bitmap_size_x, kate_tracker::bitmap_size_y, kate_tracker::bitmap_x, kate_tracker::bitmap_y, kate_style::bottom_margin, kate_tracker::bottom_margin, kate_tracker::draw, kate_style::draw_color, kate_tracker::draw_color, kate_tracker::draw_width, kate_tracker::draw_x, kate_tracker::draw_y, kate_event::end_time, kate_tracker::event, kate_tracker::frame_h, kate_tracker::frame_w, kate_tracker::frame_x, kate_tracker::frame_y, kate_tracker::glyph_height, kate_tracker::glyph_pointer, kate_tracker::glyph_pointer_bitmap, kate_region::h, kate_style::halign, kate_tracker::has, kate_tracker::hmargins, KATE_E_INIT, KATE_E_INVALID_PARAMETER, kate_millionths, kate_motion_get_point(), kate_motion_semantics_background_color_ba, kate_motion_semantics_background_color_rg, kate_motion_semantics_bitmap_position, kate_motion_semantics_bitmap_size, kate_motion_semantics_draw, kate_motion_semantics_draw_color_ba, kate_motion_semantics_draw_color_rg, kate_motion_semantics_draw_width, kate_motion_semantics_glyph_pointer_1, kate_motion_semantics_glyph_pointer_1_bitmap, kate_motion_semantics_horizontal_margins, kate_motion_semantics_marker1_bitmap, kate_motion_semantics_marker1_position, kate_motion_semantics_region_position, kate_motion_semantics_region_size, kate_motion_semantics_style_morph, kate_motion_semantics_text_alignment_ext, kate_motion_semantics_text_alignment_int, kate_motion_semantics_text_color_ba, kate_motion_semantics_text_color_rg, kate_motion_semantics_text_path, kate_motion_semantics_text_path_section, kate_motion_semantics_text_position, kate_motion_semantics_text_size, kate_motion_semantics_text_visible_section, kate_motion_semantics_time, kate_motion_semantics_vertical_margins, kate_motion_semantics_z, kate_percentage, kate_pixel, kate_tracker_morph_styles(), kate_tracker::ki, kate_style::left_margin, kate_tracker::left_margin, kate_tracker::marker_bitmap, kate_tracker::marker_pos, kate_tracker::marker_x, kate_tracker::marker_y, kate_region::metric, kate_event::nmotions, kate_tracker::path, kate_tracker::path_end, kate_tracker::path_start, kate_event::region, kate_tracker::region, kate_tracker::region_h, kate_tracker::region_w, kate_tracker::region_x, kate_tracker::region_y, kate_style::right_margin, kate_tracker::right_margin, kate_event::secondary_style, kate_event::start_time, kate_region::style, kate_event::style, kate_info::styles, kate_tracker::t, kate_tracker::text_alignment_ext, kate_tracker::text_alignment_int, kate_style::text_color, kate_tracker::text_color, kate_tracker::text_halign, kate_tracker::text_pos, kate_tracker::text_size, kate_tracker::text_size_x, kate_tracker::text_size_y, kate_tracker::text_valign, kate_tracker::text_x, kate_tracker::text_y, kate_style::top_margin, kate_tracker::top_margin, kate_style::valign, kate_tracker::visible_section, kate_tracker::visible_x, kate_tracker::visible_y, kate_tracker::vmargins, kate_region::w, kate_tracker::window_h, kate_tracker::window_w, kate_region::x, kate_region::y, and kate_tracker::z.

◆ kate_tracker_update_property_at_duration()

int kate_tracker_update_property_at_duration ( const kate_tracker kin,
kate_float  duration,
kate_float  t,
kate_motion_semantics  semantics,
kate_float *  x,
kate_float *  y 
)

Returns the value of a particular property at the given time

Parameters
kinthe tracker to update the property for
durationthe duration of the event the motion belongs to
tthe time, between 0 and duration, at which to compute the point
semanticsthe semantics of the motion to use
xa pointer to the x coordinate
ya pointer to the y coordinate
Returns
0 success
1 success, and there is no such motion at this time
KATE_E_* error

References KATE_E_INVALID_PARAMETER, kate_motion_get_point(), kate_tracker_remap(), kate_motion::x_mapping, and kate_motion::y_mapping.

Referenced by kate_tracker_get_text_path_position().