mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Added cOsd::DrawScaledBitmap()
This commit is contained in:
parent
aacdeba5d9
commit
fc0094231d
@ -3262,6 +3262,7 @@ Thomas Reufer <thomas@reufer.ch>
|
|||||||
for suggesting to add a note to ePlayMode in device.h that VDR itself always uses
|
for suggesting to add a note to ePlayMode in device.h that VDR itself always uses
|
||||||
pmAudioVideo when replaying a recording
|
pmAudioVideo when replaying a recording
|
||||||
for fixing a possible crash in the LCARS skin
|
for fixing a possible crash in the LCARS skin
|
||||||
|
for implementing cOsd::DrawScaledBitmap()
|
||||||
|
|
||||||
Eike Sauer <EikeSauer@t-online.de>
|
Eike Sauer <EikeSauer@t-online.de>
|
||||||
for reporting a problem with channels that need more than 5 TS packets for detecting
|
for reporting a problem with channels that need more than 5 TS packets for detecting
|
||||||
|
3
HISTORY
3
HISTORY
@ -8331,3 +8331,6 @@ Video Disk Recorder Revision History
|
|||||||
"Setup/DVB/Update channels" is set to a value other than "no" or "PIDs only".
|
"Setup/DVB/Update channels" is set to a value other than "no" or "PIDs only".
|
||||||
- Fixed multiple OBSOLETE marks in channels that are not listed in the SDT in case
|
- Fixed multiple OBSOLETE marks in channels that are not listed in the SDT in case
|
||||||
"Setup/Miscellaneous/Show channel names with source" is set to "yes".
|
"Setup/Miscellaneous/Show channel names with source" is set to "yes".
|
||||||
|
- The new function cOsd::DrawScaledBitmap() is now used for drawing subtitles.
|
||||||
|
This function can be reimplemented by high level OSDs which may be able to do
|
||||||
|
the scaling in hardware or otherwise more efficiently (thanks to Thomas Reufer).
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Original author: Marco Schluessler <marco@lordzodiac.de>
|
* Original author: Marco Schluessler <marco@lordzodiac.de>
|
||||||
* With some input from the "subtitles plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
|
* With some input from the "subtitles plugin" by Pekka Virtanen <pekka.virtanen@sci.fi>
|
||||||
*
|
*
|
||||||
* $Id: dvbsubtitle.c 3.5 2014/02/08 12:29:13 kls Exp $
|
* $Id: dvbsubtitle.c 3.6 2015/01/04 15:46:39 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dvbsubtitle.h"
|
#include "dvbsubtitle.h"
|
||||||
@ -1077,11 +1077,7 @@ void cDvbSubtitleBitmaps::Draw(cOsd *Osd)
|
|||||||
if (State() == 0 || Osd->SetAreas(areas, numAreas) == oeOk) {
|
if (State() == 0 || Osd->SetAreas(areas, numAreas) == oeOk) {
|
||||||
for (int i = 0; i < bitmaps.Size(); i++) {
|
for (int i = 0; i < bitmaps.Size(); i++) {
|
||||||
cBitmap *b = bitmaps[i];
|
cBitmap *b = bitmaps[i];
|
||||||
if (Scale)
|
Osd->DrawScaledBitmap(int(round(b->X0() * osdFactorX)), int(round(b->Y0() * osdFactorY)), *b, osdFactorX, osdFactorY, AntiAlias);
|
||||||
b = b->Scaled(osdFactorX, osdFactorY, AntiAlias);
|
|
||||||
Osd->DrawBitmap(int(round(b->X0() * osdFactorX)), int(round(b->Y0() * osdFactorY)), *b);
|
|
||||||
if (b != bitmaps[i])
|
|
||||||
delete b;
|
|
||||||
}
|
}
|
||||||
Osd->Flush();
|
Osd->Flush();
|
||||||
}
|
}
|
||||||
|
12
osd.c
12
osd.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: osd.c 3.2 2013/09/03 11:59:17 kls Exp $
|
* $Id: osd.c 3.3 2015/01/04 15:46:39 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
@ -1917,6 +1917,16 @@ void cOsd::DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg, tColo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cOsd::DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias)
|
||||||
|
{
|
||||||
|
const cBitmap *b = &Bitmap;
|
||||||
|
if (!DoubleEqual(FactorX, 1.0) || !DoubleEqual(FactorY, 1.0))
|
||||||
|
b = b->Scaled(FactorX, FactorY, AntiAlias);
|
||||||
|
DrawBitmap(x, y, *b);
|
||||||
|
if (b != &Bitmap)
|
||||||
|
delete b;
|
||||||
|
}
|
||||||
|
|
||||||
void cOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment)
|
void cOsd::DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width, int Height, int Alignment)
|
||||||
{
|
{
|
||||||
if (isTrueColor)
|
if (isTrueColor)
|
||||||
|
7
osd.h
7
osd.h
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* how to reach the author.
|
||||||
*
|
*
|
||||||
* $Id: osd.h 3.2 2013/09/06 12:13:47 kls Exp $
|
* $Id: osd.h 3.3 2015/01/04 15:51:03 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __OSD_H
|
#ifndef __OSD_H
|
||||||
@ -885,6 +885,11 @@ public:
|
|||||||
///< If Overlay is true, any pixel in Bitmap that has color index 0 will
|
///< If Overlay is true, any pixel in Bitmap that has color index 0 will
|
||||||
///< not overwrite the corresponding pixel in the target area.
|
///< not overwrite the corresponding pixel in the target area.
|
||||||
///< If this is a true color OSD, ReplacePalette has no meaning.
|
///< If this is a true color OSD, ReplacePalette has no meaning.
|
||||||
|
virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias = false);
|
||||||
|
///< Sets the pixels in the OSD with the data from the given Bitmap, putting
|
||||||
|
///< the upper left corner of the Bitmap at (x, y) and scaled by the given
|
||||||
|
///< factors. If AntiAlias is true and either of the factors is greater than
|
||||||
|
///< 1.0, anti-aliasing is applied.
|
||||||
virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
|
virtual void DrawText(int x, int y, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width = 0, int Height = 0, int Alignment = taDefault);
|
||||||
///< Draws the given string at coordinates (x, y) with the given foreground
|
///< Draws the given string at coordinates (x, y) with the given foreground
|
||||||
///< and background color and font. If Width and Height are given, the text
|
///< and background color and font. If Width and Height are given, the text
|
||||||
|
Loading…
x
Reference in New Issue
Block a user