From 46e597df44402086edd010b69702c2de52b75fc8 Mon Sep 17 00:00:00 2001 From: mrwastl Date: Sun, 1 May 2011 22:22:32 +0200 Subject: initial upload to branch 'touchcol'. see file 'HISTORY' for changes --- tools/convpic/bmp.c | 9 ++++++--- tools/convpic/tiff.c | 6 ++++-- tools/convpic/tuxbox.c | 21 ++++++++++++++------- tools/convpic/tuxbox.h | 6 ++++-- 4 files changed, 28 insertions(+), 14 deletions(-) (limited to 'tools/convpic') diff --git a/tools/convpic/bmp.c b/tools/convpic/bmp.c index 0829302..0357988 100644 --- a/tools/convpic/bmp.c +++ b/tools/convpic/bmp.c @@ -89,7 +89,8 @@ bool cBMPFile::Load(GLCD::cImage & image, const std::string & fileName) long iSize; uint32_t x, y; uint16_t iRead; - uint8_t * bitmap = NULL; +// uint8_t * bitmap = NULL; + uint32_t *bitmap = NULL; bool bInvert = false; if (fileName.length() > 0) @@ -163,7 +164,8 @@ bool cBMPFile::Load(GLCD::cImage & image, const std::string & fileName) image.SetWidth(bmpHeader.bmpWidth); image.SetHeight(bmpHeader.bmpHeight); image.SetDelay(100); - bitmap = new unsigned char[bmpHeader.bmpHeight * ((bmpHeader.bmpWidth + 7) / 8)]; +// bitmap = new unsigned char[bmpHeader.bmpHeight * ((bmpHeader.bmpWidth + 7) / 8)]; + bitmap = new uint32_t [bmpHeader.bmpHeight * bmpHeader.bmpWidth]; if (!bitmap) { fprintf(stderr, "ERROR: cannot allocate memory\n"); @@ -260,7 +262,8 @@ bool cBMPFile::Save(const GLCD::cBitmap * bitmap, const std::string & fileName) char Dummy = 0x00; uint32_t x, y; uint16_t iWrote; - const uint8_t * bmpdata = bitmap->Data(); +// const uint8_t * bmpdata = bitmap->Data(); + const uint32_t * bmpdata = bitmap->Data(); if (bitmap && bitmap->Width() > 0 diff --git a/tools/convpic/tiff.c b/tools/convpic/tiff.c index 4b8bf0e..3eb8cad 100644 --- a/tools/convpic/tiff.c +++ b/tools/convpic/tiff.c @@ -71,7 +71,8 @@ bool cTIFFFile::Load(GLCD::cImage & image, const std::string & fileName) unsigned char fLittleEndian=0; int j; int t; - unsigned char *bitmap = NULL; +// unsigned char *bitmap = NULL; + uint32_t *bitmap = NULL; bool bInvert = false; if (fileName.length() > 0) @@ -152,7 +153,8 @@ bool cTIFFFile::Load(GLCD::cImage & image, const std::string & fileName) image.SetWidth(width); image.SetHeight(height); image.SetDelay(100); - bitmap = new unsigned char[height * ((width + 7) / 8)]; +// bitmap = new unsigned char[height * ((width + 7) / 8)]; + bitmap = new uint32_t[height * width]; if (bitmap) { if (fread(bitmap, height*((width+7)/8), 1, fIN)!=1) diff --git a/tools/convpic/tuxbox.c b/tools/convpic/tuxbox.c index 55d6e1d..9e3f558 100644 --- a/tools/convpic/tuxbox.c +++ b/tools/convpic/tuxbox.c @@ -118,15 +118,19 @@ bool cTuxBoxFile::Load(GLCD::cImage & image, const std::string & fileName) for (unsigned int n=0;n [ oooooooo ] {o}[o][o][o][o][o][o][o] => [ oooooooo ] {o}[o][o][o][o][o][o][o] => [ oooooooo ]*/ -void cTuxBoxFile::vert2horz(const unsigned char* source, unsigned char* dest, int width, int height) { +//void cTuxBoxFile::vert2horz(const unsigned char* source, unsigned char* dest, int width, int height) { +void cTuxBoxFile::vert2horz(const uint32_t *source, uint32_t *dest, int width, int height) { int x, y, off; memset(dest,0,height*((width+7)/8)); @@ -261,7 +267,8 @@ rotate from {Byte} to {Byte} [ oooooooo ] => {o}[o][o][o][o][o][o][o] [ oooooooo ] => {o}[o][o][o][o][o][o][o] [ oooooooo ] => {o}[o][o][o][o][o][o][o]*/ -void cTuxBoxFile::horz2vert(const unsigned char* source, unsigned char* dest, int width, int height) { +//void cTuxBoxFile::horz2vert(const unsigned char* source, unsigned char* dest, int width, int height) { +void cTuxBoxFile::horz2vert(const uint32_t *source, uint32_t *dest, int width, int height) { int x, y, off; memset(dest,0,width*((height+7)/8)); diff --git a/tools/convpic/tuxbox.h b/tools/convpic/tuxbox.h index 1214fb5..8d19ebd 100644 --- a/tools/convpic/tuxbox.h +++ b/tools/convpic/tuxbox.h @@ -32,8 +32,10 @@ class cTuxBoxFile : public GLCD::cImageFile { private: - void vert2horz(const unsigned char* source, unsigned char* dest, int width, int height); - void horz2vert(const unsigned char* source, unsigned char* dest, int width, int height); +// void vert2horz(const unsigned char* source, unsigned char* dest, int width, int height); +// void horz2vert(const unsigned char* source, unsigned char* dest, int width, int height); + void vert2horz(const uint32_t *source, uint32_t *dest, int width, int height); + void horz2vert(const uint32_t *source, uint32_t *dest, int width, int height); public: cTuxBoxFile(); virtual ~cTuxBoxFile(); -- cgit v1.2.3