|
SASC-NG
DVBSoftCAM
|
#include <osd.h>
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) |
| cBitmap * | GetBitmap (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 | SetOsdPostion (int Left, int Top, int Width, int Height) |
| static int | IsOpen (void) |
Protected Member Functions | |
| cOsd (int Left, int Top) | |
Friends | |
| class | cOsdProvider |
| cOsd::cOsd | ( | int | Left, |
| int | Top | ||
| ) | [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.
| virtual cOsd::~cOsd | ( | ) | [virtual] |
Shuts down the OSD.
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.
| virtual 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.
| virtual 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!
| virtual 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.
| virtual 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.
| virtual 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
| virtual 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.
| virtual void cOsd::Flush | ( | void | ) | [virtual] |
Actually commits all data to the OSD hardware.
| cBitmap* cOsd::GetBitmap | ( | int | Area | ) |
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
| static int cOsd::IsOpen | ( | void | ) | [inline, static] |
| static int cOsd::OsdHeight | ( | void | ) | [inline, static] |
| static int cOsd::OsdLeft | ( | void | ) | [inline, static] |
| static int cOsd::OsdTop | ( | void | ) | [inline, static] |
| static int cOsd::OsdWidth | ( | void | ) | [inline, static] |
| virtual 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.
| virtual 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.
| 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.
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.
| static void cOsd::SetOsdPostion | ( | 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.
Sets the Palette for the given Area (the first area is numbered 0).
friend class cOsdProvider [friend] |