summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/convpic/bmp.c9
-rw-r--r--tools/convpic/tiff.c6
-rw-r--r--tools/convpic/tuxbox.c21
-rw-r--r--tools/convpic/tuxbox.h6
-rw-r--r--tools/genfont/genfont.c6
-rw-r--r--tools/showpic/showpic.c7
-rw-r--r--tools/showtext/showtext.c7
7 files changed, 42 insertions, 20 deletions
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<ntohs(header.count);++n)
{
ret = false;
- unsigned int nBmpSize = image.Height() * ((image.Width() + 7) / 8);
- unsigned char *bitmap = new unsigned char[nBmpSize];
+// unsigned int nBmpSize = image.Height() * ((image.Width() + 7) / 8);
+ unsigned int nBmpSize = image.Height() * image.Width();
+// unsigned char *bitmap = new unsigned char[nBmpSize];
+ uint32_t *bitmap = new uint32_t [nBmpSize];
if (!bitmap)
{
fprintf(stderr, "ERROR: malloc failed.");
break;
}
- unsigned int nAniSize = image.Width() * ((image.Height() + 7) / 8);
- unsigned char *pAni = new unsigned char[nAniSize];
+// unsigned int nAniSize = image.Width() * ((image.Height() + 7) / 8);
+ unsigned int nAniSize = image.Width() * image.Height();
+// unsigned char *pAni = new unsigned char[nAniSize];
+ uint32_t *pAni = new uint32_t [nAniSize];
if (!pAni)
{
delete[] bitmap;
@@ -200,7 +204,8 @@ bool cTuxBoxFile::Save(GLCD::cImage & image, const std::string & fileName)
{
bRet = false;
unsigned int nAniSize = image.Width() * ((image.Height() + 7) / 8);
- unsigned char *pAni = new unsigned char[nAniSize];
+// unsigned char *pAni = new unsigned char[nAniSize];
+ uint32_t *pAni = new uint32_t [nAniSize];
if (!pAni)
{
fprintf(stderr, "ERROR: malloc failed.");
@@ -233,7 +238,8 @@ rotate from {Byte} to {Byte}
{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] => [ 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 <andreas.regel AT powarman.de>
+ * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net>
+ * Andreas 'randy' Weinberger
*/
#include <getopt.h>
@@ -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 <andreas.regel AT powarman.de>
+ * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net>
+ * Andreas 'randy' Weinberger
*/
#include <stdio.h>
@@ -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 <andreas.regel AT powarman.de>
+ * (c) 2004-2010 Andreas Regel <andreas.regel AT powarman.de>
+ * (c) 2010-2011 Wolfgang Astleitner <mrwastl AT users sourceforge net>
+ * Andreas 'randy' Weinberger
*/
#include <stdio.h>
@@ -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();