vdr  1.7.27
Public Member Functions | Protected Member Functions | Private Attributes
cHdffOsd Class Reference

List of all members.

Public Member Functions

 cHdffOsd (int Left, int Top, HDFF::cHdffCmdIf *pHdffCmdIf, uint Level)
virtual ~cHdffOsd ()
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 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)

Protected Member Functions

virtual void SetActive (bool On)

Private Attributes

HDFF::cHdffCmdIfmHdffCmdIf
int mLeft
int mTop
int mDispWidth
int mDispHeight
bool shown
bool mChanged
bool mBitmapModified
uint32_t mDisplay
tFontFace mFontFaces [MAX_NUM_FONTFACES]
tFont mFonts [MAX_NUM_FONTS]
uint32_t mBitmapPalette
uint32_t mBitmapColors [256]
uint32_t mBitmapNumColors

Detailed Description

Definition at line 33 of file hdffosd.c.


Constructor & Destructor Documentation

cHdffOsd::cHdffOsd ( int  Left,
int  Top,
HDFF::cHdffCmdIf pHdffCmdIf,
uint  Level 
)
cHdffOsd::~cHdffOsd ( ) [virtual]

Member Function Documentation

eOsdError cHdffOsd::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 from cOsd.

Definition at line 137 of file hdffosd.c.

References oeBppNotSupported, and oeOk.

void cHdffOsd::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 from cOsd.

Definition at line 205 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdCreatePalette(), HDFF::cHdffCmdIf::CmdOsdDrawBitmap(), HDFF::cHdffCmdIf::CmdOsdSetPaletteColors(), cPalette::Color(), cPalette::Colors(), HDFF::colorTypeARGB8888, cBitmap::Data(), HDFF_COLOR_FORMAT_ARGB, HDFF_COLOR_TYPE_CLUT8, HDFF_INVALID_HANDLE, cBitmap::Height(), InvalidHandle, mBitmapColors, mBitmapModified, mBitmapPalette, mChanged, mDisplay, mHdffCmdIf, mLeft, mTop, and cBitmap::Width().

Referenced by Flush().

void cHdffOsd::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!

Reimplemented from cOsd.

Definition at line 426 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdDrawEllipse(), HDFF_DRAW_FULL, HDFF_DRAW_HALF_BOTTOM, HDFF_DRAW_HALF_LEFT, HDFF_DRAW_HALF_RIGHT, HDFF_DRAW_HALF_TOP, HDFF_DRAW_QUARTER_BOTTOM_LEFT, HDFF_DRAW_QUARTER_BOTTOM_LEFT_INVERTED, HDFF_DRAW_QUARTER_BOTTOM_RIGHT, HDFF_DRAW_QUARTER_BOTTOM_RIGHT_INVERTED, HDFF_DRAW_QUARTER_TOP_LEFT, HDFF_DRAW_QUARTER_TOP_LEFT_INVERTED, HDFF_DRAW_QUARTER_TOP_RIGHT, HDFF_DRAW_QUARTER_TOP_RIGHT_INVERTED, mBitmapModified, mChanged, mDisplay, mHdffCmdIf, mLeft, and mTop.

void cHdffOsd::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 from cOsd.

Definition at line 199 of file hdffosd.c.

References mBitmapModified.

void cHdffOsd::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 from cOsd.

Definition at line 419 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdDrawRectangle(), mBitmapModified, mChanged, mDisplay, mHdffCmdIf, mLeft, and mTop.

void cHdffOsd::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 from cOsd.

Definition at line 517 of file hdffosd.c.

References mBitmapModified, and mChanged.

void cHdffOsd::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 from cOsd.

Definition at line 266 of file hdffosd.c.

References clrTransparent, HDFF::cHdffCmdIf::CmdOsdCreateFont(), HDFF::cHdffCmdIf::CmdOsdCreateFontFace(), HDFF::cHdffCmdIf::CmdOsdDrawRectangle(), HDFF::cHdffCmdIf::CmdOsdDrawTextW(), HDFF::cHdffCmdIf::CmdOsdSetDisplayClippingArea(), cFont::FontName(), _tFontFace::Handle, _tFont::Handle, HDFF_INVALID_HANDLE, cFont::Height(), _tFont::hFontFace, MAX_NUM_FONTFACES, MAX_NUM_FONTS, mBitmapModified, mChanged, mDisplay, mFontFaces, mFonts, mHdffCmdIf, mLeft, mTop, _tFontFace::Name, _tFont::Size, cFont::Size(), taBottom, taLeft, taRight, taTop, Utf8CharGet(), Utf8CharLen(), and cFont::Width().

void cHdffOsd::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 = 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); delete pm; }

Reimplemented from cOsd.

Definition at line 524 of file hdffosd.c.

References cOsd::Active(), HDFF::cHdffCmdIf::CmdOsdRenderDisplay(), DrawBitmap(), GetBitmap(), mBitmapModified, mChanged, mDisplay, and mHdffCmdIf.

Referenced by SetActive().

cBitmap * cHdffOsd::GetBitmap ( int  Area)

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.

Reimplemented from cOsd.

Definition at line 129 of file hdffosd.c.

References mBitmapModified, and mChanged.

Referenced by Flush(), and SetActive().

void cHdffOsd::RestoreRegion ( void  ) [virtual]

Restores the region previously saved by a call to SaveRegion().

If SaveRegion() has not been called before, nothing will happen.

Reimplemented from cOsd.

Definition at line 192 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdRestoreRegion(), mBitmapModified, mChanged, mDisplay, and mHdffCmdIf.

void cHdffOsd::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 from cOsd.

Definition at line 185 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdSaveRegion(), mBitmapModified, mChanged, mDisplay, mHdffCmdIf, mLeft, and mTop.

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

Sets this OSD to be the active one.

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

Reimplemented from cOsd.

Definition at line 166 of file hdffosd.c.

References cOsd::Active(), HDFF::cHdffCmdIf::CmdOsdDrawRectangle(), HDFF::cHdffCmdIf::CmdOsdRenderDisplay(), Flush(), GetBitmap(), mDispHeight, mDisplay, mDispWidth, mHdffCmdIf, and shown.

Referenced by ~cHdffOsd().

eOsdError cHdffOsd::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 from cOsd.

Definition at line 151 of file hdffosd.c.

References HDFF::cHdffCmdIf::CmdOsdDrawRectangle(), HDFF::cHdffCmdIf::CmdOsdRenderDisplay(), mDispHeight, mDisplay, mDispWidth, mHdffCmdIf, and shown.


Member Data Documentation

uint32_t cHdffOsd::mBitmapColors[256] [private]

Definition at line 48 of file hdffosd.c.

Referenced by DrawBitmap().

bool cHdffOsd::mBitmapModified [private]
uint32_t cHdffOsd::mBitmapNumColors [private]

Definition at line 49 of file hdffosd.c.

uint32_t cHdffOsd::mBitmapPalette [private]

Definition at line 47 of file hdffosd.c.

Referenced by cHdffOsd(), DrawBitmap(), and ~cHdffOsd().

bool cHdffOsd::mChanged [private]
int cHdffOsd::mDispHeight [private]

Definition at line 40 of file hdffosd.c.

Referenced by cHdffOsd(), SetActive(), SetAreas(), and ~cHdffOsd().

uint32_t cHdffOsd::mDisplay [private]
int cHdffOsd::mDispWidth [private]

Definition at line 39 of file hdffosd.c.

Referenced by cHdffOsd(), SetActive(), SetAreas(), and ~cHdffOsd().

Definition at line 45 of file hdffosd.c.

Referenced by cHdffOsd(), DrawText(), and ~cHdffOsd().

Definition at line 46 of file hdffosd.c.

Referenced by cHdffOsd(), DrawText(), and ~cHdffOsd().

int cHdffOsd::mLeft [private]

Definition at line 37 of file hdffosd.c.

Referenced by cHdffOsd(), DrawBitmap(), DrawEllipse(), DrawRectangle(), DrawText(), and SaveRegion().

int cHdffOsd::mTop [private]

Definition at line 38 of file hdffosd.c.

Referenced by cHdffOsd(), DrawBitmap(), DrawEllipse(), DrawRectangle(), DrawText(), and SaveRegion().

bool cHdffOsd::shown [private]

Definition at line 41 of file hdffosd.c.

Referenced by cHdffOsd(), SetActive(), and SetAreas().


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