vdr  2.4.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
cOsd Class Reference

#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 cSizeMaxPixmapSize (void) const
 
virtual cPixmapCreatePixmap (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 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)
 
cPixmapAddPixmap (cPixmap *Pixmap)
 
cPixmapRenderPixmaps (void)
 
cBitmapGetBitmap (int Area)
 

Private Attributes

bool isTrueColor
 
cBitmapsavedBitmap
 
cBitmapbitmaps [MAXOSDAREAS]
 
int numBitmaps
 
cPixmapMemorysavedPixmap
 
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
 

Detailed Description

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.

Definition at line 724 of file osd.h.

Constructor & Destructor Documentation

◆ cOsd()

cOsd::cOsd ( int  Left,
int  Top,
uint  Level 
)
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 1650 of file osd.c.

References active, cVector< T >::Append(), height, cVector< T >::Insert(), isTrueColor, left, Left(), level, mutex, numBitmaps, Osds, savedBitmap, savedPixmap, cVector< T >::Size(), top, Top(), and width.

◆ ~cOsd()

cOsd::~cOsd ( )
virtual

Shuts down the OSD.

Definition at line 1671 of file osd.c.

References bitmaps, mutex, numBitmaps, Osds, pixmaps, cVector< T >::Remove(), savedBitmap, savedPixmap, and cVector< T >::Size().

Member Function Documentation

◆ Active()

bool cOsd::Active ( void  )
inlineprotected

◆ AddPixmap()

cPixmap * cOsd::AddPixmap ( cPixmap Pixmap)
protected

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 1745 of file osd.c.

References cVector< T >::Append(), LOCK_PIXMAPS, pixmaps, and cVector< T >::Size().

Referenced by CreatePixmap().

◆ CanHandleAreas()

eOsdError cOsd::CanHandleAreas ( const tArea Areas,
int  NumAreas 
)
virtual

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, cHdffOsdRaw, and cHdffOsd.

Definition at line 1809 of file osd.c.

References MAXOSDAREAS, oeAreasOverlap, oeOk, oeTooManyAreas, and oeWrongAlignment.

Referenced by cHdffOsd::CanHandleAreas(), cHdffOsdRaw::CanHandleAreas(), cDvbSdFfOsd::CanHandleAreas(), CreateOsd(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cDvbSubtitleBitmaps::Draw(), cDvbSpuDecoder::Draw(), cDvbSubtitleConverter::FinishPage(), SetAreas(), and cLineGame::Show().

◆ CreatePixmap()

cPixmap * cOsd::CreatePixmap ( int  Layer,
const cRect ViewPort,
const cRect DrawPort = cRect::Null 
)
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 1716 of file osd.c.

References AddPixmap(), isTrueColor, and LOCK_PIXMAPS.

Referenced by cTrueColorDemo::Action(), cTrueColorDemo::CreateTextPixmap(), RenderPixmaps(), and SetAreas().

◆ DestroyPixmap()

void cOsd::DestroyPixmap ( cPixmap Pixmap)
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 1728 of file osd.c.

References esyslog, cPixmap::Layer(), LOCK_PIXMAPS, pixmaps, cVector< T >::Size(), and cPixmap::ViewPort().

Referenced by cHdffOsdRaw::Flush(), and cTrueColorDemo::ProcessKey().

◆ DrawBitmap()

void cOsd::DrawBitmap ( int  x,
int  y,
const cBitmap Bitmap,
tColor  ColorFg = 0,
tColor  ColorBg = 0,
bool  ReplacePalette = false,
bool  Overlay = false 
)
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 1933 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and pixmaps.

Referenced by cDvbSpuDecoder::Draw(), cSkinLCARSDisplayMenu::DrawLiveIndicator(), DrawScaledBitmap(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), RestoreRegion(), cSkinLCARSDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinLCARSDisplayReplay::SetMode(), cSkinSTTNGDisplayReplay::SetMode(), cSkinClassicDisplayReplay::SetProgress(), cSkinLCARSDisplayReplay::SetProgress(), cSkinSTTNGDisplayReplay::SetProgress(), cSkinLCARSDisplayVolume::SetVolume(), and cSkinSTTNGDisplayVolume::SetVolume().

◆ DrawEllipse()

void cOsd::DrawEllipse ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color,
int  Quadrants = 0 
)
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 1973 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and pixmaps.

Referenced by cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), DrawDevicePosition(), DrawEllipse(), cSkinLCARSDisplayMenu::DrawLiveIndicator(), cSkinLCARSDisplayMenu::DrawMainBracket(), cSkinLCARSDisplayMenu::DrawMainButton(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMainFrameUpper(), cSkinLCARSDisplayMenu::DrawMenuFrame(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawStatusElbows(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinLCARSDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinLCARSDisplayMessage::SetMessage(), cSkinLCARSDisplayMenu::SetRecording(), and cSkinSTTNGDisplayMenu::SetRecording().

◆ DrawImage() [1/2]

void cOsd::DrawImage ( const cPoint Point,
const cImage Image 
)
virtual

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 1911 of file osd.c.

References isTrueColor, and pixmaps.

Referenced by DrawImages().

◆ DrawImage() [2/2]

void cOsd::DrawImage ( const cPoint Point,
int  ImageHandle 
)
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 1917 of file osd.c.

References isTrueColor, and pixmaps.

◆ DrawPixel()

void cOsd::DrawPixel ( int  x,
int  y,
tColor  Color 
)
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 1923 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and pixmaps.

◆ DrawRectangle()

void cOsd::DrawRectangle ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color 
)
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 1963 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and pixmaps.

Referenced by cSkinCursesDisplayMenu::Clear(), cSkinClassicDisplayMenu::Clear(), cSkinLCARSDisplayMenu::Clear(), cSkinSTTNGDisplayMenu::Clear(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinCursesDisplayChannel::cSkinCursesDisplayChannel(), cSkinCursesDisplayMenu::cSkinCursesDisplayMenu(), cSkinCursesDisplayReplay::cSkinCursesDisplayReplay(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinLCARSDisplayChannel::cSkinLCARSDisplayChannel(), cSkinLCARSDisplayReplay::cSkinLCARSDisplayReplay(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinLCARSDisplayVolume::cSkinLCARSDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cSkinLCARSDisplayMenu::DrawDevice(), DrawDeviceData(), DrawDevicePosition(), DrawDeviceSignal(), DrawEllipse(), DrawEllipses(), cSkinLCARSDisplayMenu::DrawFrameDisplay(), cSkinLCARSDisplayMenu::DrawLiveIndicator(), cSkinLCARSDisplayMenu::DrawMainBracket(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMainFrameUpper(), cSkinLCARSDisplayMenu::DrawMenuFrame(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayChannel::DrawSeen(), cSkinLCARSDisplayMenu::DrawSeen(), DrawSlope(), DrawSlopes(), cSkinLCARSDisplayMenu::DrawStatusElbows(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinLCARSDisplayMenu::DrawTimers(), cSkinSTTNGDisplayChannel::Flush(), cLineGame::ProcessKey(), cSkinLCARSDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinCursesDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinCursesDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinLCARSDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinLCARSDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinLCARSDisplayMenu::SetMenuCategory(), cSkinCursesDisplayMenu::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinLCARSDisplayChannel::SetMessage(), cSkinLCARSDisplayMessage::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinCursesDisplayReplay::SetProgress(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetTitle(), cSkinCursesDisplayVolume::SetVolume(), cSkinClassicDisplayVolume::SetVolume(), cSkinLCARSDisplayVolume::SetVolume(), cSkinSTTNGDisplayVolume::SetVolume(), cLineGame::Show(), and cTrueColorDemo::Show().

◆ DrawScaledBitmap()

void cOsd::DrawScaledBitmap ( int  x,
int  y,
const cBitmap Bitmap,
double  FactorX,
double  FactorY,
bool  AntiAlias = false 
)
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 1943 of file osd.c.

References DoubleEqual(), DrawBitmap(), and cBitmap::Scaled().

Referenced by cDvbSubtitleBitmaps::Draw().

◆ DrawSlope()

void cOsd::DrawSlope ( int  x1,
int  y1,
int  x2,
int  y2,
tColor  Color,
int  Type 
)
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 1983 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and pixmaps.

Referenced by DrawSlope().

◆ DrawText()

void cOsd::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

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 1953 of file osd.c.

References bitmaps, Font, Height(), isTrueColor, numBitmaps, pixmaps, and Width().

Referenced by cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinLCARSDisplayTracks::cSkinLCARSDisplayTracks(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinLCARSDisplayChannel::DrawDate(), cSkinLCARSDisplayMenu::DrawDate(), cSkinLCARSDisplayReplay::DrawDate(), DrawDeviceData(), cSkinLCARSDisplayMenu::DrawDisk(), cSkinLCARSDisplayMenu::DrawFrameDisplay(), cSkinLCARSDisplayMenu::DrawInfo(), cSkinLCARSDisplayMenu::DrawLive(), cSkinLCARSDisplayMenu::DrawLoad(), cSkinLCARSDisplayMenu::DrawMainButton(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMenuFrame(), cSkinLCARSDisplayMenu::DrawPlay(), cSkinLCARSDisplayMenu::DrawStatusElbows(), cTextScroller::DrawText(), DrawTextOutlined(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinLCARSDisplayMenu::DrawTimers(), cSkinCursesDisplayMenu::DrawTitle(), cSkinClassicDisplayMenu::DrawTitle(), cSkinSTTNGDisplayMenu::DrawTitle(), cSkinLCARSDisplayChannel::DrawTrack(), cSkinLCARSDisplayReplay::DrawTrack(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinCursesDisplayMenu::SetButtons(), cSkinClassicDisplayMenu::SetButtons(), cSkinLCARSDisplayMenu::SetButtons(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinCursesDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinCursesDisplayReplay::SetCurrent(), cSkinClassicDisplayReplay::SetCurrent(), cSkinLCARSDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinCursesDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinCursesDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinLCARSDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinCursesDisplayTracks::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinCursesDisplayMenu::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinLCARSDisplayMenu::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinCursesDisplayReplay::SetJump(), cSkinClassicDisplayReplay::SetJump(), cSkinLCARSDisplayReplay::SetJump(), cSkinSTTNGDisplayReplay::SetJump(), cSkinCursesDisplayChannel::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), cSkinCursesDisplayMessage::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinLCARSDisplayChannel::SetMessage(), cSkinLCARSDisplayMenu::SetMessage(), cSkinLCARSDisplayReplay::SetMessage(), cSkinLCARSDisplayMessage::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinCursesDisplayMenu::SetRecording(), cSkinClassicDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinCursesDisplayReplay::SetTitle(), cSkinClassicDisplayReplay::SetTitle(), cSkinLCARSDisplayMenu::SetTitle(), cSkinLCARSDisplayReplay::SetTitle(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinCursesDisplayReplay::SetTotal(), cSkinClassicDisplayReplay::SetTotal(), cSkinLCARSDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinCursesDisplayVolume::SetVolume(), and cSkinClassicDisplayVolume::SetVolume().

◆ Flush()

void cOsd::Flush ( void  )
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, cHdffOsdRaw, and cHdffOsd.

Definition at line 1993 of file osd.c.

Referenced by cTrueColorDemo::Action(), cPictureControl::DisplayCaption(), cDvbSubtitleBitmaps::Draw(), cDvbSpuDecoder::Draw(), DrawEllipses(), DrawImages(), DrawSlopes(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinCursesDisplayReplay::Flush(), cSkinCursesDisplayVolume::Flush(), cSkinCursesDisplayTracks::Flush(), cSkinCursesDisplayMessage::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayReplay::Flush(), cSkinClassicDisplayVolume::Flush(), cSkinClassicDisplayTracks::Flush(), cSkinClassicDisplayMessage::Flush(), cSkinLCARSDisplayChannel::Flush(), cSkinLCARSDisplayMenu::Flush(), cSkinLCARSDisplayReplay::Flush(), cSkinLCARSDisplayVolume::Flush(), cSkinLCARSDisplayTracks::Flush(), cSkinLCARSDisplayMessage::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayReplay::Flush(), cSkinSTTNGDisplayVolume::Flush(), cSkinSTTNGDisplayTracks::Flush(), cSkinSTTNGDisplayMessage::Flush(), cLineGame::ProcessKey(), cLineGame::Show(), and cTrueColorDemo::Show().

◆ GetBitmap()

cBitmap * cOsd::GetBitmap ( int  Area)
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 1706 of file osd.c.

References bitmaps, isTrueColor, and numBitmaps.

Referenced by cHdffOsd::Flush(), cHdffOsdRaw::Flush(), cDvbSdFfOsd::Flush(), cHdffOsd::SetActive(), cHdffOsdRaw::SetActive(), cDvbSdFfOsd::SetActive(), cHdffOsd::SetAreas(), and cDvbSdFfOsd::SetAreas().

◆ Height()

int cOsd::Height ( void  )
inline

◆ IsOpen()

static int cOsd::IsOpen ( void  )
inlinestatic

Returns true if there is currently a level 0 OSD open.

Definition at line 814 of file osd.h.

References OSD_LEVEL_DEFAULT, Osds, and cVector< T >::Size().

Referenced by main(), cOsdProvider::NewOsd(), and cReplayControl::ShowMode().

◆ IsTrueColor()

bool cOsd::IsTrueColor ( void  ) const
inline

Returns 'true' if this is a true color OSD (providing full 32 bit color depth).

Definition at line 816 of file osd.h.

References isTrueColor.

Referenced by cHdffOsdRaw::Flush().

◆ Left()

int cOsd::Left ( void  )
inline

Definition at line 819 of file osd.h.

References left.

Referenced by cHdffOsd::cHdffOsd(), cOsd(), cHdffOsdRaw::Flush(), cDvbSdFfOsd::Flush(), and SetOsdPosition().

◆ MaxPixmapSize()

const cSize & cOsd::MaxPixmapSize ( void  ) const
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 1711 of file osd.c.

References maxPixmapSize.

Referenced by cTrueColorDemo::Action(), and DrawImages().

◆ OsdHeight()

static int cOsd::OsdHeight ( void  )
inlinestatic

◆ OsdLeft()

static int cOsd::OsdLeft ( void  )
inlinestatic

◆ OsdTop()

static int cOsd::OsdTop ( void  )
inlinestatic

◆ OsdWidth()

static int cOsd::OsdWidth ( void  )
inlinestatic

◆ RenderPixmaps()

cPixmap * cOsd::RenderPixmaps ( void  )
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 1758 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(), cVector< T >::Size(), and cPixmap::ViewPort().

Referenced by cHdffOsdRaw::Flush().

◆ RestoreRegion()

void cOsd::RestoreRegion ( void  )
virtual

◆ SaveRegion()

void cOsd::SaveRegion ( int  x1,
int  y1,
int  x2,
int  y2 
)
virtual

◆ SetActive()

virtual void cOsd::SetActive ( bool  On)
inlineprotectedvirtual

Sets this OSD to be the active one.

A derived class must call cOsd::SetActive(On).

Reimplemented in cDvbSdFfOsd, cHdffOsdRaw, and cHdffOsd.

Definition at line 762 of file osd.h.

References active.

Referenced by cOsdProvider::NewOsd(), cHdffOsd::SetActive(), cHdffOsdRaw::SetActive(), and cDvbSdFfOsd::SetActive().

◆ SetAntiAliasGranularity()

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 1698 of file osd.c.

References bitmaps, isTrueColor, and numBitmaps.

Referenced by CreateOsd().

◆ SetAreas()

eOsdError cOsd::SetAreas ( const tArea Areas,
int  NumAreas 
)
virtual

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, cHdffOsdRaw, and cHdffOsd.

Definition at line 1831 of file osd.c.

References bitmaps, tArea::bpp, CanHandleAreas(), cPixmap::Clear(), CreatePixmap(), esyslog, height, Height(), isTrueColor, max(), numBitmaps, oeOk, oeOutOfMemory, oeUnknown, OsdErrorTexts, pixmaps, cVector< T >::Size(), width, Width(), tArea::x1, tArea::x2, tArea::y1, and tArea::y2.

Referenced by CreateOsd(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayMessage::cSkinClassicDisplayMessage(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinClassicDisplayVolume::cSkinClassicDisplayVolume(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cDvbSubtitleBitmaps::Draw(), cDvbSpuDecoder::Draw(), cTrueColorDemo::SetArea(), cHdffOsd::SetAreas(), cHdffOsdRaw::SetAreas(), cDvbSdFfOsd::SetAreas(), and cLineGame::Show().

◆ SetOsdPosition()

void cOsd::SetOsdPosition ( int  Left,
int  Top,
int  Width,
int  Height 
)
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 1690 of file osd.c.

References constrain(), Height(), Left(), MAXOSDHEIGHT, MAXOSDWIDTH, MINOSDHEIGHT, MINOSDWIDTH, osdHeight, osdLeft, osdTop, osdWidth, Top(), and Width().

◆ SetPalette()

eOsdError cOsd::SetPalette ( const cPalette Palette,
int  Area 
)
virtual

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 1900 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, oeOk, oeUnknown, and cPalette::Take().

◆ Top()

int cOsd::Top ( void  )
inline

Definition at line 820 of file osd.h.

References top.

Referenced by cHdffOsd::cHdffOsd(), cOsd(), cHdffOsdRaw::Flush(), cDvbSdFfOsd::Flush(), and SetOsdPosition().

◆ Width()

int cOsd::Width ( void  )
inline

Friends And Related Function Documentation

◆ cOsdProvider

friend class cOsdProvider
friend

Definition at line 725 of file osd.h.

Member Data Documentation

◆ active

bool cOsd::active
private

Definition at line 739 of file osd.h.

Referenced by Active(), cOsd(), and SetActive().

◆ bitmaps

cBitmap* cOsd::bitmaps[MAXOSDAREAS]
private

◆ height

int cOsd::height
private

Definition at line 737 of file osd.h.

Referenced by cOsd(), cHdffOsd::DrawBitmap(), cHdffOsdRaw::Flush(), Height(), and SetAreas().

◆ isTrueColor

bool cOsd::isTrueColor
private

◆ left

int cOsd::left
private

Definition at line 737 of file osd.h.

Referenced by cOsd(), and Left().

◆ level

uint cOsd::level
private

Definition at line 738 of file osd.h.

Referenced by cOsd().

◆ maxPixmapSize

cSize cOsd::maxPixmapSize
staticprivate

Definition at line 729 of file osd.h.

Referenced by MaxPixmapSize().

◆ mutex

cMutex cOsd::mutex
staticprivate

◆ numBitmaps

int cOsd::numBitmaps
private

◆ osdHeight

int cOsd::osdHeight = 0
staticprivate

Definition at line 727 of file osd.h.

Referenced by OsdHeight(), and SetOsdPosition().

◆ osdLeft

int cOsd::osdLeft = 0
staticprivate

Definition at line 727 of file osd.h.

Referenced by OsdLeft(), and SetOsdPosition().

◆ Osds

cVector< cOsd * > cOsd::Osds
staticprivate

Definition at line 728 of file osd.h.

Referenced by cOsd(), IsOpen(), cOsdProvider::NewOsd(), and ~cOsd().

◆ osdTop

int cOsd::osdTop = 0
staticprivate

Definition at line 727 of file osd.h.

Referenced by OsdTop(), and SetOsdPosition().

◆ osdWidth

int cOsd::osdWidth = 0
staticprivate

Definition at line 727 of file osd.h.

Referenced by OsdWidth(), and SetOsdPosition().

◆ pixmaps

cVector<cPixmap *> cOsd::pixmaps
private

◆ savedBitmap

cBitmap* cOsd::savedBitmap
private

Definition at line 732 of file osd.h.

Referenced by cOsd(), RestoreRegion(), SaveRegion(), and ~cOsd().

◆ savedPixmap

cPixmapMemory* cOsd::savedPixmap
private

Definition at line 735 of file osd.h.

Referenced by cOsd(), RestoreRegion(), SaveRegion(), and ~cOsd().

◆ top

int cOsd::top
private

Definition at line 737 of file osd.h.

Referenced by cOsd(), and Top().

◆ width

int cOsd::width
private

Definition at line 737 of file osd.h.

Referenced by cOsd(), cHdffOsd::DrawBitmap(), cHdffOsdRaw::Flush(), SetAreas(), and Width().


The documentation for this class was generated from the following files: