Browse Source

AnyImageConverter: recognize KTX2 files.

Preparing for the soon-to-be-merged KTX files. Not hooking up 1D/3D and
the compressed APIs yet, doing that only when the plugins get merged so
I have a way to test.
pull/537/head
Vladimír Vondruš 5 years ago
parent
commit
b25ab9d809
  1. 2
      src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp
  2. 2
      src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h
  3. 1
      src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp

2
src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp

@ -92,6 +92,8 @@ bool AnyImageConverter::doConvertToFile(const ImageView2D& image, const Containe
normalized.hasSuffix(".jpeg"_s) ||
normalized.hasSuffix(".jpe"_s))
plugin = "JpegImageConverter"_s;
else if(normalized.hasSuffix(".ktx2"_s))
plugin = "KtxImageConverter"_s;
else if(normalized.hasSuffix(".png"_s))
plugin = "PngImageConverter"_s;
else if(normalized.hasSuffix(".tga"_s) ||

2
src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h

@ -66,6 +66,8 @@ tries to convert the file with it. Supported formats for uncompressed data:
`HdrImageConverter`
- JPEG (`*.jpg`, `*.jpe`, `*.jpeg`), converted with @ref JpegImageConverter
or any other plugin that provides it
- KTX2 (`*.ktx2`), converted with any plugin that provides
`KtxImageConverter`
- Portable Network Graphics (`*.png`), converted with @ref PngImageConverter
or any other plugin that provides it
- Truevision TGA (`*.tga`, `*.vda`, `*.icb`, `*.vst`), converted with

1
src/MagnumPlugins/AnyImageConverter/Test/AnyImageConverterTest.cpp

@ -153,6 +153,7 @@ constexpr struct {
{"JPEG", "file.jpg", "JpegImageConverter"},
{"JPEG weird extension", "file.jpe", "JpegImageConverter"},
{"JPEG uppercase", "output.JPG", "JpegImageConverter"},
{"KTX2", "foo.ktx2", "KtxImageConverter"},
{"PNG", "file.png", "PngImageConverter"}
};

Loading…
Cancel
Save