Skip to content

Support custom key/value pairs in KTX2 compression #454

Description

@cfnptr

It would be great to have the ability to set custom key/value pairs for KTX2 files. For example, this could be used to store additional information about the target transcoding format, texture content, or channels.

The KTX2 format already includes a mechanism to handle this. We just need a way to pass basist::ktx2_transcoder::key_value_vec ktx2_key_values during compression. As a solution, this could be added to the basis_compress2() arguments:

void* basis_compress2(
    basist::basis_tex_format mode,
    const basisu::vector<image>& source_images,
    uint32_t flags_and_quality, int quality_level, int effort_level,
    size_t* pSize,
    image_stats* pStats = nullptr,
    const key_value_vec* pKeyValueVec = nullptr);

The KTX2 specification supports custom, non "KTX..." keys and describes how they should be handled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions