|
|
|
|
@ -33,7 +33,8 @@
|
|
|
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
#include <algorithm> |
|
|
|
|
#include <Swizzle.h> |
|
|
|
|
#include "Math/Swizzle.h" |
|
|
|
|
#include "Math/Vector4.h" |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
#include "TgaImporter/TgaHeader.h" |
|
|
|
|
@ -84,11 +85,11 @@ Containers::Array<unsigned char> TgaImageConverter::doExportToData(const ImageRe
|
|
|
|
|
if(image.format() == ColorFormat::RGB) { |
|
|
|
|
auto pixels = reinterpret_cast<Math::Vector3<UnsignedByte>*>(data.begin()+sizeof(TgaHeader)); |
|
|
|
|
std::transform(pixels, pixels + image.size().product(), pixels, |
|
|
|
|
[](Math::Vector3<UnsignedByte> pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); |
|
|
|
|
[](Math::Vector3<UnsignedByte> pixel) { return Math::swizzle<'b', 'g', 'r'>(pixel); }); |
|
|
|
|
} else if(image.format() == ColorFormat::RGBA) { |
|
|
|
|
auto pixels = reinterpret_cast<Math::Vector4<UnsignedByte>*>(data.begin()+sizeof(TgaHeader)); |
|
|
|
|
std::transform(pixels, pixels + image.size().product(), pixels, |
|
|
|
|
[](Math::Vector4<UnsignedByte> pixel) { return swizzle<'b', 'g', 'r', 'a'>(pixel); }); |
|
|
|
|
[](Math::Vector4<UnsignedByte> pixel) { return Math::swizzle<'b', 'g', 'r', 'a'>(pixel); }); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|