void renderSync(size_t frameNo, Surface surface);
/**
- * @brief Returns list of rendering nodes that that represents the
- * content of the lottie resource at frame number {frameNo}.
- *
- * @param[in] frameNo Content corresponds to the frameno needs to be extracted.
- * @param[in] width content viewbox width
- * @param[in] height content viewbox height
- *
- * @return render node list.
- *
- * @internal
- */
- const std::vector<LOTNode *> &renderList(size_t frameNo, size_t width, size_t height) const;
-
- /**
* @brief Returns root layer of the composition updated with
* content of the lottie resource at frame number {frameNo}.
*
LOT_EXPORT size_t lottie_animation_get_totalframe(const Lottie_Animation *animation);
LOT_EXPORT double lottie_animation_get_framerate(const Lottie_Animation *animation);
-
-/*
- * Request to update the content of the frame $frame_number in to Animation object.
- * frame_number, the content of the animation in that frame number
- * width , width of the viewbox
- * height , height of the viewbox
- *
- * PS : user must call lottie_animation_get_node_count and lottie_animation_get_node
- * to get the renderlist.
- */
-LOT_EXPORT size_t lottie_animation_prepare_frame(Lottie_Animation *animation,
- size_t frameNo,
- size_t w, size_t h);
-LOT_EXPORT size_t lottie_animation_get_node_count(const Lottie_Animation *animation);
-LOT_EXPORT const LOTNode* lottie_animation_get_node(Lottie_Animation *animation, size_t idx);
-
-
/*
* Get the render tree which contains the snapshot of the animation object at frame $frame_number
* frame_number, the content of the animation in that frame number
return animation->mAnimation->frameRate();
}
-LOT_EXPORT void lottie_animation_prepare_frame(Lottie_Animation_S *animation, size_t frameNo, size_t w, size_t h)
-{
- if (!animation) return;
-
- animation->mFrameNo = frameNo;
- animation->mWidth = w;
- animation->mHeight = h;
- animation->mArraySize = animation->mAnimation->renderList(frameNo, w, h).size();
-}
-
-LOT_EXPORT size_t lottie_animation_get_node_count(const Lottie_Animation_S *animation)
-{
- if (!animation) return 0;
-
- return animation->mArraySize;
-}
-
-LOT_EXPORT const LOTNode* lottie_animation_get_node(const Lottie_Animation_S *animation, size_t idx)
-{
- if (!animation) return nullptr;
-
- if (idx >= animation->mArraySize) return nullptr;
-
- return animation->mAnimation->renderList(animation->mFrameNo, animation->mWidth, animation->mHeight)[idx];
-}
-
LOT_EXPORT const LOTLayerNode * lottie_animation_render_tree(Lottie_Animation_S *animation, size_t frameNo, size_t w, size_t h)
{
if (!animation) return nullptr;
size_t frameAtPos(double pos) const {return mModel->frameAtPos(pos);}
Surface render(size_t frameNo, const Surface &surface);
- const std::vector<LOTNode *> &
- renderList(size_t frameNo, const VSize &size);
const LOTLayerNode *
renderTree(size_t frameNo, const VSize &size);
private:
std::atomic<bool> mRenderInProgress;
};
-const std::vector<LOTNode *> &AnimationImpl::renderList(size_t frameNo, const VSize &size)
-{
- if (update(frameNo, size)) {
- mCompItem->buildRenderList();
- }
- return mCompItem->renderList();
-}
-
const LOTLayerNode *AnimationImpl::renderTree(size_t frameNo, const VSize &size)
{
if (update(frameNo, size)) {
return d->frameAtPos(pos);
}
-const std::vector<LOTNode *> &
-Animation::renderList(size_t frameNo, size_t width, size_t height) const
-{
- return d->renderList(frameNo, VSize(width, height));
-}
-
const LOTLayerNode *
Animation::renderTree(size_t frameNo, size_t width, size_t height) const
{
return true;
}
-void LOTCompItem::buildRenderList()
-{
- mDrawableList.clear();
- mRootLayer->renderList(mDrawableList);
-
- mRenderList.clear();
- for (auto &i : mDrawableList) {
- LOTDrawable *lotDrawable = static_cast<LOTDrawable *>(i);
- lotDrawable->sync();
- mRenderList.push_back(lotDrawable->mCNode.get());
- }
-}
-
-const std::vector<LOTNode *> &LOTCompItem::renderList() const
-{
- return mRenderList;
-}
-
void LOTCompItem::buildRenderTree()
{
mRootLayer->buildLayerNode();
bool update(int frameNo);
void resize(const VSize &size);
VSize size() const;
- const std::vector<LOTNode *>& renderList()const;
- void buildRenderList();
void buildRenderTree();
const LOTLayerNode * renderTree()const;
bool render(const lottie::Surface &surface);