From edf241b13a0a965b04857258c41ca190b5afa415 Mon Sep 17 00:00:00 2001 From: Andreas Brachold Date: Thu, 19 Jan 2006 16:45:07 +0000 Subject: - fix wrong limits on NTSC zoom mode - fix consider the border values at zoom mode --- HISTORY | 4 ++++ TODO | 1 - control-image.c | 25 +++++++++++++++---------- control-image.h | 4 ++-- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/HISTORY b/HISTORY index d1dc46d..df50d66 100644 --- a/HISTORY +++ b/HISTORY @@ -1,6 +1,10 @@ VDR Plugin 'image' Revision History ----------------------------------- +2006-01-19 +- fix wrong limits on NTSC zoom mode +- fix consider the border values at zoom mode + 2006-01-18 - fix first image was'nt rotation depends founded exif data - fix show vdr info screen via official vdr way diff --git a/TODO b/TODO index 772eeb3..36fa920 100644 --- a/TODO +++ b/TODO @@ -3,6 +3,5 @@ TODO Proper Scale on 16:9 Change BLUE/EXIT > Stop to BLUE > Stop / EXIT > reshow Browser -reload Image after commands execution, if image changed Add dejitter / horizontal 1px blur diff --git a/control-image.c b/control-image.c index 5f53a29..5ec2307 100644 --- a/control-image.c +++ b/control-image.c @@ -741,6 +741,9 @@ void cImageControl::PictureZoomInitial(void) cImage* pImage = theSlideShow.GetImage(); if(!pImage) return; + + unsigned int nMaxWidth = player->UseWidth(); + unsigned int nMaxHeight = player->UseHeight(); asprintf(&szFileName, "%s.par", pImage->NamePNM()); @@ -749,8 +752,8 @@ void cImageControl::PictureZoomInitial(void) strncpy(m_szZoomRotation, szRotation[m_nRotation],sizeof(m_szZoomRotation)); - m_nRealImageWidth = 720; - m_nRealImageHeight = 576; + m_nRealImageWidth = nMaxWidth; + m_nRealImageHeight = nMaxHeight; if((f = fopen(szFileName, "rt"))) { @@ -767,13 +770,12 @@ void cImageControl::PictureZoomInitial(void) free(szFileName); - if(m_nRealImageWidth <= 0 - || m_nRealImageWidth > 720 - || m_nRealImageHeight > 576 ) + if(m_nRealImageWidth > nMaxWidth + || m_nRealImageHeight > nMaxHeight ) m_nZoomMin = 1; else { - m_nZoomMin = 800/m_nRealImageWidth; + m_nZoomMin = ((nMaxWidth / 100) + 1) /m_nRealImageWidth; } if (m_nZoomMin < 0) m_nZoomMin = 1; @@ -792,16 +794,19 @@ void cImageControl::ConvertZoom() if(!player) return; + unsigned int nMaxWidth = player->UseWidth(); + unsigned int nMaxHeight = player->UseHeight(); + m_ePlayMode = ePlayModeZoom; // How may pixel are outside screen after zoom - m_nZoomXMax = ((m_nRealImageWidth * m_nZoomFactor) - player->UseWidth()); - m_nZoomYMax = ((m_nRealImageHeight * m_nZoomFactor) - player->UseHeight()); + m_nZoomXMax = ((m_nRealImageWidth * m_nZoomFactor) - nMaxWidth); + m_nZoomYMax = ((m_nRealImageHeight * m_nZoomFactor) - nMaxHeight); // If image bigger than screen, how many step can i'm move in zoomed image if(m_nZoomXMax > 0) { - m_nMaxStepX = (m_nRealImageWidth * m_nZoomFactor) / player->UseWidth() * 2; + m_nMaxStepX = (m_nRealImageWidth * m_nZoomFactor) / nMaxWidth * 2; if(m_nMoveStepX >= m_nMaxStepX) m_nMoveStepX = m_nMaxStepX; if(m_nMoveStepX <= -m_nMaxStepX) @@ -815,7 +820,7 @@ void cImageControl::ConvertZoom() if(m_nZoomYMax > 0) { - m_nMaxStepY = (m_nRealImageHeight * m_nZoomFactor) / player->UseHeight() * 2; + m_nMaxStepY = (m_nRealImageHeight * m_nZoomFactor) / nMaxHeight * 2; if(m_nMoveStepY >= m_nMaxStepY) m_nMoveStepY = m_nMaxStepY-1; if(m_nMoveStepY <= -m_nMaxStepY) diff --git a/control-image.h b/control-image.h index dd964b9..f262fc0 100644 --- a/control-image.h +++ b/control-image.h @@ -86,9 +86,9 @@ class cImageControl /** How may pixel are outside screen after zoom, on height */ int m_nZoomYMax; /** real image pixel width*/ - int m_nRealImageWidth; + unsigned int m_nRealImageWidth; /** real image pixel height*/ - int m_nRealImageHeight; + unsigned int m_nRealImageHeight; char m_szZoomRotation[32]; -- cgit v1.2.3