Commit 8dea6122 authored by Cyrille Berger's avatar Cyrille Berger
Browse files

forward fix: displaying on ppc

svn path=/trunk/koffice/; revision=547584
parent ca59d197
......@@ -200,17 +200,10 @@ QImage KisLmsF32ColorSpace::convertToQImage(const quint8 *dataU8, qint32 width,
double l = *( data + i + PIXEL_LONGWAVE );
double m = *( data + i + PIXEL_MIDDLEWAVE );
double s = *( data + i + PIXEL_SHORTWAVE );
#ifdef __BIG_ENDIAN__
*( j + 0) = FLOAT_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 1 ) = computeRed(l,m,s);
*( j + 2 ) = computeGreen(l,m,s);
*( j + 3 ) = computeBlue(l,m,s);
#else
*( j + 3) = FLOAT_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 2 ) = computeRed(l,m,s);
*( j + 1 ) = computeGreen(l,m,s);
*( j + 0 ) = computeBlue(l,m,s);
#endif
i += MAX_CHANNEL_LMSA;
j += MAX_CHANNEL_LMSA;
}
......
......@@ -279,17 +279,10 @@ QImage KisRgbF16HalfColorSpace::convertToQImage(const quint8 *dataU8, qint32 wid
float exposureFactor = powf(2, exposure + 2.47393);
while ( i < width * height * MAX_CHANNEL_RGBA) {
#ifdef __BIG_ENDIAN__
*( j + 0) = HALF_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 1 ) = convertToDisplay(*( data + i + PIXEL_RED ), exposureFactor, gamma);
*( j + 2 ) = convertToDisplay(*( data + i + PIXEL_GREEN ), exposureFactor, gamma);
*( j + 3 ) = convertToDisplay(*( data + i + PIXEL_BLUE ), exposureFactor, gamma);
#else
*( j + 3) = HALF_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 2 ) = convertToDisplay(*( data + i + PIXEL_RED ), exposureFactor, gamma);
*( j + 1 ) = convertToDisplay(*( data + i + PIXEL_GREEN ), exposureFactor, gamma);
*( j + 0 ) = convertToDisplay(*( data + i + PIXEL_BLUE ), exposureFactor, gamma);
#endif
i += MAX_CHANNEL_RGBA;
j += MAX_CHANNEL_RGBA;
}
......
......@@ -278,17 +278,10 @@ QImage KisRgbF32ColorSpace::convertToQImage(const quint8 *dataU8, qint32 width,
float exposureFactor = powf(2, exposure + 2.47393);
while ( i < width * height * MAX_CHANNEL_RGBA) {
#ifdef __BIG_ENDIAN__
*( j + 0) = FLOAT_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 1 ) = convertToDisplay(*( data + i + PIXEL_RED ), exposureFactor, gamma);
*( j + 2 ) = convertToDisplay(*( data + i + PIXEL_GREEN ), exposureFactor, gamma);
*( j + 3 ) = convertToDisplay(*( data + i + PIXEL_BLUE ), exposureFactor, gamma);
#else
*( j + 3) = FLOAT_TO_UINT8(*( data + i + PIXEL_ALPHA ));
*( j + 2 ) = convertToDisplay(*( data + i + PIXEL_RED ), exposureFactor, gamma);
*( j + 1 ) = convertToDisplay(*( data + i + PIXEL_GREEN ), exposureFactor, gamma);
*( j + 0 ) = convertToDisplay(*( data + i + PIXEL_BLUE ), exposureFactor, gamma);
#endif
i += MAX_CHANNEL_RGBA;
j += MAX_CHANNEL_RGBA;
}
......
......@@ -1463,6 +1463,21 @@ QImage KisImage::convertToQImage(const QRect& r, const QSize& scaledImageSize, K
m_activeLayer->paintMaskInactiveLayers(img, x1, y1, w, h);
}
}*/
#ifdef __BIG_ENDIAN__
uchar * data = img.bits();
for (int i = 0; i < w * h; ++i) {
uchar r, g, b, a;
a = data[0];
b = data[1];
g = data[2];
r = data[3];
data[0] = r;
data[1] = g;
data[2] = b;
data[3] = a;
data += 4;
}
#endif
return image;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment