vdr
2.2.0
|
#include <osd.h>
Public Member Functions | |
cPixmapMemory (void) | |
cPixmapMemory (int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null) | |
virtual | ~cPixmapMemory () |
const uint8_t * | Data (void) |
virtual void | Clear (void) |
virtual void | Fill (tColor Color) |
virtual void | DrawImage (const cPoint &Point, const cImage &Image) |
virtual void | DrawImage (const cPoint &Point, int ImageHandle) |
virtual void | DrawPixel (const cPoint &Point, tColor Color) |
virtual void | DrawBitmap (const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false) |
virtual void | DrawText (const cPoint &Point, const char *s, tColor ColorFg, tColor ColorBg, const cFont *Font, int Width=0, int Height=0, int Alignment=taDefault) |
virtual void | DrawRectangle (const cRect &Rect, tColor Color) |
virtual void | DrawEllipse (const cRect &Rect, tColor Color, int Quadrants=0) |
virtual void | DrawSlope (const cRect &Rect, tColor Color, int Type) |
virtual void | Render (const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) |
virtual void | Copy (const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) |
virtual void | Scroll (const cPoint &Dest, const cRect &Source=cRect::Null) |
virtual void | Pan (const cPoint &Dest, const cRect &Source=cRect::Null) |
![]() | |
cPixmap (void) | |
cPixmap (int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null) | |
int | Layer (void) const |
int | Alpha (void) const |
bool | Tile (void) const |
const cRect & | ViewPort (void) const |
const cRect & | DrawPort (void) const |
const cRect & | DirtyViewPort (void) const |
const cRect & | DirtyDrawPort (void) const |
virtual void | SetLayer (int Layer) |
virtual void | SetAlpha (int Alpha) |
virtual void | SetTile (bool Tile) |
virtual void | SetViewPort (const cRect &Rect) |
virtual void | SetDrawPortPoint (const cPoint &Point, bool Dirty=true) |
Private Attributes | |
tColor * | data |
bool | panning |
Additional Inherited Members | |
![]() | |
static void | Lock (void) |
static void | Unlock (void) |
![]() | |
virtual | ~cPixmap () |
void | MarkViewPortDirty (const cRect &Rect) |
void | MarkViewPortDirty (const cPoint &Point) |
void | MarkDrawPortDirty (const cRect &Rect) |
void | MarkDrawPortDirty (const cPoint &Point) |
void | SetClean (void) |
virtual void | DrawPixmap (const cPixmap *Pixmap, const cRect &Dirty) |
cPixmapMemory::cPixmapMemory | ( | void | ) |
Definition at line 1142 of file osd.c.
Referenced by cOsd::CreatePixmap(), and cOsd::SaveRegion().
cPixmapMemory::cPixmapMemory | ( | int | Layer, |
const cRect & | ViewPort, | ||
const cRect & | DrawPort = cRect::Null |
||
) |
|
virtual |
Clears the pixmap's draw port by setting all pixels to be fully transparent.
A derived class must call Lock()/Unlock().
Implements cPixmap.
Definition at line 1160 of file osd.c.
References data, cPixmap::DrawPort(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), and cPixmap::Unlock().
|
virtual |
Copies the part of the given Pixmap covered by Source into this pixmap at location Dest.
The Source rectangle is relative to the given Pixmap's draw port. The data from Pixmap is copied as is, no alpha handling of any kind takes place.
Implements cPixmap.
Definition at line 1556 of file osd.c.
References data, cPixmap::DrawPort(), cRect::Height(), cRect::Intersected(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Point(), cRect::Shifted(), cRect::Top(), cPixmap::Unlock(), and cRect::Width().
Referenced by cPixmap::DrawPixmap().
|
inline |
Definition at line 690 of file osd.h.
References cPalette::Color(), DrawEllipse(), DrawSlope(), Font, cRect::Null, and taDefault.
|
virtual |
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the Bitmap at Point.
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). If Overlay is true, any pixel in Bitmap that has color index 0 will not overwrite the corresponding pixel in the target area. This function is mainly for compatibility with skins or plugins that draw bitmaps onto the OSD.
Implements cPixmap.
Definition at line 1274 of file osd.c.
References cRect::Bottom(), cPalette::Color(), cBitmap::Data(), data, cPixmap::DrawPort(), cBitmap::Height(), cRect::Intersected(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Right(), cRect::Top(), cPixmap::Unlock(), cBitmap::Width(), cRect::Width(), cPoint::X(), and cPoint::Y().
Referenced by cOsd::DrawBitmap(), cOsd::DrawScaledBitmap(), and cOsd::RestoreRegion().
Draws a filled ellipse with the given Color that fits into the given rectangle.
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!
Implements cPixmap.
Definition at line 1377 of file osd.c.
References cRect::Bottom(), DrawRectangle(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), max(), cRect::Right(), cRect::Top(), and cPixmap::Unlock().
Referenced by cOsd::DrawEllipse().
Draws the given Image into this pixmap at the given Point.
Implements cPixmap.
Definition at line 1228 of file osd.c.
References cImage::Data(), data, cPixmap::DrawPort(), cRect::Height(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Size(), cImage::Size(), cRect::Top(), cPixmap::Unlock(), cSize::Width(), cRect::Width(), cPoint::X(), and cPoint::Y().
Referenced by DrawImage().
|
virtual |
Draws the image referenced by the given ImageHandle into this pixmap 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.
Implements cPixmap.
Definition at line 1252 of file osd.c.
References DrawImage(), cOsdProvider::GetImageData(), cPixmap::Lock(), and cPixmap::Unlock().
Sets the pixel at the given Point to the given Color, which is a full 32 bit ARGB value.
If the alpha value of Color is not 0xFF (fully opaque), and this is the background pixmap (layer 0), the pixel is alpha blended with the existing color at the given position in this pixmap.
Implements cPixmap.
Definition at line 1260 of file osd.c.
References AlphaBlend(), data, cPixmap::DrawPort(), IS_OPAQUE, cPixmap::Layer(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cPixmap::Unlock(), cRect::Width(), cPoint::X(), and cPoint::Y().
Referenced by cOsd::DrawPixel().
Draws a filled rectangle with the given Color.
Implements cPixmap.
Definition at line 1350 of file osd.c.
References data, cPixmap::DrawPort(), cRect::Height(), cRect::Intersected(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Top(), cPixmap::Unlock(), and cRect::Width().
Referenced by DrawEllipse(), cOsd::DrawRectangle(), DrawSlope(), and DrawText().
Draws a "slope" with the given Color into the given rectangle.
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
Implements cPixmap.
Definition at line 1479 of file osd.c.
References cRect::Bottom(), DrawRectangle(), cRect::Height(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Right(), cRect::Top(), cPixmap::Unlock(), and cRect::Width().
Referenced by cOsd::DrawSlope().
|
virtual |
Draws the given string at Point 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.
Implements cPixmap.
Definition at line 1301 of file osd.c.
References clrTransparent, DrawRectangle(), cFont::DrawText(), cFont::Height(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), max(), taBorder, taBottom, taLeft, taRight, taTop, TEXT_ALIGN_BORDER, cPixmap::Unlock(), cFont::Width(), cPoint::X(), and cPoint::Y().
Referenced by cOsd::DrawText(), cTextScroller::Scroll(), and cTextScroller::Set().
|
virtual |
Fills the pixmap's draw port with the given Color.
A derived class must call Lock()/Unlock().
Implements cPixmap.
Definition at line 1168 of file osd.c.
References data, cPixmap::DrawPort(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), and cPixmap::Unlock().
Referenced by cOsd::RenderPixmaps().
|
virtual |
Does the same as Scroll(), but also shifts the draw port accordingly, so that the view port doesn't get dirty if the scrolled rectangle covers the entire view port.
This may be of advantage if, e.g., there is a draw port that holds, say, 11 lines of text, while the view port displays only 10 lines. By Pan()'ing the draw port up one line, a new bottom line can be written into the draw port (without being seen through the view port), and later the draw port can be shifted smoothly, resulting in a smooth scrolling. It is the caller's responsibility to make sure that Source and Dest are given in such a way that the view port will not get dirty. No check is done whether this condition actually holds true.
Implements cPixmap.
Definition at line 1617 of file osd.c.
References cPixmap::Lock(), panning, Scroll(), and cPixmap::Unlock().
|
virtual |
Renders the part of the given Pixmap covered by Source into this pixmap at location Dest.
The Source rectangle is relative to the given Pixmap's draw port. The Pixmap's alpha value is to be used when rendering.
Implements cPixmap.
Definition at line 1521 of file osd.c.
References cPixmap::Alpha(), ALPHA_TRANSPARENT, AlphaBlend(), data, cPixmap::DrawPort(), cRect::Height(), cRect::Intersected(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Point(), cRect::Shifted(), cRect::Size(), cRect::Top(), cPixmap::Unlock(), and cRect::Width().
Referenced by cPixmap::DrawPixmap().
|
virtual |
Scrolls the data in the pixmap's draw port to the given Dest point.
If Source is given, only the data within that rectangle is scrolled. Source and Dest are relative to this pixmap's draw port.
Implements cPixmap.
Definition at line 1583 of file osd.c.
References data, cPixmap::DrawPort(), cRect::Height(), cRect::Intersected(), cRect::IsEmpty(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), panning, cRect::Point(), cPixmap::SetDrawPortPoint(), cRect::Shifted(), cRect::Top(), cPixmap::Unlock(), and cRect::Width().
Referenced by Pan().
|
private |
Definition at line 684 of file osd.h.
Referenced by Clear(), Copy(), cPixmapMemory(), DrawBitmap(), DrawImage(), DrawPixel(), DrawRectangle(), Fill(), Render(), Scroll(), and ~cPixmapMemory().
|
private |
Definition at line 685 of file osd.h.
Referenced by cPixmapMemory(), Pan(), and Scroll().