载入中...
搜索中...
未找到
EvpackImageLoader.cpp
浏览该文件的文档.
27 return Result<LoadedGraphicsImage>::success({image, uploaded.value(), std::move(decoded).takeValue().variant});
32 auto payload = reader_.read(volume, "eve.volume-texture/1", capabilities, limits.maximumDecodedBytes);
40 Diagnostic::error(DiagnosticCode::ParseError, "volume texture contains duplicate definitions", {},
46 Diagnostic::error(DiagnosticCode::ParseError, "volume texture contains duplicate bulk chunks", {},
55 Diagnostic::error(DiagnosticCode::ParseError, "EVVOL definition or bulk header is missing or invalid", {},
59 if (!width || !height || !depth || width > limits.maximumDimension || height > limits.maximumDimension ||
60 depth > limits.maximumDimension || uint64_t(width) > std::numeric_limits<uint64_t>::max() / height ||
63 DiagnosticCode::InvalidArgument, "EVVOL dimensions, reserved field or packed bytes are invalid", {}, {},
69 DiagnosticCode::InvalidArgument, "EVVOL dimensions, reserved field or packed bytes are invalid", {}, {},
82 return found != object->end() && found->second.isString() && found->second.asString() == expected;
84 if (!object || object->size() != 8 || !exactInteger("schemaVersion", 1) || !exactInteger("width", width) ||
89 DiagnosticCode::ParseError, "volume definition and EVVOL bulk disagree", {}, {}, "asset.graphics.image"));
90 auto uploaded = factory_.uploadRgba8Volume(width, height, depth, std::span<const uint8_t>(bulk->bytes).subspan(24));
Transactional EVIMG runtime texture loading.
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
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
Result< LoadedGraphicsImage > load(const AssetRef &image, const asset::EvpackCapabilities &capabilities, const ImageAssetLoadLimits &limits={}) const
Validate and upload image/3 mip assets, retaining image/2 single-level compatibility.
Definition EvpackImageLoader.cpp:17
Result< LoadedGraphicsVolumeTexture > load(const AssetRef &volume, const asset::EvpackCapabilities &capabilities, const VolumeTextureAssetLoadLimits &limits={}) const
Validate definition and EVVOL bulk before atomically uploading one volume.
Definition EvpackImageLoader.cpp:29
virtual Result< Texture * > uploadRgba8MipChain(uint32_t width, uint32_t height, uint32_t levels, std::span< const uint8_t > pixels)
Upload complete explicit linear RGBA8 mips without regeneration.
Definition IImageResourceFactory.h:41
virtual Result< Texture * > uploadRgba8Volume(uint32_t width, uint32_t height, uint32_t depth, std::span< const uint8_t > pixels)
Upload one tightly packed linear RGBA8 volume.
Definition IImageResourceFactory.h:66
virtual Result< Texture * > uploadRgba8(std::uint32_t width, std::uint32_t height, const std::uint8_t *pixels, bool srgb)=0
Upload one tightly packed, top-down RGBA8 image.
Definition CookedMaterial.cpp:5
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
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
@ ParseError
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
Bounds checked before backend volume allocation.
Definition EvpackImageLoader.h:88