载入中...
搜索中...
未找到
EvpackImageDecoder.cpp
浏览该文件的文档.
14Result<DecodedEvpackImage> decodeEvpackImage(const EvpackResourceReader& reader, const AssetRef& image,
26 Diagnostic::error(DiagnosticCode::ParseError, "eve.image must contain exactly one bulk chunk", {}, {},
31 const std::uint8_t magic[] = {'E', 'V', 'I', 'M', 'G', 0, std::uint8_t(explicitSchema ? 2 : 1), 0};
36 DiagnosticCode::ParseError, "EVIMG bulk header is missing or invalid", {}, {}, "asset.image.decode"));
46 Diagnostic::error(DiagnosticCode::InvalidArgument, "EVIMG dimensions, flags, or byte size are invalid", {},
55 DiagnosticCode::InvalidArgument, "EVIMG mip bytes are truncated", {}, {}, "asset.image.decode"));
73 DiagnosticCode::ParseError, "image contains duplicate definitions", {}, {}, "asset.image.decode"));
97 DiagnosticCode::ParseError, "image definition and mip bulk disagree", {}, {}, "asset.image.decode"));
99 const auto* colorObject = color == object->end() ? nullptr : color->second.getIf<Value::Object>();
100 if (!colorObject || !colorObject->contains("transfer") || !colorObject->at("transfer").isString() ||
103 DiagnosticCode::ParseError, "explicit image transfer must be linear", {}, {}, "asset.image.decode"));
Backend-neutral canonical EVIMG decoding.
JSON-free versioned runtime metadata codec.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Immutable reader retaining an admitted pack by shared ownership.
Definition EvpackResourceReader.h:29
Result< RuntimeAssetPayload > read(const AssetRef &asset, std::string_view expectedType, const EvpackCapabilities &capabilities, std::uint64_t maximumDecodedBytes) const
Resolve, type-check, variant-select and decode a canonical runtime asset.
Definition EvpackResourceReader.cpp:10
std::uint32_t little32(std::span< const std::uint8_t > bytes, std::size_t offset)
Read a uint32 after the caller has bounded the byte range.
Definition GltfDecode.cpp:22
Definition AssetCooker.cpp:17
Result< Value > decodeRuntimeDefinition(std::span< const std::uint8_t > bytes, const RuntimeDefinitionLimits &limits)
Decode a bounded EVDEF\0\1 metadata tree without a JSON parser.
Definition RuntimeDefinition.cpp:246
Result< DecodedEvpackImage > decodeEvpackImage(const EvpackResourceReader &reader, const AssetRef &image, const EvpackCapabilities &capabilities, const EvpackImageDecodeLimits &limits)
Decode and validate canonical eve.image/3 data with eve.image/2 compatibility.
Definition EvpackImageDecoder.cpp:14
@ Definition
@ InvalidArgument
@ TypeMismatch
A stable reference resolved to a different canonical domain type.
@ ParseError
Owning validated RGBA8 mip chain independent of a graphics backend.
Definition EvpackImageDecoder.h:18
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Bounds applied before allocating decoded image bytes.
Definition EvpackImageDecoder.h:11
One decoded runtime chunk with its admitted semantic metadata.
Definition EvpackResourceReader.h:13
std::vector< std::uint8_t > bytes
Definition EvpackResourceReader.h:16