41 lines
775 B
C++
41 lines
775 B
C++
#pragma once
|
|
|
|
#include "foundation/result.h"
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <span>
|
|
|
|
namespace pp::assets {
|
|
|
|
constexpr std::size_t ppi_header_size = 40;
|
|
|
|
struct PpiVersion {
|
|
std::uint32_t major = 0;
|
|
std::uint32_t minor = 0;
|
|
};
|
|
|
|
struct PpiSoftwareVersion {
|
|
std::uint32_t major = 0;
|
|
std::uint32_t minor = 0;
|
|
std::uint32_t fix = 0;
|
|
std::uint32_t build = 0;
|
|
};
|
|
|
|
struct PpiThumbnailInfo {
|
|
std::uint32_t width = 0;
|
|
std::uint32_t height = 0;
|
|
std::uint32_t components = 0;
|
|
};
|
|
|
|
struct PpiHeaderInfo {
|
|
PpiVersion document_version;
|
|
PpiSoftwareVersion software_version;
|
|
PpiThumbnailInfo thumbnail;
|
|
};
|
|
|
|
[[nodiscard]] pp::foundation::Result<PpiHeaderInfo> parse_ppi_header(
|
|
std::span<const std::byte> bytes) noexcept;
|
|
|
|
}
|