Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
ModernImageDecoder.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "MeshRuntime.hpp"
4
5#include <cstddef>
6#include <expected>
7#include <span>
8
9namespace monopoly::data
10{
11 enum class ModernImageEncoding : std::uint8_t { Png, Jpeg };
13 {
14 std::size_t maximumEncodedBytes{64U * 1024U * 1024U};
15 std::uint32_t maximumDimension{8192};
16 std::size_t maximumDecodedBytes{64U * 1024U * 1024U};
17 };
18
19 // In-memory PNG/JPEG only. RGBA8 retains glTF's top-left texture origin;
20 // color-space interpretation belongs to the material binding, not pixels.
21 [[nodiscard]] std::expected<std::shared_ptr<const ModernTextureImage>, MeshRuntimeError>
22 decodeModernImage(std::span<const std::byte> bytes, ModernImageEncoding encoding,
23 ModernImageDecodeLimits limits = {});
24}
std::vector< std::byte > bytes
unsigned index
std::expected< std::shared_ptr< const ModernTextureImage >, MeshRuntimeError > decodeModernImage(std::span< const std::byte > bytes, ModernImageEncoding encoding, ModernImageDecodeLimits limits)