summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2005-07-26 15:46:37 +0000
committerAndreas Brachold <vdr07@deltab.de>2005-07-26 15:46:37 +0000
commit57ff8fb8eb79adfebfaf43c884eac70e3ffb2b2c (patch)
tree5cc9452ece6fa76e3cac3f3575807a897c58f35d
parent8fc94579f1e868dfe1e4bb5e80c52d552bae3b0a (diff)
downloadvdr-plugin-image-57ff8fb8eb79adfebfaf43c884eac70e3ffb2b2c.tar.gz
vdr-plugin-image-57ff8fb8eb79adfebfaf43c884eac70e3ffb2b2c.tar.bz2
- rotate pictures now in several 90° steps
-rw-r--r--HISTORY11
-rw-r--r--README4
-rw-r--r--README.DE9
-rw-r--r--control-image.c29
-rw-r--r--control-image.h10
-rwxr-xr-xscripts/imageplugin.sh8
-rwxr-xr-xscripts/maverickplugin.sh8
7 files changed, 60 insertions, 19 deletions
diff --git a/HISTORY b/HISTORY
index 27e3f31..220f73d 100644
--- a/HISTORY
+++ b/HISTORY
@@ -1,6 +1,17 @@
VDR Plugin 'image' Revision History
-----------------------------------
+2005-07-26
+- rotate pictures now in several 90° steps
+
+2005-07-18
+- add alternative script (scripts/maverickplugin.sh) for image converting with imagemagick
+
+2005-07-17 (provided by Tobias Grimm)
+- adjust encoding parameter for new ffmpeg-releases, downwards compatible
+- remove linking with dlfcn at runtime of libavcodec.so, now are linked at compiled time
+- some code refactoring, to enhance readability
+
2005-01-09 Version 0.2.3
- Bounce to vdr-1.3.18
- Add -fPIC to CXXFLAGS (suggest by Thomas Schmidt)
diff --git a/README b/README
index eedeced..d06bd8a 100644
--- a/README
+++ b/README
@@ -86,8 +86,8 @@ While watching pictures
1 Rotate 90 Grad counter clockwise
3 Rotate 90 Grad clockwise direction
- 4 slide show - decrease the time (seconds) each picture shows
- 6 slide show - increase the time (seconds) each picture shows
+ 4 slide show - decrease the time (seconds) each picture shows
+ 6 slide show - increase the time (seconds) each picture shows
5 Zoom inside image
8 Zoom outside image and call Jumpmenu
diff --git a/README.DE b/README.DE
index 39600b5..e9edad6 100644
--- a/README.DE
+++ b/README.DE
@@ -86,11 +86,12 @@ Während der Bildbetrachtung:
9 Springe fünf Bilder vorwärts
0 Zeige Originalbild
- 1 Rotatiere 90 Grad gegen den Uhrzeigersinn
- 3 Rotatiere 90 Grad im Uhrzeigersinn
+
+ 1 Drehe 90 Grad gegen den Uhrzeigersinn
+ 3 Drehe 90 Grad im Uhrzeigersinn
- 4 Diaschau-WeiterschaltwertinSekundenverkleinern
- 6 Diaschau-WeiterschaltwertinSekundenerhöhen
+ 4 Diaschau-WeiterschaltwertinSekundenverkleinern
+ 6 Diaschau-WeiterschaltwertinSekundenerhöhen
5 "Zoomwert erhöhen" und damit Zoom-Bedienung starten
8 "Zoomwert verkleinern" und damit Jump-Bedienung starten
diff --git a/control-image.c b/control-image.c
index b109c50..ac707c9 100644
--- a/control-image.c
+++ b/control-image.c
@@ -1,7 +1,7 @@
/*
* Image plugin to VDR (C++)
*
-* (C) 2004 Andreas Brachold <vdr04 -at- deltab.de>
+* (C) 2004-2005 Andreas Brachold <vdr04 -at- deltab.de>
* based on (C) 2003 Kai Tobias Burwieck <kai -at- burwieck.net>
*
* This code is free software; you can redistribute it and/or
@@ -872,12 +872,21 @@ bool cImageControl::CheckAccess() const
return false;
}
+const char* cImageControl::szRotation [] =
+{
+ "rotated", //0
+ "right", //1
+ "original",//2
+ "left", //3
+};
+
void cImageControl::OriginalImage(bool bCached)
{
m_nZoomFactor = 0;
+ m_nRotation = 2;
m_ePlayMode = ePlayModeNormal;
if(!CheckAccess()
- || !player->Convert(bCached?"":"original"))
+ || !player->Convert(bCached?"":szRotation[m_nRotation]))
{
OSD_ErrorNumMsg(errno,tr("Operation failed"));
}
@@ -886,8 +895,11 @@ void cImageControl::OriginalImage(bool bCached)
void cImageControl::RFlipImage(void)
{
m_ePlayMode = ePlayModeNormal;
+ --m_nRotation;
+ m_nRotation %= memberof(szRotation);
+
if(!CheckAccess()
- || !player->Convert("right"))
+ || !player->Convert(szRotation[m_nRotation]))
{
OSD_ErrorNumMsg(errno,tr("Operation failed"));
}
@@ -896,8 +908,11 @@ void cImageControl::RFlipImage(void)
void cImageControl::LFlipImage(void)
{
m_ePlayMode = ePlayModeNormal;
+ ++m_nRotation;
+ m_nRotation %= memberof(szRotation);
+
if(!CheckAccess()
- || !player->Convert("left"))
+ || !player->Convert(szRotation[m_nRotation]))
{
OSD_ErrorNumMsg(errno,tr("Operation failed"));
}
@@ -919,7 +934,7 @@ void cImageControl::PictureZoomInitial(void)
if(!szFileName)
return;
- strcpy(zoom_command, "original");
+ strncpy(m_szZoomRotation, szRotation[m_nRotation],sizeof(m_szZoomRotation));
m_nRealImageWidth = 720;
m_nRealImageHeight = 576;
@@ -929,7 +944,7 @@ void cImageControl::PictureZoomInitial(void)
dsyslog("imageplugin: open file %s", szFileName);
fgets(buf, sizeof(buf) - 1, f);
dsyslog("imageplugin: line=%s", buf);
- sscanf(buf, "%d %d %s", &m_nRealImageWidth,&m_nRealImageHeight,zoom_command);
+ sscanf(buf, "%d %d %s", &m_nRealImageWidth,&m_nRealImageHeight,m_szZoomRotation);
fclose(f);
}
else
@@ -1011,7 +1026,7 @@ void cImageControl::ConvertZoom()
// execute
if(!CheckAccess()
- || !player->ConvertZoom(zoom_command, m_nZoomFactor, nZoomXoff, nZoomYoff))
+ || !player->ConvertZoom(m_szZoomRotation, m_nZoomFactor, nZoomXoff, nZoomYoff))
{
OSD_ErrorNumMsg(errno,tr("Operation failed"));
}
diff --git a/control-image.h b/control-image.h
index a09c02f..fad7332 100644
--- a/control-image.h
+++ b/control-image.h
@@ -1,7 +1,7 @@
/*
* Image plugin to VDR (C++)
*
- * (C) 2004 Andreas Brachold <vdr04 -at- deltab.de>
+ * (C) 2004-2005 Andreas Brachold <vdr04 -at- deltab.de>
* based on (C) 2003 Kai Tobias Burwieck <kai -at- burwieck.net>
*
* This code is free software; you can redistribute it and/or
@@ -30,6 +30,8 @@
#include <vdr/osdbase.h>
#endif
+#define memberof(x) (sizeof(x)/sizeof(*x))
+
class cImagePlayer;
class cImageMenuCommands;
@@ -91,7 +93,11 @@ class cImageControl
/** real image pixel height*/
int m_nRealImageHeight;
- char zoom_command[20];
+ char m_szZoomRotation[32];
+
+ static const char* szRotation [];
+ /** rotation mode */
+ unsigned int m_nRotation;
private:
void ShowOSD(void);
diff --git a/scripts/imageplugin.sh b/scripts/imageplugin.sh
index 73635c1..7242413 100755
--- a/scripts/imageplugin.sh
+++ b/scripts/imageplugin.sh
@@ -3,7 +3,8 @@
# needs : netpbm-progs > anytopnm pnmscalefixed pnmfile pnmcut pnmflip
#
# History:
-# 2005-06-17 wrong lookup for pnmscale and really are pnmscalefixed used
+# 2005-07-26 add commando for rotate 180
+# 2005-07-18 wrong lookup for pnmscale and really are pnmscalefixed used
# 2004-08-12 Initalrelease, Andreas Brachold <vdr04-at-deltab.de>
# base on prior work for convert.sh
# by Onno Kreuzinger <o.kreuzinger-at-kreuzinger.biz>
@@ -39,7 +40,7 @@ if [ $# -lt 7 ] ; then
echo "ZOOMFACTOR - Zoomfactor (0....10)" 1>&2
echo "LEFTPOS - Offset from left on Zoommode (0......)" 1>&2
echo "TOPPOS - Offset from top on Zoommode (0......)" 1>&2
- echo "FLIPCMD - optional should image flip (left,right,original)" 1>&2
+ echo "FLIPCMD - optional should image flip (left,right,rotated,original)" 1>&2
exit 1
fi
@@ -99,6 +100,9 @@ fi
FLIP="pnmflip -rotate90";
SWAPRES=$X_RES;X_RES=$Y_RES;Y_RES=$SWAPRES
;;
+ rotated )
+ FLIP="pnmflip -rotate180";
+ ;;
*)
FLIP="cat";
;;
diff --git a/scripts/maverickplugin.sh b/scripts/maverickplugin.sh
index 848c46e..1b41869 100755
--- a/scripts/maverickplugin.sh
+++ b/scripts/maverickplugin.sh
@@ -3,7 +3,8 @@
# needs : imagemagick > identify convert
#
# History:
-# 2005-06-17 Reimplement with imagemagick, Andreas Brachold
+# 2005-07-26 add commando for rotate 180
+# 2005-07-18 Reimplement with imagemagick
# 2004-08-12 Initalrelease, Andreas Brachold <vdr04-at-deltab.de>
# base on prior work for convert.sh
# by Onno Kreuzinger <o.kreuzinger-at-kreuzinger.biz>
@@ -37,7 +38,7 @@ if [ $# -lt 7 ] ; then
echo "ZOOMFACTOR - Zoomfactor (0....10)" 1>&2
echo "LEFTPOS - Offset from left on Zoommode (0......)" 1>&2
echo "TOPPOS - Offset from top on Zoommode (0......)" 1>&2
- echo "FLIPCMD - optional should image flip (left,right,original)" 1>&2
+ echo "FLIPCMD - optional should image flip (left,right,rotated,original)" 1>&2
exit 1
fi
@@ -90,6 +91,9 @@ fi
FLIP="-rotate 90";
SWAPRES=$X_RES;X_RES=$Y_RES;Y_RES=$SWAPRES
;;
+ rotated )
+ FLIP="-rotate 180";
+ ;;
*)
FLIP="";
;;