coastline 0.0.4
Loading...
Searching...
No Matches
gltfdocument.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <expected>
5#include <filesystem>
6#include <string>
7#include <vector>
8
9#include <nlohmann/json.hpp>
10
11namespace coastline {
12
16 nlohmann::ordered_json json;
19
24 std::expected<std::vector<std::uint8_t>, std::string> Image(std::size_t index) const;
25};
26
34std::expected<GltfDocument, std::string> ReadGltfDocument(const std::filesystem::path &path);
35
36} // namespace coastline
Definition assetimport.h:11
std::expected< GltfDocument, std::string > ReadGltfDocument(const std::filesystem::path &path)
Read a model or image-override document.
A glTF or GLB document with buffers joined and buffer-view offsets adjusted.
Definition gltfdocument.h:14
std::expected< std::vector< std::uint8_t >, std::string > Image(std::size_t index) const
nlohmann::ordered_json json
Definition gltfdocument.h:16
std::filesystem::path path
Definition gltfdocument.h:15
std::vector< std::uint8_t > buffer
Decoded buffers in order, each starting on a 4-byte boundary.
Definition gltfdocument.h:18