|
Picasso API
2.9
|
Functions | |
| PEXPORT psx_result PICAPI | psx_svg_init (void) |
| Initialze the library and load resources. More... | |
| PEXPORT void PICAPI | psx_svg_shutdown (void) |
| Release resources and shutdown. More... | |
| PEXPORT psx_svg *PICAPI | psx_svg_load (const char *file_name, psx_result *err_code) |
| Create a new psx_svg object and load from file. More... | |
| PEXPORT psx_svg *PICAPI | psx_svg_load_from_memory (const ps_byte *data, size_t length, psx_result *err_code) |
| Create a new psx_svg object and load data from memory. More... | |
| PEXPORT void PICAPI | psx_svg_destroy (psx_svg *doc) |
| Destroy the psx_svg object and release resources. More... | |
| PEXPORT void PICAPI | psx_svg_render_destroy (psx_svg_render *render) |
| Destroy the psx_svg_render object and release resources. More... | |
| PEXPORT psx_result PICAPI | psx_svg_render_draw (ps_context *ctx, const psx_svg_render *render) |
| Draws an psx_svg_render object into the given context. More... | |
| PEXPORT psx_svg_player *PICAPI | psx_svg_player_create (const psx_svg *root, psx_result *err) |
| Create a new animation player from an already-parsed SVG document. More... | |
| PEXPORT void PICAPI | psx_svg_player_destroy (psx_svg_player *p) |
| Destroy the psx_svg_player object and release resources. More... | |
| PEXPORT void PICAPI | psx_svg_player_set_loop (psx_svg_player *p, bool loop) |
| Set whether the animation should loop when it reaches the end. More... | |
| PEXPORT bool PICAPI | psx_svg_player_get_loop (const psx_svg_player *p) |
| Return whether the animation looping is enabled. More... | |
| PEXPORT void PICAPI | psx_svg_player_set_dpi (psx_svg_player *p, int32_t dpi) |
| Set the DPI (dots per inch) used for unit conversion. More... | |
| PEXPORT int32_t PICAPI | psx_svg_player_get_dpi (const psx_svg_player *p) |
| Return the current DPI value. More... | |
| PEXPORT void PICAPI | psx_svg_player_play (psx_svg_player *p) |
| Start or resume playback of the animation. More... | |
| PEXPORT void PICAPI | psx_svg_player_pause (psx_svg_player *p) |
| Pause the animation at the current time. More... | |
| PEXPORT void PICAPI | psx_svg_player_stop (psx_svg_player *p) |
| Stop the animation and seek to time 0. More... | |
| PEXPORT void PICAPI | psx_svg_player_seek (psx_svg_player *p, float seconds) |
| Seek the animation to an absolute time position. More... | |
| PEXPORT void PICAPI | psx_svg_player_tick (psx_svg_player *p, float delta_seconds) |
| Advance the animation by a relative time delta. More... | |
| PEXPORT float PICAPI | psx_svg_player_get_time (const psx_svg_player *p) |
| Return the current playback time in seconds. More... | |
| PEXPORT float PICAPI | psx_svg_player_get_duration (const psx_svg_player *p) |
| Return the total duration of the animation. More... | |
| PEXPORT psx_svg_player_state PICAPI | psx_svg_player_get_state (const psx_svg_player *p) |
| Return the current playback state of the player. More... | |
| PEXPORT void PICAPI | psx_svg_player_draw (psx_svg_player *p, ps_context *ctx) |
| Draw the current animation frame into the provided Picasso context. More... | |
| PEXPORT void PICAPI | psx_svg_player_set_event_callback (psx_svg_player *p, psx_svg_anim_event_cb cb, void *user) |
| Set a callback to receive animation events (begin, end, repeat). More... | |
| PEXPORT void PICAPI | psx_svg_player_trigger (psx_svg_player *p, const char *target_id, const char *event_name) |
| Send an external event trigger to the player. More... | |
| PEXPORT void PICAPI | psx_svg_player_send_key (psx_svg_player *p, char key) |
| Forward a keyboard event to the player. More... | |
| void psx_svg_destroy | ( | psx_svg * | doc | ) |
Destroy the psx_svg object and release resources.
| doc | Pointer to an existing psx_svg object. |
| psx_result psx_svg_init | ( | void | ) |
| psx_svg * psx_svg_load | ( | const char * | file_name, |
| psx_result * | err_code | ||
| ) |
Create a new psx_svg object and load from file.
| file_name | The svg file path which will be loaded, which is encoded by utf8. |
| err_code | Pointer to a value to receiving the result code. can be NULL. |
| psx_svg * psx_svg_load_from_memory | ( | const ps_byte * | data, |
| size_t | length, | ||
| psx_result * | err_code | ||
| ) |
Create a new psx_svg object and load data from memory.
| data | Pointer to data buffer in memeory. |
| length | Data length bytes. |
| err_code | Pointer to a value to receiving the result code. can be NULL. |
| psx_svg_player * psx_svg_player_create | ( | const psx_svg * | root, |
| psx_result * | err | ||
| ) |
Create a new animation player from an already-parsed SVG document.
The player internally builds a render list once and reuses it each frame.
| root | Pointer to an existing psx_svg object. |
| err | Pointer to a value to receiving the result code. Can be NULL. |
| void psx_svg_player_destroy | ( | psx_svg_player * | p | ) |
Destroy the psx_svg_player object and release resources.
| p | Pointer to an existing psx_svg_player object. |
| void psx_svg_player_draw | ( | psx_svg_player * | p, |
| ps_context * | ctx | ||
| ) |
Draw the current animation frame into the provided Picasso context.
| p | Pointer to an existing psx_svg_player object. |
| ctx | Pointer to an existing ps_context object. |
| int32_t psx_svg_player_get_dpi | ( | const psx_svg_player * | p | ) |
Return the current DPI value.
| p | Pointer to an existing psx_svg_player object. |
| float psx_svg_player_get_duration | ( | const psx_svg_player * | p | ) |
Return the total duration of the animation.
| p | Pointer to an existing psx_svg_player object. |
| bool psx_svg_player_get_loop | ( | const psx_svg_player * | p | ) |
Return whether the animation looping is enabled.
| p | Pointer to an existing psx_svg_player object. |
| psx_svg_player_state psx_svg_player_get_state | ( | const psx_svg_player * | p | ) |
Return the current playback state of the player.
| p | Pointer to an existing psx_svg_player object. |
| float psx_svg_player_get_time | ( | const psx_svg_player * | p | ) |
Return the current playback time in seconds.
| p | Pointer to an existing psx_svg_player object. |
| void psx_svg_player_pause | ( | psx_svg_player * | p | ) |
Pause the animation at the current time.
| p | Pointer to an existing psx_svg_player object. |
| void psx_svg_player_play | ( | psx_svg_player * | p | ) |
Start or resume playback of the animation.
| p | Pointer to an existing psx_svg_player object. |
| void psx_svg_player_seek | ( | psx_svg_player * | p, |
| float | seconds | ||
| ) |
Seek the animation to an absolute time position.
| p | Pointer to an existing psx_svg_player object. |
| seconds | The target time in seconds. |
| void psx_svg_player_send_key | ( | psx_svg_player * | p, |
| char | key | ||
| ) |
Forward a keyboard event to the player.
Used for animations with begin="accessKey(x)" style timing.
| p | Pointer to an existing psx_svg_player object. |
| key | The character key pressed. |
| void psx_svg_player_set_dpi | ( | psx_svg_player * | p, |
| int32_t | dpi | ||
| ) |
Set the DPI (dots per inch) used for unit conversion.
| p | Pointer to an existing psx_svg_player object. |
| dpi | The DPI value. Default is 96. |
| void psx_svg_player_set_event_callback | ( | psx_svg_player * | p, |
| psx_svg_anim_event_cb | cb, | ||
| void * | user | ||
| ) |
Set a callback to receive animation events (begin, end, repeat).
| p | Pointer to an existing psx_svg_player object. |
| cb | The callback function, or NULL to clear. |
| user | User data pointer passed to the callback. |
| void psx_svg_player_set_loop | ( | psx_svg_player * | p, |
| bool | loop | ||
| ) |
Set whether the animation should loop when it reaches the end.
| p | Pointer to an existing psx_svg_player object. |
| loop | True to enable looping, False to disable. |
| void psx_svg_player_stop | ( | psx_svg_player * | p | ) |
Stop the animation and seek to time 0.
| p | Pointer to an existing psx_svg_player object. |
| void psx_svg_player_tick | ( | psx_svg_player * | p, |
| float | delta_seconds | ||
| ) |
Advance the animation by a relative time delta.
| p | Pointer to an existing psx_svg_player object. |
| delta_seconds | The time increment in seconds since the last tick. |
| void psx_svg_player_trigger | ( | psx_svg_player * | p, |
| const char * | target_id, | ||
| const char * | event_name | ||
| ) |
Send an external event trigger to the player.
Used for animations with begin="id.event" style timing.
| p | Pointer to an existing psx_svg_player object. |
| target_id | The target element id, or NULL for untargeted events. |
| event_name | The event name (e.g. "click"). |
| void psx_svg_render_destroy | ( | psx_svg_render * | render | ) |
Destroy the psx_svg_render object and release resources.
| render | Pointer to an existing psx_svg_render object. |
| psx_result PICAPI psx_svg_render_draw | ( | ps_context * | ctx, |
| const psx_svg_render * | render | ||
| ) |
Draws an psx_svg_render object into the given context.
| ctx | Pointer to an existing context object. |
| render | Pointer to an existing psx_svg_render object. |
| void psx_svg_shutdown | ( | void | ) |
Release resources and shutdown.
1.8.17