Add explicit PPI project writer
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
namespace pp::assets {
|
||||
@@ -136,6 +137,23 @@ struct PpiLayerMetadataConfig {
|
||||
bool visible = true;
|
||||
};
|
||||
|
||||
struct PpiFrameConfig {
|
||||
std::uint32_t duration_ms = 100;
|
||||
};
|
||||
|
||||
struct PpiLayerConfig {
|
||||
std::string_view name;
|
||||
PpiLayerMetadataConfig metadata;
|
||||
std::span<const PpiFrameConfig> frames;
|
||||
};
|
||||
|
||||
struct PpiProjectConfig {
|
||||
std::uint32_t width = 0;
|
||||
std::uint32_t height = 0;
|
||||
std::span<const PpiLayerConfig> layers;
|
||||
std::span<const PpiDirtyFacePayloadConfig> dirty_faces;
|
||||
};
|
||||
|
||||
struct PpiMinimalProjectConfig {
|
||||
std::uint32_t width = 0;
|
||||
std::uint32_t height = 0;
|
||||
@@ -172,6 +190,9 @@ struct PpiMinimalProjectConfig {
|
||||
[[nodiscard]] pp::foundation::Result<PpiDecodedProjectImages> decode_ppi_project_images(
|
||||
std::span<const std::byte> bytes);
|
||||
|
||||
[[nodiscard]] pp::foundation::Result<std::vector<std::byte>> create_ppi_project(
|
||||
PpiProjectConfig config);
|
||||
|
||||
[[nodiscard]] pp::foundation::Result<std::vector<std::byte>> create_minimal_ppi_project(
|
||||
PpiMinimalProjectConfig config);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user