KhronosGroup / KTX-Software

KTX (Khronos Texture) Library and Tools
Other
866 stars 227 forks source link

Add `ktx deflate` command #896

Closed MarkCallow closed 5 months ago

MarkCallow commented 5 months ago

For deflating an existing ktx 2.0 file.

Fixes part of #747. A complete fix requires either ktx encode support ASTC or a new ktx encode-astc command.

MarkCallow commented 5 months ago

Questions for reviewers:

  1. The command raises an error if neither --zlib or --zstd is specified. CompressOptions does not check for this since it is fine to not specify a scheme in either create or encode. Should I move the check to CompressOptions with some kind of option to enable it or is it fine in deflate's processOptions.
  2. The command preserves previously applied options in KTXwriterScParams by either maintaining the original KTXwriter, if it was a member of the ktx suite, or appending the original writer and params to the end of the new KTXwriterScParams. See comment at https://github.com/KhronosGroup/KTX-Software/blob/e162e3017096869a896b98d43d5708ae1d2b4b6f/tools/ktx/command_deflate.cpp#L202 for complete details.
MarkCallow commented 5 months ago

@lexaknyazev please review. For some reason your id doesn't show up in the potential reviewers list.