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.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/Palm2QImage.cpp b/noncore/apps/opie-reader/Palm2QImage.cpp
index c6907eb..361755f 100644
--- a/noncore/apps/opie-reader/Palm2QImage.cpp
+++ b/noncore/apps/opie-reader/Palm2QImage.cpp
@@ -1,49 +1,50 @@
/* -*- mode: c; indent-tabs-mode: nil; -*- */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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 *****/
/***** *****/
/***********************************************************************/
/***********************************************************************/
#define READ_BIGENDIAN_SHORT(p) (((p)[0] << 8)|((p)[1]))
#define READ_BIGENDIAN_LONG(p) (((p)[0] << 24)|((p)[1] << 16)|((p)[2] << 8)|((p)[3]))
#define PALM_IS_COMPRESSED_FLAG 0x8000
#define PALM_HAS_COLORMAP_FLAG 0x4000
#define PALM_HAS_TRANSPARENCY_FLAG 0x2000
#define PALM_DIRECT_COLOR_FLAG 0x0400
#define PALM_4_BYTE_FIELD_FLAG 0x0200
#define PALM_COMPRESSION_SCANLINE 0x00
#define PALM_COMPRESSION_RLE 0x01
#define PALM_COMPRESSION_PACKBITS 0x02
#define PALM_COMPRESSION_NONE 0xFF
#define PALM_COLORMAP_SIZE 232
typedef struct {
unsigned char red;
unsigned char green;
unsigned char blue;
} ColorMapEntry;
static ColorMapEntry Palm8BitColormap[] = {
{ 255, 255, 255 }, { 255, 204, 255 }, { 255, 153, 255 }, { 255, 102, 255 },
{ 255, 51, 255 }, { 255, 0, 255 }, { 255, 255, 204 }, { 255, 204, 204 },
{ 255, 153, 204 }, { 255, 102, 204 }, { 255, 51, 204 }, { 255, 0, 204 },
{ 255, 255, 153 }, { 255, 204, 153 }, { 255, 153, 153 }, { 255, 102, 153 },
{ 255, 51, 153 }, { 255, 0, 153 }, { 204, 255, 255 }, { 204, 204, 255 },