cOsd Class Reference

#include <osd.h>

Inheritance diagram for cOsd:

Inheritance graph
[legend]
Collaboration diagram for cOsd:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~cOsd ()
 Shuts down the OSD.
int Left (void)
int Top (void)
int Width (void)
int Height (void)
void SetAntiAliasGranularity (uint FixedColors, uint BlendColors)
cBitmapGetBitmap (int Area)
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)
 Sets the Palette for the given Area (the first area is numbered 0).
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 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)
 Actually commits all data to the OSD hardware.

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)
 Returns true if there is currently a level 0 OSD open.

Protected Member Functions

 cOsd (int Left, int Top, uint Level)
bool Active (void)
virtual void SetActive (bool On)

Private Attributes

cBitmapsavedRegion
cBitmapbitmaps [MAXOSDAREAS]
int numBitmaps
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

Friends

class cOsdProvider


Detailed Description

Definition at line 261 of file osd.h.


Constructor & Destructor Documentation

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, repectively). 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 724 of file osd.c.

References active, cVector< T >::Append(), height, cVector< T >::Insert(), left, level, numBitmaps, Osds, savedRegion, cVector< T >::Size(), top, and width.

Here is the call graph for this function:

cOsd::~cOsd (  )  [virtual]

Shuts down the OSD.

Definition at line 742 of file osd.c.

References bitmaps, numBitmaps, Osds, cVector< T >::Remove(), savedRegion, SetActive(), and cVector< T >::Size().

Here is the call graph for this function:


Member Function Documentation

bool cOsd::Active ( void   )  [inline, protected]

Definition at line 293 of file osd.h.

References active.

Referenced by cDvbOsd::Flush(), and cDvbOsd::SetActive().

virtual void cOsd::SetActive ( bool  On  )  [inline, protected, virtual]

Sets this OSD to be the active one. A derived class must call cOsd::SetActive(On).

Reimplemented in cDvbOsd.

Definition at line 294 of file osd.h.

References active.

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

static int cOsd::OsdLeft ( void   )  [inline, static]

static int cOsd::OsdTop ( void   )  [inline, static]

static int cOsd::OsdWidth ( void   )  [inline, static]

static int cOsd::OsdHeight ( void   )  [inline, static]

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

References max(), MAXOSDHEIGHT, MAXOSDWIDTH, min(), MINOSDHEIGHT, MINOSDWIDTH, osdHeight, osdLeft, osdTop, and osdWidth.

Here is the call graph for this function:

static int cOsd::IsOpen ( void   )  [inline, static]

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

Definition at line 309 of file osd.h.

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

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

Here is the call graph for this function:

int cOsd::Left ( void   )  [inline]

Definition at line 311 of file osd.h.

References left.

Referenced by cDvbOsd::Flush().

int cOsd::Top ( void   )  [inline]

Definition at line 312 of file osd.h.

References top.

Referenced by cDvbOsd::Flush().

int cOsd::Width ( void   )  [inline]

int cOsd::Height ( void   )  [inline]

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.

Definition at line 765 of file osd.c.

References bitmaps, and numBitmaps.

cBitmap * cOsd::GetBitmap ( int  Area  ) 

Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.

Definition at line 771 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cDvbOsd::Flush(), cDvbOsd::SetActive(), and cDvbOsd::SetAreas().

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

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

Reimplemented in cDvbOsd.

Definition at line 794 of file osd.c.

References bitmaps, CanHandleAreas(), esyslog, Height(), height, max(), numBitmaps, oeOk, Width(), and width.

Referenced by 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(), cDvbOsd::SetAreas(), and cLineGame::Show().

Here is the call graph for this function:

void cOsd::SaveRegion ( int  x1,
int  y1,
int  x2,
int  y2 
) [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.

Definition at line 812 of file osd.c.

References bitmaps, cBitmap::DrawBitmap(), numBitmaps, savedRegion, cBitmap::X0(), and cBitmap::Y0().

Referenced by cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), and cSkinCursesDisplayChannel::SetMessage().

Here is the call graph for this function:

void cOsd::RestoreRegion ( void   )  [virtual]

Restores the region previously saved by a call to SaveRegion(). If SaveRegion() has not been called before, nothing will happen.

Reimplemented in cCursesOsd.

Definition at line 820 of file osd.c.

References DrawBitmap(), savedRegion, cBitmap::X0(), and cBitmap::Y0().

Referenced by cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), and cSkinCursesDisplayChannel::SetMessage().

Here is the call graph for this function:

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

Sets the Palette for the given Area (the first area is numbered 0).

Definition at line 829 of file osd.c.

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

Here is the call graph for this function:

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.

Definition at line 836 of file osd.c.

References bitmaps, and numBitmaps.

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.

Definition at line 842 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cDvbSubtitleBitmaps::Draw(), cDvbSpuDecoder::Draw(), cSkinSTTNGDisplayMenu::DrawScrollbar(), RestoreRegion(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinSTTNGDisplayReplay::SetMode(), cSkinSTTNGDisplayReplay::SetProgress(), cSkinClassicDisplayReplay::SetProgress(), and cSkinSTTNGDisplayVolume::SetVolume().

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.

Definition at line 848 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinClassicDisplayTracks::cSkinClassicDisplayTracks(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cTextScroller::DrawText(), DrawTextOutlined(), cSkinSTTNGDisplayMenu::Flush(), cSkinSTTNGDisplayChannel::Flush(), cSkinClassicDisplayMenu::Flush(), cSkinClassicDisplayChannel::Flush(), cSkinCursesDisplayMenu::Flush(), cSkinCursesDisplayChannel::Flush(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinClassicDisplayMenu::SetButtons(), cSkinCursesDisplayMenu::SetButtons(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinSTTNGDisplayReplay::SetCurrent(), cSkinClassicDisplayReplay::SetCurrent(), cSkinCursesDisplayReplay::SetCurrent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetEvent(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinClassicDisplayTracks::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinCursesDisplayTracks::SetItem(), cSkinCursesDisplayMenu::SetItem(), cSkinSTTNGDisplayReplay::SetJump(), cSkinClassicDisplayReplay::SetJump(), cSkinCursesDisplayReplay::SetJump(), cSkinSTTNGDisplayMessage::SetMessage(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayMenu::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMessage::SetMessage(), cSkinClassicDisplayReplay::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinClassicDisplayChannel::SetMessage(), cSkinCursesDisplayMessage::SetMessage(), cSkinCursesDisplayReplay::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayChannel::SetMessage(), cSkinSTTNGDisplayReplay::SetTitle(), cSkinSTTNGDisplayMenu::SetTitle(), cSkinClassicDisplayReplay::SetTitle(), cSkinClassicDisplayMenu::SetTitle(), cSkinCursesDisplayReplay::SetTitle(), cSkinCursesDisplayMenu::SetTitle(), cSkinSTTNGDisplayReplay::SetTotal(), cSkinClassicDisplayReplay::SetTotal(), cSkinCursesDisplayReplay::SetTotal(), cSkinClassicDisplayVolume::SetVolume(), and cSkinCursesDisplayVolume::SetVolume().

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.

Definition at line 854 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinSTTNGDisplayMenu::Clear(), cSkinClassicDisplayMenu::Clear(), cSkinCursesDisplayMenu::Clear(), cSkinClassicDisplayChannel::cSkinClassicDisplayChannel(), cSkinClassicDisplayMenu::cSkinClassicDisplayMenu(), cSkinClassicDisplayReplay::cSkinClassicDisplayReplay(), cSkinCursesDisplayChannel::cSkinCursesDisplayChannel(), cSkinCursesDisplayMenu::cSkinCursesDisplayMenu(), cSkinCursesDisplayReplay::cSkinCursesDisplayReplay(), cSkinCursesDisplayTracks::cSkinCursesDisplayTracks(), cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cPictureControl::DisplayCaption(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinClassicDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayChannel::Flush(), cLineGame::ProcessKey(), cSkinSTTNGDisplayTracks::SetAudioChannel(), cSkinSTTNGDisplayMenu::SetButtons(), cSkinSTTNGDisplayChannel::SetChannel(), cSkinClassicDisplayChannel::SetChannel(), cSkinCursesDisplayChannel::SetChannel(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinSTTNGDisplayChannel::SetEvents(), cSkinClassicDisplayChannel::SetEvents(), cSkinCursesDisplayChannel::SetEvents(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), cSkinSTTNGDisplayReplay::SetMessage(), cSkinSTTNGDisplayChannel::SetMessage(), cSkinClassicDisplayMenu::SetMessage(), cSkinCursesDisplayMenu::SetMessage(), cSkinCursesDisplayReplay::SetProgress(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinSTTNGDisplayVolume::SetVolume(), cSkinClassicDisplayVolume::SetVolume(), cSkinCursesDisplayVolume::SetVolume(), and cLineGame::Show().

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..-8 draws the inverted part of the given quadrant(s) If Quadrants is not 0, the coordinates are those of the actual area, not the full circle!

Definition at line 860 of file osd.c.

References bitmaps, and numBitmaps.

Referenced by cSkinSTTNGDisplayChannel::cSkinSTTNGDisplayChannel(), cSkinSTTNGDisplayMenu::cSkinSTTNGDisplayMenu(), cSkinSTTNGDisplayMessage::cSkinSTTNGDisplayMessage(), cSkinSTTNGDisplayReplay::cSkinSTTNGDisplayReplay(), cSkinSTTNGDisplayTracks::cSkinSTTNGDisplayTracks(), cSkinSTTNGDisplayVolume::cSkinSTTNGDisplayVolume(), cSkinSTTNGDisplayMenu::DrawScrollbar(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinSTTNGDisplayTracks::SetItem(), cSkinSTTNGDisplayMenu::SetItem(), and cSkinSTTNGDisplayMenu::SetRecording().

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

Definition at line 866 of file osd.c.

References bitmaps, and numBitmaps.

void cOsd::Flush ( void   )  [virtual]


Friends And Related Function Documentation

friend class cOsdProvider [friend]

Definition at line 262 of file osd.h.


Member Data Documentation

int cOsd::osdLeft = 0 [static, private]

Definition at line 264 of file osd.h.

Referenced by OsdLeft(), and SetOsdPosition().

int cOsd::osdTop = 0 [static, private]

Definition at line 264 of file osd.h.

Referenced by OsdTop(), and SetOsdPosition().

int cOsd::osdWidth = 0 [static, private]

Definition at line 264 of file osd.h.

Referenced by OsdWidth(), and SetOsdPosition().

int cOsd::osdHeight = 0 [static, private]

Definition at line 264 of file osd.h.

Referenced by OsdHeight(), and SetOsdPosition().

cVector< cOsd * > cOsd::Osds [static, private]

Definition at line 265 of file osd.h.

Referenced by cOsd(), IsOpen(), and ~cOsd().

Reimplemented in cCursesOsd.

Definition at line 266 of file osd.h.

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

cBitmap* cOsd::bitmaps[MAXOSDAREAS] [private]

int cOsd::numBitmaps [private]

int cOsd::left [private]

Definition at line 269 of file osd.h.

Referenced by cOsd(), and Left().

int cOsd::top [private]

Definition at line 269 of file osd.h.

Referenced by cOsd(), and Top().

int cOsd::width [private]

Definition at line 269 of file osd.h.

Referenced by cOsd(), SetAreas(), and Width().

int cOsd::height [private]

Definition at line 269 of file osd.h.

Referenced by cOsd(), Height(), and SetAreas().

uint cOsd::level [private]

Definition at line 270 of file osd.h.

Referenced by cOsd().

bool cOsd::active [private]

Definition at line 271 of file osd.h.

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


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

Generated on Tue Nov 4 20:00:22 2008 for VDR by  doxygen 1.5.6