Commit 9c81f22c authored by David Faure's avatar David Faure

WORDS_BIGENDIAN is now correctly defined, and moved to a config-endian.h

svn path=/trunk/koffice/; revision=621375
parent 643092b0
......@@ -38,11 +38,15 @@ link_directories(${KDE4_LIB_DIR})
include (MacroAdditionalCleanFiles)
include (MacroAddFileDependencies)
include (ConfigureChecks.cmake)
include (TestBigEndian)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h )
configure_file(config-prefix.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-prefix.h )
configure_file(config-openexr.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-openexr.h )
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
configure_file(config-endian.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-endian.h )
# for config.h and <toplevel/foo.h> includes (if any?)
include_directories(${QDBUS_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} )
......
......@@ -20,6 +20,7 @@
#include "kis_ycbcr_u16_colorspace.h"
#include <qimage.h>
#include <config-endian.h> // WORDS_BIGENDIAN
#include <KoIntegerMaths.h>
......@@ -192,7 +193,7 @@ QImage KisYCbCrU16ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width
Q_UINT16 Y = *( data + i + PIXEL_Y );
Q_UINT16 Cb = *( data + i + PIXEL_Cb );
Q_UINT16 Cr = *( data + i + PIXEL_Cr );
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
*( j + 0) = *( data + i + PIXEL_ALPHA ) >> 8;
*( j + 1 ) = computeRed(Y,Cb,Cr) >> 8;
*( j + 2 ) = computeGreen(Y,Cb,Cr) >> 8;
......
......@@ -20,6 +20,7 @@
#include "kis_ycbcr_u8_colorspace.h"
#include <qimage.h>
#include <config-endian.h> // WORDS_BIGENDIAN
#include <KoIntegerMaths.h>
......@@ -192,7 +193,7 @@ QImage KisYCbCrU8ColorSpace::convertToQImage(const Q_UINT8 *data, Q_INT32 width,
Q_UINT8 Y = *( data + i + PIXEL_Y );
Q_UINT8 Cb = *( data + i + PIXEL_Cb );
Q_UINT8 Cr = *( data + i + PIXEL_Cr );
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
*( j + 0) = *( data + i + PIXEL_ALPHA );
*( j + 1 ) = computeRed(Y,Cb,Cr);
*( j + 2 ) = computeGreen(Y,Cb,Cr);
......
......@@ -18,6 +18,8 @@
*/
#include "kis_image.h"
#include <config-endian.h> // WORDS_BIGENDIAN
#include <stdlib.h>
#include <math.h>
......@@ -1421,7 +1423,7 @@ QImage KisImage::convertToQImage(qint32 x,
if (!img.isNull()) {
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
uchar * data = img.bits();
for (int i = 0; i < w * h; ++i) {
uchar r, g, b, a;
......@@ -1502,7 +1504,7 @@ QImage KisImage::convertToQImage(const QRect& r, const double xScale, const doub
QImage image = colorSpace()->convertToQImage(scaledImageData, r.width(), r.height(), profile, INTENT_PERCEPTUAL, exposure);
delete [] scaledImageData;
#ifdef __BIG_ENDIAN__
#ifdef WORDS_BIGENDIAN
uchar * data = image.bits();
for (int i = 0; i < image.width() * image.height(); ++i) {
uchar r, g, b, a;
......
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