vdr 2.6.8
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 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)
 
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 753 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 1911 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 1932 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 2006 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, 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(), 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(), cDvbSpuDecoder::Draw(), cDvbSubtitleBitmaps::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 1977 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 1989 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 2206 of file osd.c.

References bitmaps, DrawBitmap(), isTrueColor, numBitmaps, and pixmaps.

Referenced by cDvbSpuDecoder::Draw(), DrawBitmap(), 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 2246 of file osd.c.

References bitmaps, DrawEllipse(), 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(), DrawEllipse(), DrawEllipseAlignments(), cSkinLCARSDisplayMenu::DrawLiveIndicator(), cSkinLCARSDisplayMenu::DrawMainBracket(), cSkinLCARSDisplayMenu::DrawMainButton(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMainFrameUpper(), cSkinLCARSDisplayMenu::DrawMenuFrame(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::DrawStatusElbows(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetItem(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayTracks::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 2172 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 2178 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 2196 of file osd.c.

References bitmaps, DrawPixel(), isTrueColor, numBitmaps, and pixmaps.

Referenced by DrawPixel().

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

References bitmaps, DrawRectangle(), isTrueColor, numBitmaps, and pixmaps.

Referenced by cSkinClassicDisplayMenu::Clear(), cSkinCursesDisplayMenu::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(), DrawEllipseAlignments(), DrawEllipses(), cSkinLCARSDisplayMenu::DrawFrameDisplay(), cSkinLCARSDisplayMenu::DrawLiveIndicator(), cSkinLCARSDisplayMenu::DrawMainBracket(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMainFrameUpper(), cSkinLCARSDisplayMenu::DrawMenuFrame(), DrawRectangle(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinLCARSDisplayMenu::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(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinLCARSDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinLCARSDisplayMenu::SetItem(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinLCARSDisplayMenu::SetMenuCategory(), cSkinClassicDisplayMenu::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinLCARSDisplayChannel::SetMessage(), cSkinLCARSDisplayMessage::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinCursesDisplayReplay::SetProgress(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetTitle(), cSkinClassicDisplayVolume::SetVolume(), cSkinCursesDisplayVolume::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 2216 of file osd.c.

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

Referenced by cDvbSubtitleBitmaps::Draw().

◆ DrawScaledImage() [1/2]

void cOsd::DrawScaledImage ( const cPoint & Point,
const cImage & Image,
double FactorX,
double FactorY,
bool AntiAlias = false )
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.

◆ DrawScaledImage() [2/2]

void cOsd::DrawScaledImage ( const cPoint & Point,
int ImageHandle,
double FactorX,
double FactorY,
bool AntiAlias = false )
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.

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

References bitmaps, DrawSlope(), isTrueColor, numBitmaps, and pixmaps.

Referenced by DrawSlope(), and 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 2226 of file osd.c.

References bitmaps, DrawText(), 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(), DrawEllipseAlignments(), cSkinLCARSDisplayMenu::DrawFrameDisplay(), cSkinLCARSDisplayMenu::DrawInfo(), cSkinLCARSDisplayMenu::DrawLive(), cSkinLCARSDisplayMenu::DrawLoad(), cSkinLCARSDisplayMenu::DrawMainButton(), cSkinLCARSDisplayMenu::DrawMainFrameLower(), cSkinLCARSDisplayMenu::DrawMenuFrame(), cSkinLCARSDisplayMenu::DrawPlay(), cSkinLCARSDisplayMenu::DrawStatusElbows(), DrawText(), cTextScroller::DrawText(), DrawTextOutlined(), cSkinLCARSDisplayMenu::DrawTimer(), cSkinLCARSDisplayMenu::DrawTimers(), cSkinClassicDisplayMenu::DrawTitle(), cSkinCursesDisplayMenu::DrawTitle(), cSkinSTTNGDisplayMenu::DrawTitle(), cSkinLCARSDisplayChannel::DrawTrack(), cSkinLCARSDisplayReplay::DrawTrack(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinClassicDisplayMenu::SetButtons(), cSkinCursesDisplayMenu::SetButtons(), cSkinLCARSDisplayMenu::SetButtons(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinLCARSDisplayChannel::SetChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayReplay::SetCurrent(), cSkinCursesDisplayReplay::SetCurrent(), cSkinLCARSDisplayReplay::SetCurrent(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinLCARSDisplayChannel::SetEvents(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayMenu::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinCursesDisplayMenu::SetItem(), cSkinCursesDisplayTracks::SetItem(), cSkinLCARSDisplayMenu::SetItem(), cSkinLCARSDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayTracks::SetItem(), cSkinClassicDisplayReplay::SetJump(), cSkinCursesDisplayReplay::SetJump(), cSkinLCARSDisplayReplay::SetJump(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinCursesDisplayChannel::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayMessage::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), cSkinLCARSDisplayChannel::SetMessage(), cSkinLCARSDisplayMenu::SetMessage(), cSkinLCARSDisplayMessage::SetMessage(), cSkinLCARSDisplayReplay::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinClassicDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinLCARSDisplayReplay::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinClassicDisplayReplay::SetTitle(), cSkinCursesDisplayReplay::SetTitle(), cSkinLCARSDisplayMenu::SetTitle(), cSkinLCARSDisplayReplay::SetTitle(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinClassicDisplayReplay::SetTotal(), cSkinCursesDisplayReplay::SetTotal(), cSkinLCARSDisplayReplay::SetTotal(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinClassicDisplayVolume::SetVolume(), and cSkinCursesDisplayVolume::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, cHdffOsd, and cHdffOsdRaw.

Definition at line 2266 of file osd.c.

Referenced by cTrueColorDemo::Action(), cPictureControl::DisplayCaption(), cDvbSpuDecoder::Draw(), cDvbSubtitleBitmaps::Draw(), DrawEllipseAlignments(), DrawEllipses(), DrawImages(), DrawSlopes(), cSkinClassicDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayMessage::Flush(), cSkinClassicDisplayReplay::Flush(), cSkinClassicDisplayTracks::Flush(), cSkinClassicDisplayVolume::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinCursesDisplayMessage::Flush(), cSkinCursesDisplayReplay::Flush(), cSkinCursesDisplayTracks::Flush(), cSkinCursesDisplayVolume::Flush(), cSkinLCARSDisplayChannel::Flush(), cSkinLCARSDisplayMenu::Flush(), cSkinLCARSDisplayMessage::Flush(), cSkinLCARSDisplayReplay::Flush(), cSkinLCARSDisplayTracks::Flush(), cSkinLCARSDisplayVolume::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayMessage::Flush(), cSkinSTTNGDisplayReplay::Flush(), cSkinSTTNGDisplayTracks::Flush(), cSkinSTTNGDisplayVolume::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 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().

◆ Height()

◆ IsOpen()

static int cOsd::IsOpen ( void )
inlinestatic

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

Definition at line 837 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 839 of file osd.h.

References isTrueColor.

Referenced by cHdffOsdRaw::Flush().

◆ Left()

int cOsd::Left ( void )
inline

Definition at line 842 of file osd.h.

References left.

Referenced by cHdffOsd::cHdffOsd(), cOsd(), cDvbSdFfOsd::Flush(), cHdffOsdRaw::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 1972 of file osd.c.

References maxPixmapSize.

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

◆ OsdHeight()

◆ OsdLeft()

◆ OsdTop()

◆ OsdWidth()

◆ 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 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(), cVector< T >::Size(), and cPixmap::ViewPort().

Referenced by cHdffOsdRaw::Flush().

◆ RestoreRegion()

◆ SaveRegion()

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

Definition at line 791 of file osd.h.

References active.

Referenced by cOsdProvider::NewOsd(), cDvbSdFfOsd::SetActive(), cHdffOsd::SetActive(), and cHdffOsdRaw::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 1959 of file osd.c.

References bitmaps, isTrueColor, numBitmaps, and SetAntiAliasGranularity().

Referenced by CreateOsd(), and SetAntiAliasGranularity().

◆ 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, 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, 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(), cDvbSpuDecoder::Draw(), cDvbSubtitleBitmaps::Draw(), cTrueColorDemo::SetArea(), cDvbSdFfOsd::SetAreas(), cHdffOsd::SetAreas(), cHdffOsdRaw::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 1951 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 2161 of file osd.c.

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

◆ Top()

int cOsd::Top ( void )
inline

Definition at line 843 of file osd.h.

References top.

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

◆ Width()

Friends And Related Symbol Documentation

◆ cOsdProvider

friend class cOsdProvider
friend

Definition at line 754 of file osd.h.

Member Data Documentation

◆ active

bool cOsd::active
private

Definition at line 768 of file osd.h.

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

◆ bitmaps

◆ height

int cOsd::height
private

Definition at line 766 of file osd.h.

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

◆ isTrueColor

◆ left

int cOsd::left
private

Definition at line 766 of file osd.h.

Referenced by cOsd(), and Left().

◆ level

uint cOsd::level
private

Definition at line 767 of file osd.h.

Referenced by cOsd().

◆ maxPixmapSize

cSize cOsd::maxPixmapSize
staticprivate

Definition at line 758 of file osd.h.

Referenced by MaxPixmapSize().

◆ mutex

cMutex cOsd::mutex
staticprivate

◆ numBitmaps

◆ osdHeight

int cOsd::osdHeight = 0
staticprivate

Definition at line 756 of file osd.h.

Referenced by OsdHeight(), and SetOsdPosition().

◆ osdLeft

int cOsd::osdLeft = 0
staticprivate

Definition at line 756 of file osd.h.

Referenced by OsdLeft(), and SetOsdPosition().

◆ Osds

cVector< cOsd * > cOsd::Osds
staticprivate

Definition at line 757 of file osd.h.

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

◆ osdTop

int cOsd::osdTop = 0
staticprivate

Definition at line 756 of file osd.h.

Referenced by OsdTop(), and SetOsdPosition().

◆ osdWidth

int cOsd::osdWidth = 0
staticprivate

Definition at line 756 of file osd.h.

Referenced by OsdWidth(), and SetOsdPosition().

◆ pixmaps

◆ savedBitmap

cBitmap* cOsd::savedBitmap
private

Definition at line 761 of file osd.h.

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

◆ savedPixmap

cPixmapMemory* cOsd::savedPixmap
private

Definition at line 764 of file osd.h.

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

◆ top

int cOsd::top
private

Definition at line 766 of file osd.h.

Referenced by cOsd(), and Top().

◆ width

int cOsd::width
private

Definition at line 766 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: