summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authormrwastl <mrwastl@users.sourceforge.net>2011-05-11 21:08:15 +0200
committermrwastl <mrwastl@users.sourceforge.net>2011-05-11 21:08:15 +0200
commitb6ca1969785782cf4d6e58f78563804e6812b3e6 (patch)
tree09347fed6f21b811a284f90bd97df815444f22b6 /tools
parent92ee6261961f7a0d24c0a1f024117b43751ac250 (diff)
downloadgraphlcd-base-b6ca1969785782cf4d6e58f78563804e6812b3e6.tar.gz
graphlcd-base-b6ca1969785782cf4d6e58f78563804e6812b3e6.tar.bz2
showpic: experimental support for imagemagick-supported formats
Diffstat (limited to 'tools')
-rw-r--r--tools/showpic/showpic.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/showpic/showpic.c b/tools/showpic/showpic.c
index 53e5c0e..173e9ea 100644
--- a/tools/showpic/showpic.c
+++ b/tools/showpic/showpic.c
@@ -31,6 +31,7 @@
#include <glcddrivers/config.h>
#include <glcddrivers/driver.h>
#include <glcddrivers/drivers.h>
+#include <glcdgraphics/extformats.h>
static const char *prgname = "showpic";
static const char *version = "0.1.2";
@@ -201,7 +202,7 @@ int main(int argc, char *argv[])
delete lcd;
return 7;
}
- lcd->SetBrightness(GLCD::Config.driverConfigs[displayNumber].brightness);
+ lcd->SetBrightness(GLCD::Config.driverConfigs[displayNumber].brightness);
signal(SIGINT, sighandler);
signal(SIGQUIT, sighandler);
@@ -211,6 +212,8 @@ int main(int argc, char *argv[])
const GLCD::cBitmap * bitmap;
GLCD::cImage image;
GLCD::cGLCDFile glcd;
+ GLCD::cExtFormatFile extformat;
+
int optFile;
std::string picFile;
@@ -218,20 +221,22 @@ int main(int argc, char *argv[])
while (optFile < argc && !stopProgramm)
{
picFile = argv[optFile++];
- if (glcd.Load(image, picFile) == false)
- {
- fprintf(stderr, "ERROR: Failed loading file %s\n", picFile.c_str());
- return 8;
+ if (glcd.Load(image, picFile) == false) {
+ if (extformat.Load(image, picFile) == false) {
+ fprintf(stderr, "ERROR: Failed loading file %s\n", picFile.c_str());
+ return 8;
+ }
}
if (delay)
image.SetDelay(sleepMs);
+ lcd->Refresh(true);
while ((bitmap = image.GetBitmap()) != NULL && !stopProgramm)
{
// lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height(), bitmap->LineSize());
lcd->SetScreen(bitmap->Data(), bitmap->Width(), bitmap->Height());
- lcd->Refresh(true);
+ lcd->Refresh(false);
if (image.Next(0)) // Select next image
{