vdr  1.7.27
Public Member Functions | Private Attributes
cPixmapMemory Class Reference

#include <osd.h>

List of all members.

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)
 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)

Private Attributes

tColordata
bool panning

Detailed Description

Definition at line 668 of file include/vdr/osd.h.


Constructor & Destructor Documentation

Definition at line 1109 of file osd.c.

References data, and panning.

cPixmapMemory::cPixmapMemory ( int  Layer,
const cRect ViewPort,
const cRect DrawPort = cRect::Null 
)

Definition at line 1115 of file osd.c.

References data, cPixmap::DrawPort(), and MALLOC.

Definition at line 1121 of file osd.c.

References data.

cPixmapMemory::cPixmapMemory ( int  Layer,
const cRect ViewPort,
const cRect DrawPort = cRect::Null 
)
virtual cPixmapMemory::~cPixmapMemory ( ) [virtual]

Member Function Documentation

void cPixmapMemory::Clear ( void  ) [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 1126 of file osd.c.

References data, cPixmap::DrawPort(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), and cPixmap::Unlock().

Referenced by cOsd::RenderPixmaps().

virtual void cPixmapMemory::Clear ( void  ) [virtual]

Clears the pixmap's draw port by setting all pixels to be fully transparent.

A derived class must call Lock()/Unlock().

Implements cPixmap.

void cPixmapMemory::Copy ( const cPixmap Pixmap,
const cRect Source,
const cPoint Dest 
) [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 1518 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 cOsd::SaveRegion().

virtual void cPixmapMemory::Copy ( const cPixmap Pixmap,
const cRect Source,
const cPoint Dest 
) [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.

const uint8_t* cPixmapMemory::Data ( void  ) [inline]

Definition at line 676 of file include/vdr/osd.h.

References data.

const uint8_t* cPixmapMemory::Data ( void  ) [inline]

Definition at line 676 of file osd.h.

References data.

virtual void cPixmapMemory::DrawBitmap ( const cPoint Point,
const cBitmap Bitmap,
tColor  ColorFg = 0,
tColor  ColorBg = 0,
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 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.

void cPixmapMemory::DrawBitmap ( const cPoint Point,
const cBitmap Bitmap,
tColor  ColorFg = 0,
tColor  ColorBg = 0,
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 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 1240 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().

void cPixmapMemory::DrawEllipse ( const cRect Rect,
tColor  Color,
int  Quadrants = 0 
) [virtual]

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..-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!

Implements cPixmap.

Definition at line 1339 of file osd.c.

References cRect::Bottom(), DrawRectangle(), cRect::Left(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), cRect::Right(), cRect::Top(), and cPixmap::Unlock().

virtual void cPixmapMemory::DrawEllipse ( const cRect Rect,
tColor  Color,
int  Quadrants = 0 
) [virtual]

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..-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!

Implements cPixmap.

void cPixmapMemory::DrawImage ( const cPoint Point,
const cImage Image 
) [virtual]
virtual void cPixmapMemory::DrawImage ( const cPoint Point,
const cImage Image 
) [virtual]

Draws the given Image into this pixmap at the given Point.

Implements cPixmap.

void cPixmapMemory::DrawImage ( const cPoint Point,
int  ImageHandle 
) [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 1218 of file osd.c.

References DrawImage(), cOsdProvider::GetImageData(), cPixmap::Lock(), and cPixmap::Unlock().

virtual void cPixmapMemory::DrawImage ( const cPoint Point,
int  ImageHandle 
) [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.

virtual void cPixmapMemory::DrawPixel ( const cPoint Point,
tColor  Color 
) [virtual]

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.

void cPixmapMemory::DrawPixel ( const cPoint Point,
tColor  Color 
) [virtual]

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 1226 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().

void cPixmapMemory::DrawRectangle ( const cRect Rect,
tColor  Color 
) [virtual]

Draws a filled rectangle with the given Color.

Implements cPixmap.

Definition at line 1312 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(), DrawSlope(), and DrawText().

virtual void cPixmapMemory::DrawRectangle ( const cRect Rect,
tColor  Color 
) [virtual]

Draws a filled rectangle with the given Color.

Implements cPixmap.

void cPixmapMemory::DrawSlope ( const cRect Rect,
tColor  Color,
int  Type 
) [virtual]

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 1441 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().

virtual void cPixmapMemory::DrawSlope ( const cRect Rect,
tColor  Color,
int  Type 
) [virtual]

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.

void cPixmapMemory::DrawText ( const cPoint Point,
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 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 1267 of file osd.c.

References clrTransparent, DrawRectangle(), cFont::DrawText(), cFont::Height(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), taBottom, taLeft, taRight, taTop, cPixmap::Unlock(), cFont::Width(), cPoint::X(), and cPoint::Y().

virtual void cPixmapMemory::DrawText ( const cPoint Point,
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 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.

virtual void cPixmapMemory::Fill ( tColor  Color) [virtual]

Fills the pixmap's draw port with the given Color.

A derived class must call Lock()/Unlock().

Implements cPixmap.

void cPixmapMemory::Fill ( tColor  Color) [virtual]

Fills the pixmap's draw port with the given Color.

A derived class must call Lock()/Unlock().

Implements cPixmap.

Definition at line 1134 of file osd.c.

References data, cPixmap::DrawPort(), cPixmap::Lock(), cPixmap::MarkDrawPortDirty(), and cPixmap::Unlock().

Referenced by cOsd::RenderPixmaps().

virtual void cPixmapMemory::Pan ( const cPoint Dest,
const cRect Source = cRect::Null 
) [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, an 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.

void cPixmapMemory::Pan ( const cPoint Dest,
const cRect Source = cRect::Null 
) [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, an 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 1579 of file osd.c.

References cPixmap::Lock(), panning, Scroll(), and cPixmap::Unlock().

virtual void cPixmapMemory::Render ( const cPixmap Pixmap,
const cRect Source,
const cPoint Dest 
) [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.

void cPixmapMemory::Render ( const cPixmap Pixmap,
const cRect Source,
const cPoint Dest 
) [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 1483 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 cOsd::RenderPixmaps().

void cPixmapMemory::Scroll ( const cPoint Dest,
const cRect Source = cRect::Null 
) [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 1545 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().

virtual void cPixmapMemory::Scroll ( const cPoint Dest,
const cRect Source = cRect::Null 
) [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.


Member Data Documentation

bool cPixmapMemory::panning [private]

Definition at line 671 of file include/vdr/osd.h.

Referenced by cPixmapMemory(), Pan(), and Scroll().


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