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 */ /* Detect type from extension */
std::string plugin; 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"; plugin = "OpenExrImageConverter";
else if(Utility::String::endsWith(filename, ".hdr"))
plugin = "HdrImageConverter";
else if(Utility::String::endsWith(filename, ".png")) else if(Utility::String::endsWith(filename, ".png"))
plugin = "PngImageConverter"; 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"; plugin = "TgaImageConverter";
else { else {
Error() << "Trade::AnyImageConverter::exportToFile(): cannot determine type of file" << filename; 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 - OpenEXR (`*.exr`), converted with any plugin that provides
`OpenExrImageConverter` `OpenExrImageConverter`
- PNG (`*.png`), converted with @ref PngImageConverter or any other plugin - Windows Bitmap (`*.bmp`), converted with any plugin that provides
that provides it `BmpImageConverter`
- TGA (`*.tga`), converted with @ref TgaImageConverter or any other plugin - Radiance HDR (`*.hdr`), converted with any plugin that provides
that provides it `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. No supported formats for compressed data yet.

Loading…
Cancel
Save