Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,34 @@
#include "LayerModelSerialization.hpp"
#include "Lottie/Private/Model/Layers/PreCompLayerModel.hpp"
#include "Lottie/Private/Model/Layers/SolidLayerModel.hpp"
#include "Lottie/Private/Model/Layers/ImageLayerModel.hpp"
#include "Lottie/Private/Model/Layers/ShapeLayerModel.hpp"
#include "Lottie/Private/Model/Layers/TextLayerModel.hpp"
namespace lottie {
std::shared_ptr<LayerModel> parseLayerModel(json11::Json::object const &json) noexcept(false) {
LayerType layerType = parseLayerType(json, "ty");
switch (layerType) {
case LayerType::Precomp:
return std::make_shared<PreCompLayerModel>(json);
case LayerType::Solid:
return std::make_shared<SolidLayerModel>(json);
case LayerType::Image:
return std::make_shared<ImageLayerModel>(json);
case LayerType::Null:
return std::make_shared<LayerModel>(json);
case LayerType::Shape:
try {
return std::make_shared<ShapeLayerModel>(json);
} catch(...) {
throw LottieParsingException();
}
case LayerType::Text:
return std::make_shared<TextLayerModel>(json);
}
}
}