Class PackedEncoder
Defined in File libcacaoformats.hpp
Class Documentation
-
class PackedEncoder
Encoder for uncompressed packed format buffers.
Public Functions
-
PackedContainer EncodeCubemap(const std::array<libcacaoimage::Image, 6> &cubemap)
Encode a set of cubemap images faces into a packed cubemap.
- Parameters:
cubemap – A list of cubemap faces in the order of +X face, -X face, +Y face, -Y face, +Z face, -Z face
- Throws:
std::runtime_error – If one of the faces holds invalid data or has zero dimensions
- Returns:
A PackedContainer encapsulating the encoded cubemap data, with all faces encoded in PNG format
-
PackedContainer EncodeShader(const std::vector<unsigned char> &ir)
Encode shader IR into a packed shader object.
- Parameters:
ir – Shader Slang IR
- Returns:
A PackedContainer encapsulating the shader code
-
PackedContainer EncodeMaterial(const Material &mat)
Encode material data and a shader reference into a packed material.
- Parameters:
mat – The Material object with the data to encode
- Returns:
A PackedContainer encapsulating the shader reference and material data
-
PackedContainer EncodeWorld(const World &world)
Encode world data into a packed format.
- Parameters:
world – The decoded World object
- Returns:
A PackedContainer encapsulating the world data and initial state
-
PackedContainer EncodeAssetPack(const AssetPack &pack)
Combine asset pack files into a merged pack.
- Parameters:
pack – A map of filenames to PackedAsset objects from the asset pack
- Throws:
std::runtime_error – If the provided pack data has no assets
- Returns:
A PackedContainer encapsulating the asset info and asset files
-
PackedContainer EncodeCubemap(const std::array<libcacaoimage::Image, 6> &cubemap)