Class PackedDecoder

Class Documentation

class PackedDecoder

Decoder for uncompressed packed format buffers.

Public Functions

std::array<libcacaoimage::Image, 6> DecodeCubemap(const PackedContainer &container)

Extract and decode the images in a cubemap.

Parameters:

container – The PackedContainer with the cubemap information

Throws:

std::runtime_error – If the container does not hold a valid cubemap

Returns:

Decoded cubemap faces in the order of +X face, -X face, +Y face, -Y face, +Z face, -Z face

std::vector<unsigned char> DecodeShader(const PackedContainer &container)

Extract the code from a shader.

Parameters:

container – The PackedContainer with the shader information

Throws:

std::runtime_error – If the container does not hold a valid shader

Returns:

Shader in Slang IR format

Material DecodeMaterial(const PackedContainer &container)

Extract the data from a packed material.

Parameters:

container – The PackedContainer with the material information

Throws:

std::runtime_error – If the container does not hold a valid material

Returns:

Material object with shader reference string and data

World DecodeWorld(const PackedContainer &container)

Extract the data from a packed world.

Parameters:

container – The PackedContainer with the world information

Throws:

std::runtime_error – If the container does not hold a valid world

Returns:

World object containing the initial state of the world

AssetPack DecodeAssetPack(const PackedContainer &container)

Extract the files from an asset pack.

Parameters:

container – The PackedContainer with the asset pack information

Throws:

std::runtime_error – If the container does not hold a valid asset pack or the pack has no files

Returns:

Map of filenames to PackedAsset objects from the asset pack