vdr  2.0.5
osd.h
Go to the documentation of this file.
1 /*
2  * osd.h: Abstract On Screen Display layer
3  *
4  * See the main source file 'vdr.c' for copyright information and
5  * how to reach the author.
6  *
7  * $Id: osd.h 2.20 2013/02/12 13:39:08 kls Exp $
8  */
9 
10 #ifndef __OSD_H
11 #define __OSD_H
12 
13 #include <limits.h>
14 #include <stdio.h>
15 #include <stdint.h>
16 #include "config.h"
17 #include "font.h"
18 #include "thread.h"
19 #include "tools.h"
20 
21 #define OSD_LEVEL_DEFAULT 0
22 #define OSD_LEVEL_SUBTITLES 10
23 
24 #define MAXNUMCOLORS 256
25 #define ALPHA_TRANSPARENT 0x00
26 #define ALPHA_OPAQUE 0xFF
27 #define IS_OPAQUE(c) ((c >> 24) == ALPHA_OPAQUE)
28 #define TEXT_ALIGN_BORDER 10 // fraction of the font height used for sizing border
29 
30 enum {
31  //AARRGGBB
32  clrTransparent = 0x00000000,
33  clrGray50 = 0x7F000000, // 50% gray
34  clrBlack = 0xFF000000,
35  clrRed = 0xFFFC1414,
36  clrGreen = 0xFF24FC24,
37  clrYellow = 0xFFFCC024,
38  clrMagenta = 0xFFB000FC,
39  clrBlue = 0xFF0000FC,
40  clrCyan = 0xFF00FCFC,
41  clrWhite = 0xFFFCFCFC,
42  };
43 
44 enum eOsdError { oeOk, // see also OsdErrorTexts in osd.c
53  };
54 
55 typedef uint32_t tColor; // see also font.h
56 typedef uint8_t tIndex;
57 
58 inline tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
59 {
60  return (tColor(A) << 24) | (tColor(R) << 16) | (tColor(G) << 8) | B;
61 }
62 
63 inline tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
64 {
65  return (tColor(R) << 16) | (tColor(G) << 8) | B;
66 }
67 
68 inline tColor RgbToColor(double R, double G, double B)
69 {
70  return RgbToColor(uint8_t(0xFF * R), uint8_t(0xFF * G), uint8_t(0xFF * B));
71 }
72 
73 tColor RgbShade(tColor Color, double Factor);
80 
81 tColor HsvToColor(double H, double S, double V);
85 
86 tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer = ALPHA_OPAQUE);
87 
88 class cPalette {
89 private:
91  int bpp;
93  bool modified;
95 protected:
97 public:
98  cPalette(int Bpp = 8);
100  virtual ~cPalette();
101  void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
111  int Bpp(void) const { return bpp; }
112  void Reset(void);
114  int Index(tColor Color);
119  tColor Color(int Index) const { return Index < maxColors ? color[Index] : 0; }
122  void SetBpp(int Bpp);
125  void SetColor(int Index, tColor Color);
129  const tColor *Colors(int &NumColors) const;
134  void Take(const cPalette &Palette, tIndexes *Indexes = NULL, tColor ColorFg = 0, tColor ColorBg = 0);
141  void Replace(const cPalette &Palette);
144  tColor Blend(tColor ColorFg, tColor ColorBg, uint8_t Level) const;
150  int ClosestColor(tColor Color, int MaxDiff = INT_MAX) const;
156  };
157 
158 enum eTextAlignment { taCenter = 0x00,
159  taLeft = 0x01,
160  taRight = 0x02,
161  taTop = 0x04,
162  taBottom = 0x08,
163  taBorder = 0x10, // keeps some distance from the left or right alignment edge
165  };
166 
167 class cFont;
168 
169 class cBitmap : public cPalette {
170 private:
172  int x0, y0;
173  int width, height;
175 public:
176  cBitmap(int Width, int Height, int Bpp, int X0 = 0, int Y0 = 0);
181  cBitmap(const char *FileName);
183  cBitmap(const char *const Xpm[]);
185  virtual ~cBitmap();
186  int X0(void) const { return x0; }
187  int Y0(void) const { return y0; }
188  int Width(void) const { return width; }
189  int Height(void) const { return height; }
190  void SetSize(int Width, int Height);
195  bool Contains(int x, int y) const;
197  bool Covers(int x1, int y1, int x2, int y2) const;
200  bool Intersects(int x1, int y1, int x2, int y2) const;
203  bool Dirty(int &x1, int &y1, int &x2, int &y2);
206  void Clean(void);
208  bool LoadXpm(const char *FileName);
211  bool SetXpm(const char *const Xpm[], bool IgnoreNone = false);
221  void SetIndex(int x, int y, tIndex Index);
224  void DrawPixel(int x, int y, tColor Color);
228  void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
238  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);
244  void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
249  void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
259  void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
271  const tIndex *Data(int x, int y) const;
273  tColor GetColor(int x, int y) const { return Color(*Data(x, y)); }
275  void ReduceBpp(const cPalette &Palette);
281  void ShrinkBpp(int NewBpp);
286  cBitmap *Scaled(double FactorX, double FactorY, bool AntiAlias = false);
292  };
293 
294 struct tArea {
295  int x1, y1, x2, y2;
296  int bpp;
297  int Width(void) const { return x2 - x1 + 1; }
298  int Height(void) const { return y2 - y1 + 1; }
299  bool Intersects(const tArea &Area) const { return !(x2 < Area.x1 || x1 > Area.x2 || y2 < Area.y1 || y1 > Area.y2); }
300  };
301 
302 class cPoint {
303 private:
304  int x;
305  int y;
306 public:
307  cPoint(void) { x = y = 0; }
308  cPoint(int X, int Y) { x = X; y = Y; }
309  cPoint(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
310  bool operator==(const cPoint &Point) const { return x == Point.X() && y == Point.Y(); }
311  bool operator!=(const cPoint &Point) const { return !(*this == Point); }
312  cPoint operator-(void) const { return cPoint(-x, -y); }
313  cPoint operator-(const cPoint &Point) const { return cPoint(x - Point.X(), y - Point.Y()); }
314  int X(void) const { return x; }
315  int Y(void) const { return y; }
316  void SetX(int X) { x = X; }
317  void SetY(int Y) { y = Y; }
318  void Set(int X, int Y) { x = X; y = Y; }
319  void Set(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
320  void Shift(int Dx, int Dy) { x += Dx; y += Dy; }
321  void Shift(const cPoint &Dp) { x += Dp.X(); y += Dp.Y(); }
322  cPoint Shifted(int Dx, int Dy) const { cPoint p(*this); p.Shift(Dx, Dy); return p; }
323  cPoint Shifted(const cPoint &Dp) const { cPoint p(*this); p.Shift(Dp); return p; }
324  };
325 
326 class cSize {
327 private:
328  int width;
329  int height;
330 public:
331  cSize(void) { width = height = 0; }
332  cSize(int Width, int Height) { width = Width; height = Height; }
333  cSize(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
334  bool operator==(const cSize &Size) const { return width == Size.Width() && height == Size.Height(); }
335  bool operator!=(const cSize &Size) const { return !(*this == Size); }
336  bool operator<(const cSize &Size) const { return width < Size.Width() && height < Size.Height(); }
337  int Width(void) const { return width; }
338  int Height(void) const { return height; }
339  void SetWidth(int Width) { width = Width; }
340  void SetHeight(int Height) { height = Height; }
341  void Set(int Width, int Height) { width = Width; height = Height; }
342  void Set(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
343  bool Contains(const cPoint &Point) const { return 0 <= Point.X() && 0 <= Point.Y() && Point.X() < width && Point.Y() < height; }
344  void Grow(int Dw, int Dh) { width += 2 * Dw; height += 2 * Dh; }
345  cSize Grown(int Dw, int Dh) const { cSize s(*this); s.Grow(Dw, Dh); return s; }
346  };
347 
348 class cRect {
349 private:
352 public:
353  static const cRect Null;
354  cRect(void): point(0, 0), size(0, 0) {}
355  cRect(int X, int Y, int Width, int Height): point(X, Y), size(Width, Height) {}
356  cRect(const cPoint &Point, const cSize &Size): point(Point), size(Size) {}
357  cRect(const cSize &Size): point(0, 0), size(Size) {}
358  cRect(const cRect &Rect): point(Rect.Point()), size(Rect.Size()) {}
359  bool operator==(const cRect &Rect) const { return point == Rect.Point() && size == Rect.Size(); }
360  bool operator!=(const cRect &Rect) const { return !(*this == Rect); }
361  int X(void) const { return point.X(); }
362  int Y(void) const { return point.Y(); }
363  int Width(void) const { return size.Width(); }
364  int Height(void) const { return size.Height(); }
365  int Left(void) const { return X(); }
366  int Top(void) const { return Y(); }
367  int Right(void) const { return X() + Width() - 1; }
368  int Bottom(void) const { return Y() + Height() - 1; }
369  const cPoint &Point(void) const { return point; }
370  const cSize &Size(void) const { return size; }
371  void Set(int X, int Y, int Width, int Height) { point.Set(X, Y); size.Set(Width, Height); }
372  void Set(cPoint Point, cSize Size) { point.Set(Point); size.Set(Size); }
373  void SetPoint(int X, int Y) { point.Set(X, Y); }
374  void SetPoint(const cPoint &Point) { point.Set(Point); }
375  void SetSize(int Width, int Height) { size.Set(Width, Height); }
376  void SetSize(const cSize &Size) { size.Set(Size); }
377  void SetX(int X) { point.SetX(X); }
378  void SetY(int Y) { point.SetY(Y); }
379  void SetWidth(int Width) { size.SetWidth(Width); }
380  void SetHeight(int Height) { size.SetHeight(Height); }
381  void SetLeft(int Left) { SetWidth(Width() + X() - Left); SetX(Left); }
382  void SetTop(int Top) { SetHeight(Height() + Y() - Top); SetY(Top); }
383  void SetRight(int Right) { SetWidth(Right - X() + 1); }
384  void SetBottom(int Bottom) { SetHeight(Bottom - Y() + 1); }
385  void Shift(int Dx, int Dy) { point.Shift(Dx, Dy); }
386  void Shift(const cPoint &Dp) { point.Shift(Dp); }
387  cRect Shifted(int Dx, int Dy) const { cRect r(*this); r.Shift(Dx, Dy); return r; }
388  cRect Shifted(const cPoint &Dp) const { cRect r(*this); r.Shift(Dp); return r; }
389  void Grow(int Dx, int Dy);
392  cRect Grown(int Dw, int Dh) const { cRect r(*this); r.Grow(Dw, Dh); return r; }
393  bool Contains(const cPoint &Point) const;
395  bool Contains(const cRect &Rect) const;
397  bool Intersects(const cRect &Rect) const;
399  cRect Intersected(const cRect &Rect) const;
401  void Combine(const cRect &Rect);
403  cRect Combined(const cRect &Rect) const { cRect r(*this); r.Combine(Rect); return r; }
406  void Combine(const cPoint &Point);
408  cRect Combined(const cPoint &Point) const { cRect r(*this); r.Combine(Point); return r; }
411  bool IsEmpty(void) const { return Width() <= 0 || Height() <= 0; }
413  };
414 
415 class cImage {
416 private:
419 public:
420  cImage(void);
421  cImage(const cImage &Image);
422  cImage(const cSize &Size, const tColor *Data = NULL);
429  virtual ~cImage();
430  const cSize &Size(void) const { return size; }
431  int Width(void) const { return size.Width(); }
432  int Height(void) const { return size.Height(); }
433  const tColor *Data(void) const { return data; }
434  tColor GetPixel(const cPoint &Point) const { return data[size.Width() * Point.Y() + Point.X()]; }
438  void SetPixel(const cPoint &Point, tColor Color) { data[size.Width() * Point.Y() + Point.X()] = Color; }
442  void Clear(void);
444  void Fill(tColor Color);
446  };
447 
448 #define MAXPIXMAPLAYERS 8
449 
450 class cPixmap {
451  friend class cOsd;
452  friend class cPixmapMutexLock;
453 private:
454  static cMutex mutex;
455  int layer;
456  int alpha;
457  bool tile;
462 protected:
463  virtual ~cPixmap() {}
464  void MarkViewPortDirty(const cRect &Rect);
468  void MarkViewPortDirty(const cPoint &Point);
472  void MarkDrawPortDirty(const cRect &Rect);
478  void MarkDrawPortDirty(const cPoint &Point);
484  void SetClean(void);
486  virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty);
491 public:
492  cPixmap(void);
493  cPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
521  static void Lock(void) { mutex.Lock(); }
527  static void Unlock(void) { mutex.Unlock(); }
528  int Layer(void) const { return layer; }
529  int Alpha(void) const { return alpha; }
530  bool Tile(void) const { return tile; }
531  const cRect &ViewPort(void) const { return viewPort; }
535  const cRect &DrawPort(void) const { return drawPort; }
539  const cRect &DirtyViewPort(void) const { return dirtyViewPort; }
546  const cRect &DirtyDrawPort(void) const { return dirtyDrawPort; }
553  virtual void SetLayer(int Layer);
560  virtual void SetAlpha(int Alpha);
565  virtual void SetTile(bool Tile);
571  virtual void SetViewPort(const cRect &Rect);
575  virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty = true);
584  virtual void Clear(void) = 0;
587  virtual void Fill(tColor Color) = 0;
590  virtual void DrawImage(const cPoint &Point, const cImage &Image) = 0;
592  virtual void DrawImage(const cPoint &Point, int ImageHandle) = 0;
597  virtual void DrawPixel(const cPoint &Point, tColor Color) = 0;
602  virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false) = 0;
613  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) = 0;
619  virtual void DrawRectangle(const cRect &Rect, tColor Color) = 0;
621  virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0) = 0;
630  virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) = 0;
641  virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
645  virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
650  virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
654  virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
666  };
667 
668 class cPixmapMutexLock : public cMutexLock {
669 public:
671  };
672 
673 #define LOCK_PIXMAPS cPixmapMutexLock PixmapMutexLock
674 
675 // cPixmapMemory is an implementation of cPixmap that uses an array of tColor
676 // values to store the pixmap.
677 
678 class cPixmapMemory : public cPixmap {
679 private:
681  bool panning;
682 public:
683  cPixmapMemory(void);
684  cPixmapMemory(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
685  virtual ~cPixmapMemory();
686  const uint8_t *Data(void) { return (uint8_t *)data; }
687  virtual void Clear(void);
688  virtual void Fill(tColor Color);
689  virtual void DrawImage(const cPoint &Point, const cImage &Image);
690  virtual void DrawImage(const cPoint &Point, int ImageHandle);
691  virtual void DrawPixel(const cPoint &Point, tColor Color);
692  virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false);
693  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);
694  virtual void DrawRectangle(const cRect &Rect, tColor Color);
695  virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0);
696  virtual void DrawSlope(const cRect &Rect, tColor Color, int Type);
697  virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
698  virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
699  virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null);
700  virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null);
701  };
702 
703 #define MAXOSDAREAS 16
704 
715 
716 class cOsd {
717  friend class cOsdProvider;
718 private:
721  static cMutex mutex;
729  uint level;
730  bool active;
731 protected:
732  cOsd(int Left, int Top, uint Level);
752  bool Active(void) { return active; }
753  virtual void SetActive(bool On) { active = On; }
756  cPixmap *AddPixmap(cPixmap *Pixmap);
778 public:
779  virtual ~cOsd();
781  static int OsdLeft(void) { return osdLeft ? osdLeft : Setup.OSDLeft; }
782  static int OsdTop(void) { return osdTop ? osdTop : Setup.OSDTop; }
783  static int OsdWidth(void) { return osdWidth ? osdWidth : Setup.OSDWidth; }
784  static int OsdHeight(void) { return osdHeight ? osdHeight : Setup.OSDHeight; }
785  static void SetOsdPosition(int Left, int Top, int Width, int Height);
790  static int IsOpen(void) { return Osds.Size() && Osds[0]->level == OSD_LEVEL_DEFAULT; }
792  bool IsTrueColor(void) const { return isTrueColor; }
795  int Left(void) { return left; }
796  int Top(void) { return top; }
797  int Width(void) { return width; }
798  int Height(void) { return height; }
799  void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
810  cBitmap *GetBitmap(int Area);
816  virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
823  virtual void DestroyPixmap(cPixmap *Pixmap);
828  virtual void DrawImage(const cPoint &Point, const cImage &Image);
831  virtual void DrawImage(const cPoint &Point, int ImageHandle);
837  virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
845  virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
857  virtual void SaveRegion(int x1, int y1, int x2, int y2);
861  virtual void RestoreRegion(void);
864  virtual eOsdError SetPalette(const cPalette &Palette, int Area);
867  virtual void DrawPixel(int x, int y, tColor Color);
873  virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
884  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);
890  virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
893  virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
903  virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
915  virtual void Flush(void);
929  };
930 
931 #define MAXOSDIMAGES 64
932 
934  friend class cPixmapMemory;
935 private:
937  static int oldWidth;
938  static int oldHeight;
939  static double oldAspect;
941 protected:
942  virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0;
945  virtual bool ProvidesTrueColor(void) { return false; }
947  virtual int StoreImageData(const cImage &Image);
958  virtual void DropImageData(int ImageHandle);
960  static const cImage *GetImageData(int ImageHandle);
962 public:
963  cOsdProvider(void);
964  //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.)
965  virtual ~cOsdProvider();
966  static cOsd *NewOsd(int Left, int Top, uint Level = OSD_LEVEL_DEFAULT);
972  static void UpdateOsdSize(bool Force = false);
977  static bool SupportsTrueColor(void);
979  static int StoreImage(const cImage &Image);
989  static void DropImage(int ImageHandle);
992  static void Shutdown(void);
994  };
995 
997 private:
1000  const cFont *font;
1004  void DrawText(void);
1005 public:
1006  cTextScroller(void);
1007  cTextScroller(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1008  void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1009  void Reset(void);
1010  int Left(void) { return left; }
1011  int Top(void) { return top; }
1012  int Width(void) { return width; }
1013  int Height(void) { return height; }
1014  int Total(void) { return textWrapper.Lines(); }
1015  int Offset(void) { return offset; }
1016  int Shown(void) { return shown; }
1017  bool CanScroll(void) { return CanScrollUp() || CanScrollDown(); }
1018  bool CanScrollUp(void) { return offset > 0; }
1019  bool CanScrollDown(void) { return offset + shown < Total(); }
1020  void Scroll(bool Up, bool Page);
1021  };
1022 
1023 #endif //__OSD_H
cRect(const cPoint &Point, const cSize &Size)
Definition: osd.h:356
cRect dirtyDrawPort
Definition: osd.h:461
int height
Definition: osd.h:999
void ReduceBpp(const cPalette &Palette)
Reduces the color depth of the bitmap to that of the given Palette.
Definition: osd.c:754
int y2
Definition: osd.h:295
int Shown(void)
Definition: osd.h:1016
cOsdProvider(void)
Definition: osd.c:1961
int maxColors
Definition: osd.h:92
virtual void Pan(const cPoint &Dest, const cRect &Source=cRect::Null)
Does the same as Scroll(), but also shifts the draw port accordingly, so that the view port doesn't g...
Definition: osd.c:1597
static int OsdHeight(void)
Definition: osd.h:784
int y0
Definition: osd.h:172
cPixmapMemory(void)
Definition: osd.c:1123
void Lock(void)
Definition: thread.c:191
Definition: osd.h:36
cSize size
Definition: osd.h:351
int width
Definition: osd.h:999
cOsd * osd
Definition: osd.h:998
int Height(void) const
Definition: osd.h:432
static int oldHeight
Definition: osd.h:938
void SetTop(int Top)
Definition: osd.h:382
Definition: osd.h:450
virtual void DrawPixel(const cPoint &Point, tColor Color)=0
Sets the pixel at the given Point to the given Color, which is a full 32 bit ARGB value...
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
Definition: osd.c:127
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false)
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
Definition: osd.c:1254
bool Covers(int x1, int y1, int x2, int y2) const
Returns true if the rectangle defined by the given coordinates completely covers this bitmap...
Definition: osd.c:324
void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false)
Sets the pixels in this bitmap with the data from the given Bitmap, putting the upper left corner of ...
Definition: osd.c:522
int height
Definition: osd.h:173
void Shift(const cPoint &Dp)
Definition: osd.h:386
virtual void Pan(const cPoint &Dest, const cRect &Source=cRect::Null)=0
Does the same as Scroll(), but also shifts the draw port accordingly, so that the view port doesn't g...
static cImage * images[MAXOSDIMAGES]
Definition: osd.h:940
int y
Definition: osd.h:305
cPoint(void)
Definition: osd.h:307
void SetWidth(int Width)
Definition: osd.h:379
virtual void SetViewPort(const cRect &Rect)
Sets the pixmap's view port to the given Rect.
Definition: osd.c:1047
void Shift(int Dx, int Dy)
Definition: osd.h:320
void Clean(void)
Marks the dirty area as clean.
Definition: osd.c:354
void Reset(void)
Resets the palette, making it contain no colors.
Definition: osd.c:138
int left
Definition: osd.h:999
static cOsdProvider * osdProvider
Definition: osd.h:936
int dirtyY1
Definition: osd.h:174
tColor HsvToColor(double H, double S, double V)
Converts the given Hue (0..360), Saturation (0..1) and Value (0..1) to an RGB tColor value...
Definition: osd.c:19
virtual void Scroll(const cPoint &Dest, const cRect &Source=cRect::Null)
Scrolls the data in the pixmap's draw port to the given Dest point.
Definition: osd.c:1563
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition: osd.c:1800
void SetHeight(int Height)
Definition: osd.h:380
virtual void SetActive(bool On)
Sets this OSD to be the active one.
Definition: osd.h:753
cRect(const cRect &Rect)
Definition: osd.h:358
virtual ~cPalette()
Definition: osd.c:123
static const cImage * GetImageData(int ImageHandle)
Gets the image data referenced by ImageHandle.
Definition: osd.c:2048
cRect Shifted(const cPoint &Dp) const
Definition: osd.h:388
bool operator<(const cSize &Size) const
Definition: osd.h:336
static int osdLeft
Definition: osd.h:719
bool SetXpm(const char *const Xpm[], bool IgnoreNone=false)
Sets this bitmap to the given XPM data.
Definition: osd.c:428
cTextScroller(void)
Definition: osd.c:2077
void Shift(const cPoint &Dp)
Definition: osd.h:321
virtual void DrawPixel(const cPoint &Point, tColor Color)
Sets the pixel at the given Point to the given Color, which is a full 32 bit ARGB value...
Definition: osd.c:1240
int x1
Definition: osd.h:295
Definition: osd.h:163
static void SetOsdPosition(int Left, int Top, int Width, int Height)
Sets the position and size of the OSD to the given values.
Definition: osd.c:1667
virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)
Copies the part of the given Pixmap covered by Source into this pixmap at location Dest...
Definition: osd.c:1536
const tColor * Colors(int &NumColors) const
Returns a pointer to the complete color table and stores the number of valid entries in NumColors...
Definition: osd.c:185
cRect drawPort
Definition: osd.h:459
virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool ReplacePalette=false, bool Overlay=false)
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
Definition: osd.c:1899
int Alpha(void) const
Definition: osd.h:529
int numBitmaps
Definition: osd.h:725
bool operator!=(const cPoint &Point) const
Definition: osd.h:311
tIndex * bitmap
Definition: osd.h:171
const cRect & DrawPort(void) const
Returns the pixmap's draw port, which is relative to the view port.
Definition: osd.h:535
Definition: osd.h:415
int Index(tColor Color)
Returns the index of the given Color (the first color has index 0).
Definition: osd.c:144
cPoint(int X, int Y)
Definition: osd.h:308
virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants=0)
Draws a filled ellipse defined by the upper left (x1, y1) and lower right (x2, y2) corners with the g...
Definition: osd.c:1929
void SetSize(int Width, int Height)
Definition: osd.h:375
void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg)
Definition: osd.c:2093
cVector< cPixmap * > pixmaps
Definition: osd.h:727
int bpp
Definition: osd.h:91
bool tile
Definition: osd.h:457
cPixmap(void)
Definition: osd.c:949
bool isTrueColor
Definition: osd.h:722
int Width(void) const
Definition: osd.h:363
int dirtyX1
Definition: osd.h:174
tIndex tIndexes[MAXNUMCOLORS]
Definition: osd.h:96
int X(void) const
Definition: osd.h:314
cBitmap * Scaled(double FactorX, double FactorY, bool AntiAlias=false)
Creates a copy of this bitmap, scaled by the given factors.
Definition: osd.c:827
#define MAXOSDIMAGES
Definition: osd.h:931
bool IsEmpty(void) const
Returns true if this rectangle is empty.
Definition: osd.h:411
cPoint operator-(const cPoint &Point) const
Definition: osd.h:313
int bpp
Definition: osd.h:296
bool Active(void)
Definition: osd.h:752
void MarkViewPortDirty(const cRect &Rect)
Marks the given rectangle of the view port of this pixmap as dirty.
Definition: osd.c:974
Definition: osd.h:302
int Lines(void)
Returns the actual number of lines needed to display the full wrapped text.
Definition: font.h:113
cSize(const cSize &Size)
Definition: osd.h:333
virtual ~cPixmap()
Definition: osd.h:463
virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty=true)
Sets the pixmap's draw port to the given Point.
Definition: osd.c:1064
const uint8_t * Data(void)
Definition: osd.h:686
void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants=0)
Draws a filled ellipse defined by the upper left (x1, y1) and lower right (x2, y2) corners with the g...
Definition: osd.c:621
virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
Definition: osd.c:1919
tColor Blend(tColor ColorFg, tColor ColorBg, uint8_t Level) const
Determines a color that consists of a linear blend between ColorFg and ColorBg.
Definition: osd.c:216
cSize(int Width, int Height)
Definition: osd.h:332
int OSDTop
Definition: config.h:312
virtual int StoreImageData(const cImage &Image)
Copies the given Image and returns a handle for later reference.
Definition: osd.c:2027
cRect(void)
Definition: osd.h:354
virtual eOsdError SetPalette(const cPalette &Palette, int Area)
Sets the Palette for the given Area (the first area is numbered 0).
Definition: osd.c:1866
static double oldAspect
Definition: osd.h:939
cPixmapMemory * RenderPixmaps(void)
Renders the dirty part of all pixmaps into a resulting pixmap that shall be displayed on the OSD...
Definition: osd.c:1729
virtual void Fill(tColor Color)
Fills the pixmap's draw port with the given Color.
Definition: osd.c:1148
int Height(void) const
Definition: osd.h:338
int top
Definition: osd.h:999
int shown
Definition: osd.h:1002
virtual void SetAlpha(int Alpha)
Sets the alpha value of this pixmap to the given value.
Definition: osd.c:1025
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)
Draws the given string at coordinates (x, y) with the given foreground and background color and font...
Definition: osd.c:551
void SetHeight(int Height)
Definition: osd.h:340
void SetY(int Y)
Definition: osd.h:378
int Bpp(void) const
Definition: osd.h:111
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: osd.c:1949
bool active
Definition: osd.h:730
bool Intersects(const tArea &Area) const
Definition: osd.h:299
static cMutex mutex
Definition: osd.h:454
bool Contains(const cPoint &Point) const
Definition: osd.h:343
Definition: osd.h:158
Definition: osd.h:169
void Scroll(bool Up, bool Page)
Definition: osd.c:2123
int Width(void) const
Definition: osd.h:188
static void Lock(void)
All public member functions of cPixmap set locks as necessary to make sure they are thread-safe (unle...
Definition: osd.h:521
cPixmap * AddPixmap(cPixmap *Pixmap)
Adds the given Pixmap to the list of currently active pixmaps in this OSD.
Definition: osd.c:1716
Definition: osd.h:34
int Height(void)
Definition: osd.h:1013
bool operator!=(const cRect &Rect) const
Definition: osd.h:360
bool operator==(const cSize &Size) const
Definition: osd.h:334
const cRect & ViewPort(void) const
Returns the pixmap's view port, which is relative to the OSD's origin.
Definition: osd.h:531
void SetSize(int Width, int Height)
Sets the size of this bitmap to the given values.
Definition: osd.c:294
cBitmap * savedBitmap
Definition: osd.h:723
void SetX(int X)
Definition: osd.h:316
bool operator!=(const cSize &Size) const
Definition: osd.h:335
Definition: osd.h:161
void Combine(const cRect &Rect)
Combines this rectangle with the given Rect.
Definition: osd.c:921
cRect Shifted(int Dx, int Dy) const
Definition: osd.h:387
Definition: osd.h:33
tColor color[MAXNUMCOLORS]
Definition: osd.h:90
void SetPoint(int X, int Y)
Definition: osd.h:373
int Width(void) const
Definition: osd.h:297
virtual cOsd * CreateOsd(int Left, int Top, uint Level)=0
Returns a pointer to a newly created cOsd object, which will be located at the given coordinates...
virtual void DrawImage(const cPoint &Point, const cImage &Image)=0
Draws the given Image into this pixmap at the given Point.
int Top(void)
Definition: osd.h:796
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)=0
Draws the given string at Point with the given foreground and background color and font...
void Replace(const cPalette &Palette)
Replaces the colors of this palette with the colors from the given palette.
Definition: osd.c:208
bool Dirty(int &x1, int &y1, int &x2, int &y2)
Tells whether there is a dirty area and returns the bounding rectangle of that area (relative to the ...
Definition: osd.c:342
static cMutex mutex
Definition: osd.h:721
bool LoadXpm(const char *FileName)
Calls SetXpm() with the data from the file FileName.
Definition: osd.c:362
const cSize & Size(void) const
Definition: osd.h:370
void Set(int Width, int Height)
Definition: osd.h:341
static int OsdWidth(void)
Definition: osd.h:783
bool Tile(void) const
Definition: osd.h:530
virtual void DestroyPixmap(cPixmap *Pixmap)
Destroys the given Pixmap, which has previously been created by a call to CreatePixmap().
Definition: osd.c:1700
cPoint operator-(void) const
Definition: osd.h:312
int width
Definition: osd.h:728
double antiAliasGranularity
Definition: osd.h:94
int numColors
Definition: osd.h:92
static cVector< cOsd * > Osds
Definition: osd.h:720
int Height(void) const
Definition: osd.h:189
Definition: osd.h:37
void Set(const cSize &Size)
Definition: osd.h:342
bool Intersects(int x1, int y1, int x2, int y2) const
Returns true if the rectangle defined by the given coordinates intersects with this bitmap...
Definition: osd.c:333
virtual void DrawRectangle(const cRect &Rect, tColor Color)
Draws a filled rectangle with the given Color.
Definition: osd.c:1330
Definition: osd.h:39
Definition: osd.h:162
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition: osd.c:1778
Definition: osd.h:348
void Set(cPoint Point, cSize Size)
Definition: osd.h:372
Definition: osd.h:164
virtual ~cOsdProvider()
Definition: osd.c:1967
const tColor * Data(void) const
Definition: osd.h:433
void SetBottom(int Bottom)
Definition: osd.h:384
const cRect & DirtyDrawPort(void) const
Returns the "dirty" rectangle in the draw port of this this pixmap.
Definition: osd.h:546
cRect viewPort
Definition: osd.h:458
int height
Definition: osd.h:329
virtual ~cOsd()
Shuts down the OSD.
Definition: osd.c:1648
void DrawPixel(int x, int y, tColor Color)
Sets the pixel at the given coordinates to the given Color, which is a full 32 bit ARGB value...
Definition: osd.c:515
void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type)
Draws a "slope" into the rectangle defined by the upper left (x1, y1) and lower right (x2...
Definition: osd.c:716
void SetLeft(int Left)
Definition: osd.h:381
#define MAXOSDAREAS
Definition: osd.h:703
tColor GetPixel(const cPoint &Point) const
Returns the pixel value at the given Point.
Definition: osd.h:434
void Set(int X, int Y, int Width, int Height)
Definition: osd.h:371
cPoint(const cPoint &Point)
Definition: osd.h:309
bool Contains(const cPoint &Point) const
Returns true if this rectangle contains Point.
Definition: osd.c:885
int x2
Definition: osd.h:295
void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color)
Draws a filled rectangle defined by the upper left (x1, y1) and lower right (x2, y2) corners with the...
Definition: osd.c:600
cPoint point
Definition: osd.h:350
static void UpdateOsdSize(bool Force=false)
Inquires the actual size of the video display and adjusts the OSD and font sizes accordingly.
Definition: osd.c:1992
const cRect & DirtyViewPort(void) const
Returns the "dirty" rectangle this pixmap causes on the OSD.
Definition: osd.h:539
bool Contains(int x, int y) const
Returns true if this bitmap contains the point (x, y).
Definition: osd.c:317
const cFont * font
Definition: osd.h:1000
static const cCursesFont Font
Definition: skincurses.c:30
cRect Intersected(const cRect &Rect) const
Returns the intersection of this rectangle and the given Rect.
Definition: osd.c:909
int Left(void) const
Definition: osd.h:365
tColor colorFg
Definition: osd.h:1001
The cOsd class is the interface to the "On Screen Display".
Definition: osd.h:716
Definition: osd.h:40
int Top(void)
Definition: osd.h:1011
void Set(const cPoint &Point)
Definition: osd.h:319
virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)=0
Renders the part of the given Pixmap covered by Source into this pixmap at location Dest...
Definition: osd.h:326
void SetClean(void)
Resets the "dirty" rectangles of this pixmap.
Definition: osd.c:1005
cSetup Setup
Definition: config.c:373
tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
Definition: osd.h:63
int Width(void) const
Definition: osd.h:337
bool panning
Definition: osd.h:681
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image into this pixmap at the given Point.
Definition: osd.c:1208
tColor * data
Definition: osd.h:418
eTextAlignment
Definition: osd.h:158
static int osdTop
Definition: osd.h:719
bool CanScroll(void)
Definition: osd.h:1017
static int IsOpen(void)
Returns true if there is currently a level 0 OSD open.
Definition: osd.h:790
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)
Draws the given string at coordinates (x, y) with the given foreground and background color and font...
Definition: osd.c:1909
int OSDLeft
Definition: config.h:312
Definition: osd.h:38
Definition: thread.h:63
void Clear(void)
Clears the image data by setting all pixels to be fully transparent.
Definition: osd.c:1110
static const cRect Null
Definition: osd.h:353
int Width(void) const
Definition: osd.h:431
int Size(void) const
Definition: tools.h:533
int Right(void) const
Definition: osd.h:367
void DrawText(void)
Definition: osd.c:2115
virtual void SetTile(bool Tile)
Sets the tile property of this pixmap to the given value.
Definition: osd.c:1036
static int OsdTop(void)
Definition: osd.h:782
tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer=ALPHA_OPAQUE)
Definition: osd.c:81
const cPoint & Point(void) const
Definition: osd.h:369
cPoint Shifted(const cPoint &Dp) const
Definition: osd.h:323
int x0
Definition: osd.h:172
void SetColor(int Index, tColor Color)
Sets the palette entry at Index to Color.
Definition: osd.c:172
bool CanScrollUp(void)
Definition: osd.h:1018
cMutex * mutex
Definition: thread.h:137
int dirtyX2
Definition: osd.h:174
void Grow(int Dx, int Dy)
Grows the rectangle by the given number of pixels in either direction.
Definition: osd.c:879
int offset
Definition: osd.h:1002
int Height(void)
Definition: osd.h:798
virtual ~cImage()
Definition: osd.c:1105
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty)
Draws the Dirty part of the given Pixmap into this pixmap.
Definition: osd.c:1157
int Y0(void) const
Definition: osd.h:187
cRect(int X, int Y, int Width, int Height)
Definition: osd.h:355
void SetRight(int Right)
Definition: osd.h:383
static int OsdLeft(void)
Definition: osd.h:781
Definition: osd.h:41
void ShrinkBpp(int NewBpp)
Shrinks the color depth of the bitmap to NewBpp by keeping only the 2^NewBpp most frequently used col...
Definition: osd.c:785
int Left(void)
Definition: osd.h:1010
tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
Definition: osd.h:58
void Set(int X, int Y)
Definition: osd.h:318
virtual cPixmap * CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort=cRect::Null)
Creates a new true color pixmap on this OSD (see cPixmap for details).
Definition: osd.c:1688
virtual void Fill(tColor Color)=0
Fills the pixmap's draw port with the given Color.
const tIndex * Data(int x, int y) const
Returns the address of the index byte at the given coordinates.
Definition: osd.c:749
int Height(void) const
Definition: osd.h:298
const cSize & Size(void) const
Definition: osd.h:430
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)
Draws the given string at Point with the given foreground and background color and font...
Definition: osd.c:1281
#define MAXNUMCOLORS
Definition: osd.h:24
static bool SupportsTrueColor(void)
Returns true if the current OSD provider is able to handle a true color OSD.
Definition: osd.c:2017
virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants=0)=0
Draws a filled ellipse with the given Color that fits into the given rectangle.
virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)
Renders the part of the given Pixmap covered by Source into this pixmap at location Dest...
Definition: osd.c:1501
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)
Draws a "slope" with the given Color into the given rectangle.
Definition: osd.c:1459
int Height(void) const
Definition: osd.h:364
void Shift(int Dx, int Dy)
Definition: osd.h:385
int y1
Definition: osd.h:295
virtual void Clear(void)
Clears the pixmap's draw port by setting all pixels to be fully transparent.
Definition: osd.c:1140
Definition: osd.h:88
void Reset(void)
Definition: osd.c:2110
Definition: osd.h:294
#define OSD_LEVEL_DEFAULT
Definition: osd.h:21
int Width(void)
Definition: osd.h:797
eOsdError
Definition: osd.h:44
cSize Grown(int Dw, int Dh) const
Definition: osd.h:345
Definition: osd.h:159
cBitmap * bitmaps[MAXOSDAREAS]
Definition: osd.h:724
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false)=0
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
int alpha
Definition: osd.h:456
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)=0
Draws a "slope" with the given Color into the given rectangle.
int Left(void)
Definition: osd.h:795
virtual void DrawPixel(int x, int y, tColor Color)
Sets the pixel at the given coordinates to the given Color, which is a full 32 bit ARGB value...
Definition: osd.c:1889
cRect Combined(const cPoint &Point) const
Returns the surrounding rectangle that contains this rectangle and the given Point.
Definition: osd.h:408
virtual bool ProvidesTrueColor(void)
Returns true if this OSD provider is able to handle a true color OSD.
Definition: osd.h:945
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image on this OSD at the given Point.
Definition: osd.c:1877
int Width(void)
Definition: osd.h:1012
int height
Definition: osd.h:728
static int osdHeight
Definition: osd.h:719
virtual ~cPixmapMemory()
Definition: osd.c:1135
cPixmapMemory * savedPixmap
Definition: osd.h:726
void MarkDrawPortDirty(const cRect &Rect)
Marks the given rectangle of the draw port of this pixmap as dirty.
Definition: osd.c:985
cSize size
Definition: osd.h:417
bool modified
Definition: osd.h:93
int top
Definition: osd.h:728
tColor RgbShade(tColor Color, double Factor)
Returns a brighter (Factor > 0) or darker (Factor < 0) version of the given Color.
Definition: osd.c:43
int Y(void) const
Definition: osd.h:315
static int oldWidth
Definition: osd.h:937
Definition: osd.h:44
Definition: osd.h:160
int ClosestColor(tColor Color, int MaxDiff=INT_MAX) const
Returns the index of a color in this palette that is closest to the given Color.
Definition: osd.c:235
cPixmapMutexLock(void)
Definition: osd.h:670
tColor Color(int Index) const
Returns the color at the given Index.
Definition: osd.h:119
tColor GetColor(int x, int y) const
Returns the color at the given coordinates.
Definition: osd.h:273
static int StoreImage(const cImage &Image)
Stores the given Image for later use with DrawImage() on an OSD or pixmap.
Definition: osd.c:2056
int Bottom(void) const
Definition: osd.h:368
void SetWidth(int Width)
Definition: osd.h:339
void Take(const cPalette &Palette, tIndexes *Indexes=NULL, tColor ColorFg=0, tColor ColorBg=0)
Takes the colors from the given Palette and adds them to this palette, using existing entries if poss...
Definition: osd.c:191
virtual void SetLayer(int Layer)
Sets the layer of this pixmap to the given value.
Definition: osd.c:1010
void Fill(tColor Color)
Fills the image data with the given Color.
Definition: osd.c:1115
cRect Combined(const cRect &Rect) const
Returns the surrounding rectangle that contains this rectangle and the given Rect.
Definition: osd.h:403
void SetPixel(const cPoint &Point, tColor Color)
Sets the pixel at the given Point to Color.
Definition: osd.h:438
cOsd(int Left, int Top, uint Level)
Initializes the OSD with the given coordinates.
Definition: osd.c:1627
int X(void) const
Definition: osd.h:361
void SetY(int Y)
Definition: osd.h:317
void SetSize(const cSize &Size)
Definition: osd.h:376
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition: osd.c:1848
virtual void Clear(void)=0
Clears the pixmap's draw port by setting all pixels to be fully transparent.
int width
Definition: osd.h:328
virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants=0)
Draws a filled ellipse with the given Color that fits into the given rectangle.
Definition: osd.c:1357
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
Definition: osd.c:1675
virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type)
Draws a "slope" into the rectangle defined by the upper left (x1, y1) and lower right (x2...
Definition: osd.c:1939
uint level
Definition: osd.h:729
void Grow(int Dw, int Dh)
Definition: osd.h:344
cRect Grown(int Dw, int Dh) const
Definition: osd.h:392
static void Unlock(void)
Definition: osd.h:527
void SetBpp(int Bpp)
Sets the color depth of this palette to the given value.
Definition: osd.c:165
int left
Definition: osd.h:728
int OSDHeight
Definition: config.h:312
int X0(void) const
Definition: osd.h:186
virtual void DropImageData(int ImageHandle)
Drops the image data referenced by ImageHandle.
Definition: osd.c:2039
cRect(const cSize &Size)
Definition: osd.h:357
virtual ~cBitmap()
Definition: osd.c:289
bool IsTrueColor(void) const
Returns 'true' if this is a true color OSD (providing full 32 bit color depth).
Definition: osd.h:792
int OSDWidth
Definition: config.h:312
uint8_t tIndex
Definition: font.h:31
static void DropImage(int ImageHandle)
Drops the image referenced by the given ImageHandle.
Definition: osd.c:2063
int Layer(void) const
Definition: osd.h:528
cPoint Shifted(int Dx, int Dy) const
Definition: osd.h:322
cSize(void)
Definition: osd.h:331
void SetPoint(const cPoint &Point)
Definition: osd.h:374
cImage(void)
Definition: osd.c:1083
cPalette(int Bpp=8)
Initializes the palette with the given color depth.
Definition: osd.c:117
int Y(void) const
Definition: osd.h:362
cBitmap(int Width, int Height, int Bpp, int X0=0, int Y0=0)
Creates a bitmap with the given Width, Height and color depth (Bpp).
Definition: osd.c:261
Definition: osd.h:52
tColor colorBg
Definition: osd.h:1001
tColor * data
Definition: osd.h:680
virtual void SaveRegion(int x1, int y1, int x2, int y2)
Saves the region defined by the given coordinates for later restoration through RestoreRegion().
Definition: osd.c:1832
uint8_t tIndex
Definition: osd.h:56
void SetIndex(int x, int y, tIndex Index)
Sets the index at the given coordinates to Index.
Definition: osd.c:500
cBitmap * GetBitmap(int Area)
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
Definition: osd.c:1683
cRect dirtyViewPort
Definition: osd.h:460
Definition: osd.h:35
bool Intersects(const cRect &Rect) const
Returns true if this rectangle intersects with Rect.
Definition: osd.c:901
void SetX(int X)
Definition: osd.h:377
bool operator==(const cRect &Rect) const
Definition: osd.h:359
uint32_t tColor
Definition: osd.h:55
Definition: font.h:37
int x
Definition: osd.h:304
int Top(void) const
Definition: osd.h:366
static void Shutdown(void)
Shuts down the OSD provider facility by deleting the current OSD provider.
Definition: osd.c:2069
int width
Definition: osd.h:173
int Offset(void)
Definition: osd.h:1015
int layer
Definition: osd.h:455
cTextWrapper textWrapper
Definition: osd.h:1003
virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest)=0
Copies the part of the given Pixmap covered by Source into this pixmap at location Dest...
virtual void DrawRectangle(const cRect &Rect, tColor Color)=0
Draws a filled rectangle with the given Color.
#define ALPHA_OPAQUE
Definition: osd.h:26
bool operator==(const cPoint &Point) const
Definition: osd.h:310
static int osdWidth
Definition: osd.h:719
virtual void Scroll(const cPoint &Dest, const cRect &Source=cRect::Null)=0
Scrolls the data in the pixmap's draw port to the given Dest point.
uint32_t tColor
Definition: font.h:29
bool CanScrollDown(void)
Definition: osd.h:1019
int dirtyY2
Definition: osd.h:174
void Unlock(void)
Definition: thread.c:197
static cOsd * NewOsd(int Left, int Top, uint Level=OSD_LEVEL_DEFAULT)
Returns a pointer to a newly created cOsd object, which will be located at the given coordinates...
Definition: osd.c:1972
int Total(void)
Definition: osd.h:1014