mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 09:32:46 +00:00
rlottie: added sync version of render function in capi
This commit is contained in:
parent
792e781423
commit
409d775f41
@ -170,6 +170,28 @@ LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation *a
|
||||
*/
|
||||
LOT_EXPORT size_t lottie_animation_get_frame_at_pos(const Lottie_Animation *animation, float pos);
|
||||
|
||||
/**
|
||||
* @brief Request to render the content of the frame @p frame_num to buffer @p buffer.
|
||||
*
|
||||
* @param[in] animation Animation object.
|
||||
* @param[in] frame_num the frame number needs to be rendered.
|
||||
* @param[in] buffer surface buffer use for rendering.
|
||||
* @param[in] width width of the surface
|
||||
* @param[in] height height of the surface
|
||||
* @param[in] bytes_per_line stride of the surface in bytes.
|
||||
*
|
||||
*
|
||||
* @ingroup Lottie_Animation
|
||||
* @internal
|
||||
*/
|
||||
LOT_EXPORT void
|
||||
lottie_animation_render(Lottie_Animation *animation,
|
||||
size_t frame_num,
|
||||
uint32_t *buffer,
|
||||
size_t width,
|
||||
size_t height,
|
||||
size_t bytes_per_line);
|
||||
|
||||
/**
|
||||
* @brief Request to render the content of the frame @p frame_num to buffer @p buffer asynchronously.
|
||||
*
|
||||
|
||||
@ -107,6 +107,20 @@ lottie_animation_get_frame_at_pos(const Lottie_Animation_S *animation, float pos
|
||||
return animation->mAnimation->frameAtPos(pos);
|
||||
}
|
||||
|
||||
LOT_EXPORT void
|
||||
lottie_animation_render(Lottie_Animation_S *animation,
|
||||
size_t frame_number,
|
||||
uint32_t *buffer,
|
||||
size_t width,
|
||||
size_t height,
|
||||
size_t bytes_per_line)
|
||||
{
|
||||
if (!animation) return;
|
||||
|
||||
rlottie::Surface surface(buffer, width, height, bytes_per_line);
|
||||
animation->mAnimation->renderSync(frame_number, surface);
|
||||
}
|
||||
|
||||
LOT_EXPORT void
|
||||
lottie_animation_render_async(Lottie_Animation_S *animation,
|
||||
size_t frame_number,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user