summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-reader/Palm2QImage.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-reader/Palm2QImage.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-reader/Palm2QImage.cpp15
1 files changed, 8 insertions, 7 deletions
diff --git a/noncore/apps/opie-reader/Palm2QImage.cpp b/noncore/apps/opie-reader/Palm2QImage.cpp
index 9603877..bf5ece3 100644
--- a/noncore/apps/opie-reader/Palm2QImage.cpp
+++ b/noncore/apps/opie-reader/Palm2QImage.cpp
@@ -1,18 +1,19 @@
/* -*- mode: c; indent-tabs-mode: nil; -*- */
+#include "useqpe.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifndef WINDOWS
-#include <unistd.h> /* for link */
+#ifndef _WINDOWS
+#include <unistd.h> /* for link */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <stdarg.h>
#include <qimage.h>
/***********************************************************************/
/***********************************************************************/
/***** *****/
/***** Code to decode the Palm image format to JPEG *****/
/***** *****/
@@ -193,29 +194,29 @@ QImage* Palm2QImage
return NULL;
}
if (bits_per_pixel > (8 * sizeof(unsigned long))) {
// qDebug ("Can't handle this format DirectColor image -- too many bits per pixel (%d)\n", bits_per_pixel);
return NULL;
}
imagedatastart = palmimage + 24;
} else {
// qDebug("Unknown bits-per-pixel of %d encountered.\n", bits_per_pixel);
return NULL;
}
-#ifdef WINDOWS
- QImage* qimage = new QImage(width, height, 32);
-#else
- QImage* qimage = new QImage(width, height, 16);
-#endif
+#ifndef USEQPE
+ QImage* qimage = new QImage(width, height, 32);
+#else
+ QImage* qimage = new QImage(width, height, 16);
+#endif
/* row by row, uncompress the Palm image and copy it to the JPEG buffer */
rowbuf = new unsigned char[bytes_per_row * width];
lastrow = new unsigned char[bytes_per_row * width];
for (i=0, palm_ptr = imagedatastart , x_ptr = imagedata; i < height; ++i) {
// qDebug("inval:%x palm_ptr:%x x_ptr:%x bpr:%x", inval, palm_ptr, x_ptr, bytes_per_row);
/* first, uncompress the Palm image */
if ((flags & PALM_IS_COMPRESSED_FLAG) && (compression_type == PALM_COMPRESSION_RLE)) {
for (j = 0; j < bytes_per_row; ) {
incount = *palm_ptr++;