1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Removed scaling coordinates in letterbox mode from cDvbSpu

This commit is contained in:
Klaus Schmidinger 2005-05-07 11:17:25 +02:00
parent 8b137f8ce5
commit a20ddc1f22
4 changed files with 8 additions and 32 deletions

View File

@ -1166,6 +1166,7 @@ Marco Schl
for adding support for setting the video display mode for adding support for setting the video display mode
for fixing handling transparent areas in cDvbSpuBitmap for fixing handling transparent areas in cDvbSpuBitmap
for fixing a bug in libsi's SubtitlingDescriptor::getLength() for fixing a bug in libsi's SubtitlingDescriptor::getLength()
for removing scaling coordinates in letterbox mode from cDvbSpu
Jürgen Schmitz <j.schmitz@web.de> Jürgen Schmitz <j.schmitz@web.de>
for reporting a bug in displaying the current channel when switching via the SVDRP for reporting a bug in displaying the current channel when switching via the SVDRP

View File

@ -3502,3 +3502,5 @@ Video Disk Recorder Revision History
this has been put into a separate function. this has been put into a separate function.
- The timer status now has a new bit that is set when that timer is currently - The timer status now has a new bit that is set when that timer is currently
recording (suggested by Matthias Schniedermeyer). See man vdr(5) for details. recording (suggested by Matthias Schniedermeyer). See man vdr(5) for details.
- Removed scaling coordinates in letterbox mode from cDvbSpu - the DVD plugin, which
was the only one needing this, doesn't need it any more (thanks to Marco Schlüßler).

View File

@ -8,7 +8,7 @@
* *
* parts of this file are derived from the OMS program. * parts of this file are derived from the OMS program.
* *
* $Id: dvbspu.c 1.13 2005/05/05 13:19:03 kls Exp $ * $Id: dvbspu.c 1.14 2005/05/07 11:13:48 kls Exp $
*/ */
#include <assert.h> #include <assert.h>
@ -306,24 +306,6 @@ void cDvbSpuDecoder::clearHighlight(void)
hlpsize.y2 = -1; hlpsize.y2 = -1;
} }
int cDvbSpuDecoder::ScaleYcoord(int value)
{
if (scaleMode == eSpuLetterBox) {
int offset = cDevice::PrimaryDevice()->GetVideoSystem() == vsPAL ? 72 : 60;
return lround((value * 3.0) / 4.0) + offset;
}
else
return value;
}
int cDvbSpuDecoder::ScaleYres(int value)
{
if (scaleMode == eSpuLetterBox)
return lround((value * 3.0) / 4.0);
else
return value;
}
sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp) sDvbSpuRect cDvbSpuDecoder::CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp)
{ {
sDvbSpuRect size; sDvbSpuRect size;
@ -367,22 +349,15 @@ void cDvbSpuDecoder::Draw(void)
sDvbSpuRect hlsize; sDvbSpuRect hlsize;
hlsize.x1 = hlpsize.x1; hlsize.x1 = hlpsize.x1;
hlsize.y1 = ScaleYcoord(hlpsize.y1); hlsize.y1 = hlpsize.y1;
hlsize.x2 = hlpsize.x2; hlsize.x2 = hlpsize.x2;
hlsize.y2 = ScaleYcoord(hlpsize.y2); hlsize.y2 = hlpsize.y2;
if (highlight) if (highlight)
fg = spubmp->getBitmap(hlpDescr, palette, hlsize); fg = spubmp->getBitmap(hlpDescr, palette, hlsize);
if (spubmp->getMinSize(palDescr, bgsize)) { if (spubmp->getMinSize(palDescr, bgsize))
bg = spubmp->getBitmap(palDescr, palette, bgsize); bg = spubmp->getBitmap(palDescr, palette, bgsize);
if (scaleMode == eSpuLetterBox) {
// the coordinates have to be modified for letterbox
int y1 = ScaleYres(bgsize.y1) + bgsize.height();
bgsize.y2 = y1 + bgsize.height();
bgsize.y1 = y1;
}
}
sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg); sDvbSpuRect areaSize = CalcAreaSize(hlsize, fg, bgsize, bg);

View File

@ -8,7 +8,7 @@
* *
* parts of this file are derived from the OMS program. * parts of this file are derived from the OMS program.
* *
* $Id: dvbspu.h 1.8 2005/02/20 11:20:43 kls Exp $ * $Id: dvbspu.h 1.9 2005/05/07 11:14:03 kls Exp $
*/ */
#ifndef __DVBSPU_H #ifndef __DVBSPU_H
@ -129,8 +129,6 @@ class cDvbSpuDecoder:public cSpuDecoder {
return ((spu[0] << 8) | spu[1]); return ((spu[0] << 8) | spu[1]);
}; };
int ScaleYcoord(int value);
int ScaleYres(int value);
sDvbSpuRect CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp); sDvbSpuRect CalcAreaSize(sDvbSpuRect fgsize, cBitmap *fgbmp, sDvbSpuRect bgsize, cBitmap *bgbmp);
public: public: