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 ++++-- tools/genfont/genfont.c | 6 ++++-- tools/showpic/showpic.c | 7 +++++-- tools/showtext/showtext.c | 7 +++++-- 7 files changed, 42 insertions(+), 20 deletions(-) (limited to 'tools') 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(); diff --git a/tools/genfont/genfont.c b/tools/genfont/genfont.c index 7553e4c..ce9698d 100644 --- a/tools/genfont/genfont.c +++ b/tools/genfont/genfont.c @@ -7,7 +7,9 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2004 Andreas Regel + * (c) 2004-2010 Andreas Regel + * (c) 2010-2011 Wolfgang Astleitner + * Andreas 'randy' Weinberger */ #include @@ -142,7 +144,7 @@ int main(int argc, char *argv[]) if (charBitmap == NULL) continue; - bitmap->DrawBitmap(posX, posY, *charBitmap, GLCD::clrBlack); + bitmap->DrawBitmap(posX, posY, *charBitmap); fprintf(descFile, "%d %d ", posX, i); posX += charBitmap->Width(); if ((i % 32) == 31) diff --git a/tools/showpic/showpic.c b/tools/showpic/showpic.c index f17f361..53e5c0e 100644 --- a/tools/showpic/showpic.c +++ b/tools/showpic/showpic.c @@ -9,7 +9,9 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2004 Andreas Regel + * (c) 2004-2010 Andreas Regel + * (c) 2010-2011 Wolfgang Astleitner + * Andreas 'randy' Weinberger */ #include @@ -227,7 +229,8 @@ int main(int argc, char *argv[]) while ((bitmap = image.GetBitmap()) != NULL && !stopProgramm) { - lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); +// lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); + lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height()); lcd->Refresh(true); if (image.Next(0)) // Select next image diff --git a/tools/showtext/showtext.c b/tools/showtext/showtext.c index 2621db1..b156935 100644 --- a/tools/showtext/showtext.c +++ b/tools/showtext/showtext.c @@ -6,7 +6,9 @@ * This file is released under the GNU General Public License. Refer * to the COPYING file distributed with this package. * - * (c) 2004 Andreas Regel + * (c) 2004-2010 Andreas Regel + * (c) 2010-2011 Wolfgang Astleitner + * Andreas 'randy' Weinberger */ #include @@ -269,7 +271,8 @@ int main(int argc, char *argv[]) bitmap->DrawText(x, y, bitmap->Width() - 1, text, &font); y += font.LineHeight(); } - lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); +// lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize()); + lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height()); lcd->Refresh(true); lcd->DeInit(); -- cgit v1.2.3