-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
123 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#include "wrapper_tg.hpp" | ||
|
||
#include "rlottie.h" | ||
|
||
using rlottie::Animation; | ||
using rlottie::Surface; | ||
// using rlottie::Lottie_Animation_S; | ||
// using rlottie::FitzModifier; | ||
|
||
struct Lottie_Animation_S { | ||
std::unique_ptr<Animation> mAnimation; | ||
std::future<Surface> mRenderTask; | ||
uint32_t* mBufferRef; | ||
}; | ||
|
||
LOT_EXPORT Lottie_Animation* lottie_animation_from_data_tg(const char* data, const char* key, const char* resourcePath, FitzModifier fitzModifier) { | ||
if (auto animation = Animation::loadFromData(data, key, resourcePath, true, {}, rlottie::FitzModifier(fitzModifier))) { | ||
Lottie_Animation_S* handle = new Lottie_Animation_S(); | ||
handle->mAnimation = std::move(animation); | ||
return handle; | ||
} else { | ||
return nullptr; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "wrapper.h" | ||
|
||
#if defined _WIN32 || defined __CYGWIN__ | ||
#ifdef LOT_BUILD | ||
#define LOT_EXPORT __declspec(dllexport) | ||
#else | ||
#define LOT_EXPORT __declspec(dllimport) | ||
#endif | ||
#else | ||
#ifdef LOT_BUILD | ||
#define LOT_EXPORT __attribute__ ((visibility ("default"))) | ||
#else | ||
#define LOT_EXPORT | ||
#endif | ||
#endif | ||
|
||
enum class FitzModifier { | ||
None, | ||
Type12, | ||
Type3, | ||
Type4, | ||
Type5, | ||
Type6 | ||
}; | ||
|
||
LOT_EXPORT Lottie_Animation* lottie_animation_from_data_tg(const char* data, const char* key, const char* resource_path, FitzModifier fitz_modifier); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters