|
|
|
|
@ -137,12 +137,12 @@ ImageData2D* TgaImporter::doImage2D(UnsignedInt) {
|
|
|
|
|
|
|
|
|
|
#ifdef MAGNUM_TARGET_GLES |
|
|
|
|
if(format == ImageFormat::RGB) { |
|
|
|
|
auto data = reinterpret_cast<Math::Vector3<UnsignedByte>*>(buffer); |
|
|
|
|
std::transform(data, data + dimensions.product(), data, |
|
|
|
|
auto pixels = reinterpret_cast<Math::Vector3<UnsignedByte>*>(data); |
|
|
|
|
std::transform(pixels, pixels + size.product(), pixels, |
|
|
|
|
[](Math::Vector3<UnsignedByte> pixel) { return swizzle<'b', 'g', 'r'>(pixel); }); |
|
|
|
|
} else if(format == ImageFormat::RGBA) { |
|
|
|
|
auto data = reinterpret_cast<Math::Vector4<UnsignedByte>*>(buffer); |
|
|
|
|
std::transform(data, data + dimensions.product(), data, |
|
|
|
|
auto pixels = reinterpret_cast<Math::Vector4<UnsignedByte>*>(data); |
|
|
|
|
std::transform(pixels, pixels + size.product(), pixels, |
|
|
|
|
[](Math::Vector4<UnsignedByte> pixel) { return swizzle<'b', 'g', 'r', 'a'>(pixel); }); |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
|