Browse Source

AnyImageConverter: recognize BMP, HDR and other TGA formats.

pull/205/head
Vladimír Vondruš 9 years ago
parent
commit
ba4538ef5a
  1. 11
      src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp
  2. 12
      src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h

11
src/MagnumPlugins/AnyImageConverter/AnyImageConverter.cpp

@ -48,11 +48,18 @@ bool AnyImageConverter::doExportToFile(const ImageView2D& image, const std::stri
/* Detect type from extension */
std::string plugin;
if(Utility::String::endsWith(filename, ".exr"))
if(Utility::String::endsWith(filename, ".bmp"))
plugin = "BmpImageConverter";
else if(Utility::String::endsWith(filename, ".exr"))
plugin = "OpenExrImageConverter";
else if(Utility::String::endsWith(filename, ".hdr"))
plugin = "HdrImageConverter";
else if(Utility::String::endsWith(filename, ".png"))
plugin = "PngImageConverter";
else if(Utility::String::endsWith(filename, ".tga"))
else if(Utility::String::endsWith(filename, ".tga") ||
Utility::String::endsWith(filename, ".vda") ||
Utility::String::endsWith(filename, ".icb") ||
Utility::String::endsWith(filename, ".vst"))
plugin = "TgaImageConverter";
else {
Error() << "Trade::AnyImageConverter::exportToFile(): cannot determine type of file" << filename;

12
src/MagnumPlugins/AnyImageConverter/AnyImageConverter.h

@ -65,10 +65,14 @@ Supported formats for uncompressed data:
- OpenEXR (`*.exr`), converted with any plugin that provides
`OpenExrImageConverter`
- PNG (`*.png`), converted with @ref PngImageConverter or any other plugin
that provides it
- TGA (`*.tga`), converted with @ref TgaImageConverter or any other plugin
that provides it
- Windows Bitmap (`*.bmp`), converted with any plugin that provides
`BmpImageConverter`
- Radiance HDR (`*.hdr`), converted with any plugin that provides
`HdrImageConverter`
- Portable Network Graphics (`*.png`), converted with @ref PngImageConverter
or any other plugin that provides it
- Truevision TGA (`*.tga`, `*.vda`, `*.icb`, `*.vst`), converted with
@ref TgaImageConverter or any other plugin that provides it
No supported formats for compressed data yet.

Loading…
Cancel
Save