vdr 2.7.7
|
#include <osd.h>
Public Member Functions | |
virtual | ~cOsd () |
bool | IsTrueColor (void) const |
int | Left (void) |
int | Top (void) |
int | Width (void) |
int | Height (void) |
void | SetAntiAliasGranularity (uint FixedColors, uint BlendColors) |
virtual const cSize & | MaxPixmapSize (void) const |
virtual cPixmap * | CreatePixmap (int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null) |
virtual void | DestroyPixmap (cPixmap *Pixmap) |
virtual void | DrawImage (const cPoint &Point, const cImage &Image) |
virtual void | DrawImage (const cPoint &Point, int ImageHandle) |
virtual void | DrawScaledImage (const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias=false) |
virtual void | DrawScaledImage (const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias=false) |
virtual eOsdError | CanHandleAreas (const tArea *Areas, int NumAreas) |
virtual eOsdError | SetAreas (const tArea *Areas, int NumAreas) |
virtual void | SaveRegion (int x1, int y1, int x2, int y2) |
virtual void | RestoreRegion (void) |
virtual eOsdError | SetPalette (const cPalette &Palette, int Area) |
virtual void | DrawPixel (int x, int y, tColor Color) |
virtual void | DrawBitmap (int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false) |
virtual void | DrawScaledBitmap (int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias=false) |
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 | DrawRectangle (int x1, int y1, int x2, int y2, tColor Color) |
virtual void | DrawEllipse (int x1, int y1, int x2, int y2, tColor Color, int Quadrants=0) |
virtual void | DrawSlope (int x1, int y1, int x2, int y2, tColor Color, int Type) |
virtual void | Flush (void) |
Static Public Member Functions | |
static int | OsdLeft (void) |
static int | OsdTop (void) |
static int | OsdWidth (void) |
static int | OsdHeight (void) |
static void | SetOsdPosition (int Left, int Top, int Width, int Height) |
static int | IsOpen (void) |
Protected Member Functions | |
cOsd (int Left, int Top, uint Level) | |
bool | Active (void) |
virtual void | SetActive (bool On) |
cPixmap * | AddPixmap (cPixmap *Pixmap) |
cPixmap * | RenderPixmaps (void) |
cBitmap * | GetBitmap (int Area) |
Private Attributes | |
bool | isTrueColor |
cBitmap * | savedBitmap |
cBitmap * | bitmaps [MAXOSDAREAS] |
int | numBitmaps |
cPixmapMemory * | savedPixmap |
cVector< cPixmap * > | pixmaps |
int | left |
int | top |
int | width |
int | height |
uint | level |
bool | active |
Static Private Attributes | |
static int | osdLeft = 0 |
static int | osdTop = 0 |
static int | osdWidth = 0 |
static int | osdHeight = 0 |
static cVector< cOsd * > | Osds |
static cSize | maxPixmapSize |
static cMutex | mutex |
Friends | |
class | cOsdProvider |
The cOsd class is the interface to the "On Screen Display".
An actual output device needs to derive from this class and implement the functionality necessary to display the OSD on the TV screen. If the actual OSD supports "True Color", it can either let VDR do all the rendering by calling RenderPixmaps() ("raw mode"), or it can reimplement all necessary cPixmap functions and do the rendering itself ("high level mode"). If an OSD provides a "high level mode", it shall also provide a "raw mode" in order to verify proper operation. The plugin that implements the OSD shall offer a configuration switch in its setup.
|
protected |
Initializes the OSD with the given coordinates.
By default it is assumed that the full area will be able to display full 32 bit graphics (ARGB with eight bit for each color and the alpha value, respectively). However, the actual hardware in use may not be able to display such a high resolution OSD, so there is an option to divide the full OSD area into several sub-areas with lower color depths and individual palettes. The sub-areas need not necessarily cover the entire OSD area, but only the OSD area actually covered by sub-areas will be available for drawing. At least one area must be defined in order to set the actual width and height of the OSD. Also, the caller must first try to use an area that consists of only one sub-area that covers the entire drawing space, and should require only the minimum necessary color depth. This is because a derived cOsd class may or may not be able to handle more than one area. There can be any number of cOsd objects at the same time, but only one of them will be active at any given time. The active OSD is the one with the lowest value of Level. If there are several cOsd objects with the same Level, the one that was created first will be active.
Definition at line 1911 of file osd.c.
References active, height, isTrueColor, Left(), left, level, mutex, numBitmaps, Osds, savedBitmap, savedPixmap, Top(), top, and width.
Referenced by cCursesOsd::cCursesOsd(), cDvbSdFfOsd::cDvbSdFfOsd(), cHdffOsd::cHdffOsd(), and cHdffOsdRaw::cHdffOsdRaw().
|
virtual |
Shuts down the OSD.
Definition at line 1932 of file osd.c.
References bitmaps, mutex, numBitmaps, Osds, pixmaps, savedBitmap, and savedPixmap.
|
inlineprotected |
Definition at line 790 of file osd.h.
References active.
Referenced by cDvbSdFfOsd::Flush(), cHdffOsd::Flush(), cHdffOsdRaw::Flush(), cDvbSdFfOsd::SetActive(), cHdffOsd::SetActive(), cHdffOsdRaw::SetActive(), cHdffOsd::SetAreas(), and cHdffOsd::~cHdffOsd().
Adds the given Pixmap to the list of currently active pixmaps in this OSD.
Returns Pixmap if the operation was successful, or NULL if for some reason the pixmap could not be added to the list. A derived class that implements its own cPixmap class must call AddPixmap() in order to add a newly created pixmap to the OSD's list of pixmaps.
Definition at line 2006 of file osd.c.
References LOCK_PIXMAPS, and pixmaps.
Referenced by CreatePixmap().
Checks whether the OSD can display the given set of sub-areas.
The return value indicates whether a call to SetAreas() with this set of areas will succeed. CanHandleAreas() may be called with an OSD that is already in use with other areas and will not interfere with the current operation of the OSD. A derived class must first call the base class CanHandleAreas() to check the basic conditions, like not overlapping etc.
Reimplemented in cDvbSdFfOsd, cHdffOsd, and cHdffOsdRaw.
Definition at line 2070 of file osd.c.
References MAXOSDAREAS, oeAreasOverlap, oeOk, oeTooManyAreas, and oeWrongAlignment.
Referenced by cDvbSdFfOsd::CanHandleAreas(), cHdffOsd::CanHandleAreas(), cHdffOsdRaw::CanHandleAreas(), CreateOsd(), cDvbSubtitleBitmaps::Draw(), and SetAreas().
|
virtual |
Creates a new true color pixmap on this OSD (see cPixmap for details).
The caller must not delete the returned object, it will be deleted when the OSD is deleted. DestroyPixmap() can be called if a pixmap shall be destroyed before the OSD is deleted. If this is not a true color OSD, or if the pixmap could not be created due to limited resources, this function returns NULL.
Definition at line 1977 of file osd.c.
References AddPixmap(), isTrueColor, and LOCK_PIXMAPS.
Referenced by RenderPixmaps(), and SetAreas().
|
virtual |
Destroys the given Pixmap, which has previously been created by a call to CreatePixmap().
When the OSD is deleted, all pixmaps are destroyed automatically. So this function only needs to be used if a pixmap shall be destroyed while the OSD is still being used.
Definition at line 1989 of file osd.c.
References esyslog, cPixmap::Layer(), LOCK_PIXMAPS, pixmaps, and cPixmap::ViewPort().
Referenced by cHdffOsdRaw::Flush().
|
virtual |
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the Bitmap at (x, y).
If ColorFg or ColorBg is given, the first palette entry of the Bitmap will be mapped to ColorBg and the second palette entry will be mapped to ColorFg (palette indexes are defined so that 0 is the background and 1 is the foreground color). ReplacePalette controls whether the target area shall have its palette replaced with the one from Bitmap. If Overlay is true, any pixel in Bitmap that has color index 0 will not overwrite the corresponding pixel in the target area. If this is a true color OSD, ReplacePalette has no meaning.
Reimplemented in cHdffOsd.
Definition at line 2206 of file osd.c.
References bitmaps, DrawBitmap(), isTrueColor, numBitmaps, and pixmaps.
Referenced by DrawBitmap(), DrawScaledBitmap(), and RestoreRegion().
|
virtual |
Draws a filled ellipse defined by the upper left (x1, y1) and lower right (x2, y2) corners with the given Color.
Quadrants controls which parts of the ellipse are actually drawn: 0 draws the entire ellipse 1..4 draws only the first, second, third or fourth quadrant, respectively 5..8 draws the right, top, left or bottom half, respectively -1..-4 draws the inverted part of the given quadrant If Quadrants is not 0, the coordinates are those of the actual area, not the full circle!
Reimplemented in cHdffOsd.
Definition at line 2246 of file osd.c.
References bitmaps, DrawEllipse(), isTrueColor, numBitmaps, and pixmaps.
Referenced by DrawDevicePosition(), DrawEllipse(), DrawEllipse(), and DrawEllipseAlignments().
Draws the given Image on this OSD at the given Point.
If this is not a true color OSD, this function does nothing.
Definition at line 2172 of file osd.c.
References isTrueColor, and pixmaps.
Referenced by DrawImages().
|
virtual |
Draws the image referenced by the given ImageHandle on this OSD at the given Point.
ImageHandle must be a value that has previously been returned by a call to cOsdProvider::StoreImage(). If ImageHandle has an invalid value, nothing happens. If this is not a true color OSD, this function does nothing.
Definition at line 2178 of file osd.c.
References isTrueColor, and pixmaps.
|
virtual |
Sets the pixel at the given coordinates to the given Color, which is a full 32 bit ARGB value.
If the OSD area has been divided into separate sub-areas, and the given coordinates don't fall into any of these sub-areas, no pixel will be set.
Reimplemented in cHdffOsd.
Definition at line 2196 of file osd.c.
References bitmaps, DrawPixel(), isTrueColor, numBitmaps, and pixmaps.
Referenced by DrawPixel().
|
virtual |
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the given Color.
Reimplemented in cCursesOsd, and cHdffOsd.
Definition at line 2236 of file osd.c.
References bitmaps, DrawRectangle(), isTrueColor, numBitmaps, and pixmaps.
Referenced by DrawDeviceData(), DrawDevicePosition(), DrawDeviceSignal(), DrawEllipse(), DrawEllipseAlignments(), DrawEllipses(), DrawRectangle(), DrawSlope(), and DrawSlopes().
|
virtual |
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.
Definition at line 2216 of file osd.c.
References DoubleEqual(), DrawBitmap(), and cBitmap::Scaled().
Referenced by cDvbSubtitleBitmaps::Draw().
|
virtual |
Draws the given Image on this OSD at the given Point and scales it.
If AntiAlias is true and either of the factors is greater than 1.0, anti-aliasing is applied. If this is not a true color OSD, this function does nothing.
Definition at line 2184 of file osd.c.
References isTrueColor, and pixmaps.
|
virtual |
Draws the image referenced by the given ImageHandle on this OSD at the given Point and scales it.
ImageHandle must be a value that has previously been returned by a call to cOsdProvider::StoreImage(). If ImageHandle has an invalid value, nothing happens. If AntiAlias is true and either of the factors is greater than 1.0, anti-aliasing is applied. If this is not a true color OSD, this function does nothing.
Definition at line 2190 of file osd.c.
References isTrueColor, and pixmaps.
|
virtual |
Draws a "slope" into the rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the given Color.
Type controls the direction of the slope and which side of it will be drawn: 0: horizontal, rising, lower 1: horizontal, rising, upper 2: horizontal, falling, lower 3: horizontal, falling, upper 4: vertical, rising, lower 5: vertical, rising, upper 6: vertical, falling, lower 7: vertical, falling, upper
Reimplemented in cHdffOsd.
Definition at line 2256 of file osd.c.
References bitmaps, DrawSlope(), isTrueColor, numBitmaps, and pixmaps.
Referenced by DrawSlope(), and DrawSlope().
|
virtual |
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 will be drawn into a rectangle with the given size and the given Alignment (default is top-left). If ColorBg is clrTransparent, no background pixels will be drawn, which allows drawing "transparent" text.
Reimplemented in cCursesOsd, and cHdffOsd.
Definition at line 2226 of file osd.c.
References bitmaps, DrawText(), Font, Height(), isTrueColor, numBitmaps, pixmaps, and Width().
Referenced by DrawDeviceData(), DrawEllipseAlignments(), DrawText(), and DrawTextOutlined().
|
virtual |
Actually commits all data to the OSD hardware.
Flush() should return as soon as possible. For a true color OSD using the default implementation with in memory pixmaps, the Flush() function should basically do something like this:
LOCK_PIXMAPS; while (cPixmapMemory *pm = dynamic_cast<cPixmapMemory *>(RenderPixmaps())) { int w = pm->ViewPort().Width(); int h = pm->ViewPort().Height(); int d = w * sizeof(tColor); MyOsdDrawPixmap(Left() + pm->ViewPort().X(), Top() + pm->ViewPort().Y(), pm->Data(), w, h, h * d); DestroyPixmap(pm); }
If a plugin uses a derived cPixmap implementation, it needs to use that type instead of cPixmapMemory.
Reimplemented in cCursesOsd, cDvbSdFfOsd, cHdffOsd, and cHdffOsdRaw.
Definition at line 2266 of file osd.c.
Referenced by cDvbSubtitleBitmaps::Draw(), DrawEllipseAlignments(), DrawEllipses(), DrawImages(), and DrawSlopes().
|
protected |
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
If this is a true color OSD, a pointer to a dummy bitmap with 8bpp is returned. This is done so that skins that call this function in order to preset the bitmap's palette won't crash. Use of this function outside of derived classes is deprecated and it may be made 'protected' in a future version.
Definition at line 1967 of file osd.c.
References bitmaps, isTrueColor, and numBitmaps.
Referenced by cDvbSdFfOsd::Flush(), cHdffOsd::Flush(), cHdffOsdRaw::Flush(), cDvbSdFfOsd::SetActive(), cHdffOsd::SetActive(), cHdffOsdRaw::SetActive(), cDvbSdFfOsd::SetAreas(), and cHdffOsd::SetAreas().
|
inline |
Definition at line 845 of file osd.h.
References height.
Referenced by cDvbSdFfOsd::CanHandleAreas(), DrawEllipseAlignments(), DrawEllipses(), DrawImages(), DrawSlopes(), cCursesOsd::DrawText(), cHdffOsd::DrawText(), DrawText(), cDvbSdFfOsd::Flush(), SetAreas(), and SetOsdPosition().
|
inlinestatic |
Returns true if there is currently a level 0 OSD open.
Definition at line 837 of file osd.h.
References OSD_LEVEL_DEFAULT, and Osds.
Referenced by main(), cOsdProvider::NewOsd(), and cReplayControl::ShowMode().
|
inline |
Returns 'true' if this is a true color OSD (providing full 32 bit color depth).
Definition at line 839 of file osd.h.
References isTrueColor.
Referenced by cHdffOsdRaw::Flush().
|
inline |
Definition at line 842 of file osd.h.
References left.
Referenced by cCursesOsd::cCursesOsd(), cDvbSdFfOsd::cDvbSdFfOsd(), cHdffOsd::cHdffOsd(), cHdffOsdRaw::cHdffOsdRaw(), cOsd(), cDvbSdFfOsd::Flush(), cHdffOsdRaw::Flush(), and SetOsdPosition().
|
virtual |
Returns the maximum possible size of a pixmap this OSD can create.
Derived classes can reimplement this function if their implementation of cPixmap can only provide pixmaps up to a certain size. The default implementation returns a cSize object of maximal size (INT_MAX). However, memory restrictions may still apply.
Definition at line 1972 of file osd.c.
References maxPixmapSize.
Referenced by DrawImages().
|
inlinestatic |
Definition at line 831 of file osd.h.
References osdHeight, and Setup.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cTrueColorDemo::SetArea(), and cLineGame::Show().
|
inlinestatic |
Definition at line 828 of file osd.h.
References osdLeft, and Setup.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cLineGame::Show(), and cTrueColorDemo::Show().
|
inlinestatic |
Definition at line 829 of file osd.h.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cLineGame::Show(), and cTrueColorDemo::Show().
|
inlinestatic |
Definition at line 830 of file osd.h.
References osdWidth, and Setup.
Referenced by cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayMenu::cSkinLCARSDisplayMenu(), cSkinLCARSDisplayMessage::cSkinLCARSDisplayMessage(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cTrueColorDemo::SetArea(), cSkinClassicDisplayMessage::SetMessage(), and cLineGame::Show().
|
protected |
Renders the dirty part of all pixmaps into a resulting pixmap that shall be displayed on the OSD.
The returned pixmap's view port is set to the location of the rectangle on the OSD that needs to be refreshed; its draw port's origin is at (0, 0), and it has the same size as the view port. Only pixmaps with a non-negative layer value are rendered. If there are several non-overlapping dirty rectangles from different pixmaps, they are returned separately in order to avoid re-rendering large parts of the OSD that haven't changed at all. The caller must therefore call RenderPixmaps() repeatedly until it returns NULL, and display the returned parts of the OSD at their appropriate locations. During this entire operation the caller must hold a lock on the cPixmap mutex (for instance by putting a LOCK_PIXMAPS into the scope of the operation). If there are no dirty pixmaps, or if this is not a true color OSD, this function returns NULL. The caller must call DestroyPixmap() for the returned pixmap after use.
Definition at line 2019 of file osd.c.
References cPixmap::Clear(), cRect::Combine(), CreatePixmap(), cPixmap::DrawPixmap(), cPixmap::DrawPort(), cPixmapMemory::Fill(), cRect::Intersects(), cRect::IsEmpty(), isTrueColor, LOCK_PIXMAPS, MAXPIXMAPLAYERS, pixmaps, cRect::Point(), cPixmap::Render(), cPoint::Shifted(), and cPixmap::ViewPort().
Referenced by cHdffOsdRaw::Flush().
|
virtual |
Restores the region previously saved by a call to SaveRegion().
If SaveRegion() has not been called before, nothing will happen.
Reimplemented in cCursesOsd, and cHdffOsd.
Definition at line 2143 of file osd.c.
References DrawBitmap(), isTrueColor, pixmaps, savedBitmap, and savedPixmap.
|
virtual |
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
Only one saved region can be active at any given time.
Reimplemented in cCursesOsd, and cHdffOsd.
Definition at line 2127 of file osd.c.
References bitmaps, isTrueColor, numBitmaps, pixmaps, savedBitmap, and savedPixmap.
|
inlineprotectedvirtual |
Sets this OSD to be the active one.
A derived class must call cOsd::SetActive(On).
Reimplemented in cDvbSdFfOsd, cHdffOsd, and cHdffOsdRaw.
Definition at line 791 of file osd.h.
References active.
Referenced by cOsdProvider::NewOsd(), cDvbSdFfOsd::SetActive(), cHdffOsd::SetActive(), and cHdffOsdRaw::SetActive().
void cOsd::SetAntiAliasGranularity | ( | uint | FixedColors, |
uint | BlendColors ) |
Allows the system to optimize utilization of the limited color palette entries when generating blended colors for anti-aliasing.
FixedColors is the maximum number of colors used, and BlendColors is the maximum number of foreground/background color combinations used with anti-aliasing. If this function is not called with useful values, the palette may be filled up with many shades of a single color combination, and may not be able to serve all requested colors. By default the palette assumes there will be 10 fixed colors and 10 color combinations. If this is a true color OSD, this function does nothing.
Definition at line 1959 of file osd.c.
References bitmaps, isTrueColor, numBitmaps, and SetAntiAliasGranularity().
Referenced by CreateOsd(), and SetAntiAliasGranularity().
Sets the sub-areas to the given areas.
The return value indicates whether the operation was successful. If an error is reported, nothing will have changed and the previous OSD (if any) will still be displayed as before. If the OSD has been divided into several sub-areas, all areas that are part of the rectangle that surrounds a given drawing operation will be drawn into, with the proper offsets. A new call overwrites any previous settings To set up a true color OSD, exactly one area must be requested, with its coordinates set to the full area the OSD shall cover, and the bpp value set to 32.
Reimplemented in cDvbSdFfOsd, cHdffOsd, and cHdffOsdRaw.
Definition at line 2092 of file osd.c.
References bitmaps, tArea::bpp, CanHandleAreas(), cPixmap::Clear(), CreatePixmap(), esyslog, Height(), height, isTrueColor, max(), numBitmaps, oeOk, oeOutOfMemory, oeUnknown, OsdErrorTexts, pixmaps, Width(), width, tArea::x1, tArea::x2, tArea::y1, and tArea::y2.
Referenced by CreateOsd(), cDvbSubtitleBitmaps::Draw(), cDvbSdFfOsd::SetAreas(), cHdffOsd::SetAreas(), and cHdffOsdRaw::SetAreas().
|
static |
Sets the position and size of the OSD to the given values.
This may be useful for plugins that determine the scaling of the video image and need to scale the OSD accordingly to fit on the screen.
Definition at line 1951 of file osd.c.
References constrain(), Height(), Left(), MAXOSDHEIGHT, MAXOSDWIDTH, MINOSDHEIGHT, MINOSDWIDTH, osdHeight, osdLeft, osdTop, osdWidth, Top(), and Width().
Sets the Palette for the given Area (the first area is numbered 0).
If this is a true color OSD, nothing happens and oeOk is returned.
Definition at line 2161 of file osd.c.
References bitmaps, isTrueColor, numBitmaps, oeOk, and oeUnknown.
|
inline |
Definition at line 843 of file osd.h.
References top.
Referenced by cCursesOsd::cCursesOsd(), cDvbSdFfOsd::cDvbSdFfOsd(), cHdffOsd::cHdffOsd(), cHdffOsdRaw::cHdffOsdRaw(), cOsd(), cDvbSdFfOsd::Flush(), cHdffOsdRaw::Flush(), and SetOsdPosition().
|
inline |
Definition at line 844 of file osd.h.
References width.
Referenced by cDvbSdFfOsd::CanHandleAreas(), DrawEllipseAlignments(), DrawEllipses(), DrawImages(), DrawSlopes(), cCursesOsd::DrawText(), cHdffOsd::DrawText(), DrawText(), cDvbSdFfOsd::Flush(), SetAreas(), and SetOsdPosition().
|
friend |
|
private |
Definition at line 768 of file osd.h.
Referenced by Active(), cOsd(), and SetActive().
|
private |
Definition at line 762 of file osd.h.
Referenced by DrawBitmap(), DrawEllipse(), DrawPixel(), DrawRectangle(), DrawSlope(), DrawText(), GetBitmap(), SaveRegion(), SetAntiAliasGranularity(), SetAreas(), SetPalette(), and ~cOsd().
|
private |
Definition at line 766 of file osd.h.
Referenced by cOsd(), cHdffOsd::DrawBitmap(), cHdffOsdRaw::Flush(), Height(), and SetAreas().
|
private |
Definition at line 760 of file osd.h.
Referenced by cOsd(), CreatePixmap(), DrawBitmap(), DrawEllipse(), DrawImage(), DrawImage(), DrawPixel(), DrawRectangle(), DrawScaledImage(), DrawScaledImage(), DrawSlope(), DrawText(), GetBitmap(), IsTrueColor(), RenderPixmaps(), RestoreRegion(), SaveRegion(), SetAntiAliasGranularity(), SetAreas(), and SetPalette().
|
staticprivate |
Definition at line 758 of file osd.h.
Referenced by MaxPixmapSize().
|
staticprivate |
Definition at line 759 of file osd.h.
Referenced by cOsd(), cOsdProvider::NewOsd(), cOsdProvider::OsdSizeChanged(), cOsdProvider::UpdateOsdSize(), and ~cOsd().
|
private |
Definition at line 763 of file osd.h.
Referenced by cOsd(), DrawBitmap(), DrawEllipse(), DrawPixel(), DrawRectangle(), DrawSlope(), DrawText(), GetBitmap(), SaveRegion(), SetAntiAliasGranularity(), SetAreas(), SetPalette(), and ~cOsd().
|
staticprivate |
Definition at line 756 of file osd.h.
Referenced by OsdHeight(), and SetOsdPosition().
|
staticprivate |
Definition at line 756 of file osd.h.
Referenced by OsdLeft(), and SetOsdPosition().
|
staticprivate |
Definition at line 756 of file osd.h.
Referenced by OsdTop(), and SetOsdPosition().
|
staticprivate |
Definition at line 756 of file osd.h.
Referenced by OsdWidth(), and SetOsdPosition().
Definition at line 765 of file osd.h.
Referenced by AddPixmap(), DestroyPixmap(), DrawBitmap(), DrawEllipse(), DrawImage(), DrawImage(), DrawPixel(), DrawRectangle(), DrawScaledImage(), DrawScaledImage(), DrawSlope(), DrawText(), RenderPixmaps(), RestoreRegion(), SaveRegion(), SetAreas(), and ~cOsd().
|
private |
Definition at line 761 of file osd.h.
Referenced by cOsd(), RestoreRegion(), SaveRegion(), and ~cOsd().
|
private |
Definition at line 764 of file osd.h.
Referenced by cOsd(), RestoreRegion(), SaveRegion(), and ~cOsd().
|
private |
Definition at line 766 of file osd.h.
Referenced by cOsd(), cHdffOsd::DrawBitmap(), cHdffOsdRaw::Flush(), SetAreas(), and Width().