vdr  2.4.1
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 4.5.1.1 2019/05/24 21:30:20 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  void SetOffset(int X0, int Y0) { x0 = X0; y0 = Y0; }
197  bool Contains(int x, int y) const;
199  bool Covers(int x1, int y1, int x2, int y2) const;
202  bool Intersects(int x1, int y1, int x2, int y2) const;
205  bool Dirty(int &x1, int &y1, int &x2, int &y2);
208  void Clean(void);
210  bool LoadXpm(const char *FileName);
213  bool SetXpm(const char *const Xpm[], bool IgnoreNone = false);
223  void SetIndex(int x, int y, tIndex Index);
226  void Fill(tIndex Index);
228  void DrawPixel(int x, int y, tColor Color);
232  void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
242  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);
248  void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
253  void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
263  void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
275  const tIndex *Data(int x, int y) const;
277  tColor GetColor(int x, int y) const { return Color(*Data(x, y)); }
279  void ReduceBpp(const cPalette &Palette);
285  void ShrinkBpp(int NewBpp);
290  cBitmap *Scaled(double FactorX, double FactorY, bool AntiAlias = false) const;
296  };
297 
298 struct tArea {
299  int x1, y1, x2, y2;
300  int bpp;
301  int Width(void) const { return x2 - x1 + 1; }
302  int Height(void) const { return y2 - y1 + 1; }
303  bool Intersects(const tArea &Area) const { return !(x2 < Area.x1 || x1 > Area.x2 || y2 < Area.y1 || y1 > Area.y2); }
304  };
305 
306 class cPoint {
307 private:
308  int x;
309  int y;
310 public:
311  cPoint(void) { x = y = 0; }
312  cPoint(int X, int Y) { x = X; y = Y; }
313  cPoint(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
314  bool operator==(const cPoint &Point) const { return x == Point.X() && y == Point.Y(); }
315  bool operator!=(const cPoint &Point) const { return !(*this == Point); }
316  cPoint operator-(void) const { return cPoint(-x, -y); }
317  cPoint operator-(const cPoint &Point) const { return cPoint(x - Point.X(), y - Point.Y()); }
318  int X(void) const { return x; }
319  int Y(void) const { return y; }
320  void SetX(int X) { x = X; }
321  void SetY(int Y) { y = Y; }
322  void Set(int X, int Y) { x = X; y = Y; }
323  void Set(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
324  void Shift(int Dx, int Dy) { x += Dx; y += Dy; }
325  void Shift(const cPoint &Dp) { x += Dp.X(); y += Dp.Y(); }
326  cPoint Shifted(int Dx, int Dy) const { cPoint p(*this); p.Shift(Dx, Dy); return p; }
327  cPoint Shifted(const cPoint &Dp) const { cPoint p(*this); p.Shift(Dp); return p; }
328  };
329 
330 class cSize {
331 private:
332  int width;
333  int height;
334 public:
335  cSize(void) { width = height = 0; }
336  cSize(int Width, int Height) { width = Width; height = Height; }
337  cSize(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
338  bool operator==(const cSize &Size) const { return width == Size.Width() && height == Size.Height(); }
339  bool operator!=(const cSize &Size) const { return !(*this == Size); }
340  bool operator<(const cSize &Size) const { return width < Size.Width() && height < Size.Height(); }
341  int Width(void) const { return width; }
342  int Height(void) const { return height; }
343  void SetWidth(int Width) { width = Width; }
344  void SetHeight(int Height) { height = Height; }
345  void Set(int Width, int Height) { width = Width; height = Height; }
346  void Set(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
347  bool Contains(const cPoint &Point) const { return 0 <= Point.X() && 0 <= Point.Y() && Point.X() < width && Point.Y() < height; }
348  void Grow(int Dw, int Dh) { width += 2 * Dw; height += 2 * Dh; }
349  cSize Grown(int Dw, int Dh) const { cSize s(*this); s.Grow(Dw, Dh); return s; }
350  };
351 
352 class cRect {
353 private:
356 public:
357  static const cRect Null;
358  cRect(void): point(0, 0), size(0, 0) {}
359  cRect(int X, int Y, int Width, int Height): point(X, Y), size(Width, Height) {}
360  cRect(const cPoint &Point, const cSize &Size): point(Point), size(Size) {}
361  cRect(const cSize &Size): point(0, 0), size(Size) {}
362  cRect(const cRect &Rect): point(Rect.Point()), size(Rect.Size()) {}
363  bool operator==(const cRect &Rect) const { return point == Rect.Point() && size == Rect.Size(); }
364  bool operator!=(const cRect &Rect) const { return !(*this == Rect); }
365  int X(void) const { return point.X(); }
366  int Y(void) const { return point.Y(); }
367  int Width(void) const { return size.Width(); }
368  int Height(void) const { return size.Height(); }
369  int Left(void) const { return X(); }
370  int Top(void) const { return Y(); }
371  int Right(void) const { return X() + Width() - 1; }
372  int Bottom(void) const { return Y() + Height() - 1; }
373  const cPoint &Point(void) const { return point; }
374  const cSize &Size(void) const { return size; }
375  void Set(int X, int Y, int Width, int Height) { point.Set(X, Y); size.Set(Width, Height); }
377  void SetPoint(int X, int Y) { point.Set(X, Y); }
378  void SetPoint(const cPoint &Point) { point.Set(Point); }
379  void SetSize(int Width, int Height) { size.Set(Width, Height); }
380  void SetSize(const cSize &Size) { size.Set(Size); }
381  void SetX(int X) { point.SetX(X); }
382  void SetY(int Y) { point.SetY(Y); }
383  void SetWidth(int Width) { size.SetWidth(Width); }
385  void SetLeft(int Left) { SetWidth(Width() + X() - Left); SetX(Left); }
386  void SetTop(int Top) { SetHeight(Height() + Y() - Top); SetY(Top); }
387  void SetRight(int Right) { SetWidth(Right - X() + 1); }
388  void SetBottom(int Bottom) { SetHeight(Bottom - Y() + 1); }
389  void Shift(int Dx, int Dy) { point.Shift(Dx, Dy); }
390  void Shift(const cPoint &Dp) { point.Shift(Dp); }
391  cRect Shifted(int Dx, int Dy) const { cRect r(*this); r.Shift(Dx, Dy); return r; }
392  cRect Shifted(const cPoint &Dp) const { cRect r(*this); r.Shift(Dp); return r; }
393  void Grow(int Dx, int Dy);
396  cRect Grown(int Dw, int Dh) const { cRect r(*this); r.Grow(Dw, Dh); return r; }
397  bool Contains(const cPoint &Point) const;
399  bool Contains(const cRect &Rect) const;
401  bool Intersects(const cRect &Rect) const;
403  cRect Intersected(const cRect &Rect) const;
405  void Combine(const cRect &Rect);
407  cRect Combined(const cRect &Rect) const { cRect r(*this); r.Combine(Rect); return r; }
410  void Combine(const cPoint &Point);
412  cRect Combined(const cPoint &Point) const { cRect r(*this); r.Combine(Point); return r; }
415  bool IsEmpty(void) const { return Width() <= 0 || Height() <= 0; }
417  };
418 
419 class cImage {
420 private:
423 public:
424  cImage(void);
425  cImage(const cImage &Image);
426  cImage(const cSize &Size, const tColor *Data = NULL);
433  virtual ~cImage();
434  const cSize &Size(void) const { return size; }
435  int Width(void) const { return size.Width(); }
436  int Height(void) const { return size.Height(); }
437  const tColor *Data(void) const { return data; }
438  tColor GetPixel(const cPoint &Point) const { return data[size.Width() * Point.Y() + Point.X()]; }
442  void SetPixel(const cPoint &Point, tColor Color) { data[size.Width() * Point.Y() + Point.X()] = Color; }
446  void Clear(void);
448  void Fill(tColor Color);
450  };
451 
452 #define MAXPIXMAPLAYERS 8
453 
454 class cPixmap {
455  friend class cOsd;
456  friend class cPixmapMutexLock;
457 private:
458  static cMutex mutex;
459  int layer;
460  int alpha;
461  bool tile;
466 protected:
467  virtual ~cPixmap() {}
468  void MarkViewPortDirty(const cRect &Rect);
472  void MarkViewPortDirty(const cPoint &Point);
476  void MarkDrawPortDirty(const cRect &Rect);
482  void MarkDrawPortDirty(const cPoint &Point);
488  void SetClean(void);
490  virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty);
495 public:
496  cPixmap(void);
497  cPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
529  static void Lock(void) { mutex.Lock(); }
535  static void Unlock(void) { mutex.Unlock(); }
536  int Layer(void) const { return layer; }
537  int Alpha(void) const { return alpha; }
538  bool Tile(void) const { return tile; }
539  const cRect &ViewPort(void) const { return viewPort; }
543  const cRect &DrawPort(void) const { return drawPort; }
547  const cRect &DirtyViewPort(void) const { return dirtyViewPort; }
554  const cRect &DirtyDrawPort(void) const { return dirtyDrawPort; }
561  virtual void SetLayer(int Layer);
568  virtual void SetAlpha(int Alpha);
573  virtual void SetTile(bool Tile);
579  virtual void SetViewPort(const cRect &Rect);
583  virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty = true);
592  virtual void Clear(void) = 0;
595  virtual void Fill(tColor Color) = 0;
598  virtual void DrawImage(const cPoint &Point, const cImage &Image) = 0;
600  virtual void DrawImage(const cPoint &Point, int ImageHandle) = 0;
605  virtual void DrawPixel(const cPoint &Point, tColor Color) = 0;
610  virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false) = 0;
621  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;
627  virtual void DrawRectangle(const cRect &Rect, tColor Color) = 0;
629  virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0) = 0;
638  virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) = 0;
649  virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
653  virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
658  virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
662  virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
674  };
675 
676 class cPixmapMutexLock : public cMutexLock {
677 public:
679  };
680 
681 #define LOCK_PIXMAPS cPixmapMutexLock PixmapMutexLock
682 
683 // cPixmapMemory is an implementation of cPixmap that uses an array of tColor
684 // values to store the pixmap.
685 
686 class cPixmapMemory : public cPixmap {
687 private:
689  bool panning;
690 public:
691  cPixmapMemory(void);
692  cPixmapMemory(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
693  virtual ~cPixmapMemory();
694  const uint8_t *Data(void) { return (uint8_t *)data; }
695  virtual void Clear(void);
696  virtual void Fill(tColor Color);
697  virtual void DrawImage(const cPoint &Point, const cImage &Image);
698  virtual void DrawImage(const cPoint &Point, int ImageHandle);
699  virtual void DrawPixel(const cPoint &Point, tColor Color);
700  virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false);
701  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);
702  virtual void DrawRectangle(const cRect &Rect, tColor Color);
703  virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0);
704  virtual void DrawSlope(const cRect &Rect, tColor Color, int Type);
705  virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
706  virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
707  virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null);
708  virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null);
709  };
710 
711 #define MAXOSDAREAS 16
712 
723 
724 class cOsd {
725  friend class cOsdProvider;
726 private:
730  static cMutex mutex;
738  uint level;
739  bool active;
740 protected:
741  cOsd(int Left, int Top, uint Level);
761  bool Active(void) { return active; }
762  virtual void SetActive(bool On) { active = On; }
765  cPixmap *AddPixmap(cPixmap *Pixmap);
771  cPixmap *RenderPixmaps(void);
788 #ifndef DEPRECATED_GETBITMAP
789 #define DEPRECATED_GETBITMAP 0
790 #endif
791 #if DEPRECATED_GETBITMAP
792 public:
793 #endif
794  cBitmap *GetBitmap(int Area);
802 public:
803  virtual ~cOsd();
805  static int OsdLeft(void) { return osdLeft ? osdLeft : Setup.OSDLeft; }
806  static int OsdTop(void) { return osdTop ? osdTop : Setup.OSDTop; }
807  static int OsdWidth(void) { return osdWidth ? osdWidth : Setup.OSDWidth; }
808  static int OsdHeight(void) { return osdHeight ? osdHeight : Setup.OSDHeight; }
809  static void SetOsdPosition(int Left, int Top, int Width, int Height);
814  static int IsOpen(void) { return Osds.Size() && Osds[0]->level == OSD_LEVEL_DEFAULT; }
816  bool IsTrueColor(void) const { return isTrueColor; }
819  int Left(void) { return left; }
820  int Top(void) { return top; }
821  int Width(void) { return width; }
822  int Height(void) { return height; }
823  void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
834  virtual const cSize &MaxPixmapSize(void) const;
840  virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
847  virtual void DestroyPixmap(cPixmap *Pixmap);
852  virtual void DrawImage(const cPoint &Point, const cImage &Image);
855  virtual void DrawImage(const cPoint &Point, int ImageHandle);
861  virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
869  virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
881  virtual void SaveRegion(int x1, int y1, int x2, int y2);
885  virtual void RestoreRegion(void);
888  virtual eOsdError SetPalette(const cPalette &Palette, int Area);
891  virtual void DrawPixel(int x, int y, tColor Color);
897  virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
908  virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias = false);
913  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);
919  virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
922  virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
932  virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
944  virtual void Flush(void);
961  };
962 
963 #define MAXOSDIMAGES 64
964 
966  friend class cPixmapMemory;
967 private:
969  static int oldWidth;
970  static int oldHeight;
971  static double oldAspect;
973  static int osdState;
974 protected:
975  virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0;
978  virtual bool ProvidesTrueColor(void) { return false; }
980  virtual int StoreImageData(const cImage &Image);
991  virtual void DropImageData(int ImageHandle);
993  static const cImage *GetImageData(int ImageHandle);
995 public:
996  cOsdProvider(void);
997  //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.)
998  virtual ~cOsdProvider();
999  static cOsd *NewOsd(int Left, int Top, uint Level = OSD_LEVEL_DEFAULT);
1005  static void UpdateOsdSize(bool Force = false);
1010  static bool OsdSizeChanged(int &State);
1016  static bool SupportsTrueColor(void);
1018  static int StoreImage(const cImage &Image);
1028  static void DropImage(int ImageHandle);
1031  static void Shutdown(void);
1033  };
1034 
1036 private:
1039  const cFont *font;
1043  void DrawText(void);
1044 public:
1045  cTextScroller(void);
1046  cTextScroller(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1047  void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1048  void Reset(void);
1049  int Left(void) { return left; }
1050  int Top(void) { return top; }
1051  int Width(void) { return width; }
1052  int Height(void) { return height; }
1053  int Total(void) { return textWrapper.Lines(); }
1054  int Offset(void) { return offset; }
1055  int Shown(void) { return shown; }
1056  bool CanScroll(void) { return CanScrollUp() || CanScrollDown(); }
1057  bool CanScrollUp(void) { return offset > 0; }
1058  bool CanScrollDown(void) { return offset + shown < Total(); }
1059  void Scroll(bool Up, bool Page);
1060  };
1061 
1062 #endif //__OSD_H
cBitmap::Data
const tIndex * Data(int x, int y) const
Returns the address of the index byte at the given coordinates.
Definition: osd.c:760
cPalette::bpp
int bpp
Definition: osd.h:91
cRect::Grown
cRect Grown(int Dw, int Dh) const
Definition: osd.h:396
cOsd::OsdWidth
static int OsdWidth(void)
Definition: osd.h:807
cTextScroller::top
int top
Definition: osd.h:1038
cBitmap::~cBitmap
virtual ~cBitmap()
Definition: osd.c:289
cPixmap::viewPort
cRect viewPort
Definition: osd.h:462
cImage::size
cSize size
Definition: osd.h:421
cRect::Shift
void Shift(const cPoint &Dp)
Definition: osd.h:390
cSize::Grow
void Grow(int Dw, int Dh)
Definition: osd.h:348
cPixmap::mutex
static cMutex mutex
Definition: osd.h:458
cOsd::Osds
static cVector< cOsd * > Osds
Definition: osd.h:728
cPalette::Bpp
int Bpp(void) const
Definition: osd.h:111
cRect::Height
int Height(void) const
Definition: osd.h:368
cBitmap::DrawSlope
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:727
cPoint::Shifted
cPoint Shifted(int Dx, int Dy) const
Definition: osd.h:326
cBitmap::dirtyY1
int dirtyY1
Definition: osd.h:174
cPixmapMemory::DrawEllipse
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:1379
cRect::cRect
cRect(const cSize &Size)
Definition: osd.h:361
cPixmap::drawPort
cRect drawPort
Definition: osd.h:463
cPoint::SetY
void SetY(int Y)
Definition: osd.h:321
cOsd::~cOsd
virtual ~cOsd()
Shuts down the OSD.
Definition: osd.c:1671
cOsdProvider::NewOsd
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:2017
cSize
Definition: osd.h:330
tColor
uint32_t tColor
Definition: font.h:29
cPixmapMemory::Clear
virtual void Clear(void)
Clears the pixmap's draw port by setting all pixels to be fully transparent.
Definition: osd.c:1162
cOsdProvider::images
static cImage * images[MAXOSDIMAGES]
Definition: osd.h:972
cOsd::savedPixmap
cPixmapMemory * savedPixmap
Definition: osd.h:735
cRect::cRect
cRect(const cPoint &Point, const cSize &Size)
Definition: osd.h:360
cBitmap::SetIndex
void SetIndex(int x, int y, tIndex Index)
Sets the index at the given coordinates to Index.
Definition: osd.c:500
cBitmap::SetSize
void SetSize(int Width, int Height)
Sets the size of this bitmap to the given values.
Definition: osd.c:294
cOsdProvider::SupportsTrueColor
static bool SupportsTrueColor(void)
Returns true if the current OSD provider is able to handle a true color OSD.
Definition: osd.c:2072
cPoint::Set
void Set(const cPoint &Point)
Definition: osd.h:323
cSetup::OSDLeft
int OSDLeft
Definition: config.h:323
cBitmap::dirtyX1
int dirtyX1
Definition: osd.h:174
cRect::SetHeight
void SetHeight(int Height)
Definition: osd.h:384
cSize::Width
int Width(void) const
Definition: osd.h:341
cPixmapMutexLock::cPixmapMutexLock
cPixmapMutexLock(void)
Definition: osd.h:678
cMutexLock::mutex
cMutex * mutex
Definition: thread.h:143
cPixmap::~cPixmap
virtual ~cPixmap()
Definition: osd.h:467
cRect::size
cSize size
Definition: osd.h:355
cPoint::cPoint
cPoint(const cPoint &Point)
Definition: osd.h:313
oeOk
@ oeOk
Definition: osd.h:44
tIndex
uint8_t tIndex
Definition: font.h:31
cSize::cSize
cSize(const cSize &Size)
Definition: osd.h:337
cPixmap::Clear
virtual void Clear(void)=0
Clears the pixmap's draw port by setting all pixels to be fully transparent.
cSetup::OSDWidth
int OSDWidth
Definition: config.h:323
clrGreen
@ clrGreen
Definition: osd.h:36
cPixmap::DrawText
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.
cRect::Size
const cSize & Size(void) const
Definition: osd.h:374
clrBlack
@ clrBlack
Definition: osd.h:34
cOsd::width
int width
Definition: osd.h:737
cPixmap::Copy
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.
cPoint::x
int x
Definition: osd.h:308
cBitmap::Fill
void Fill(tIndex Index)
Fills the bitmap data with the given Index.
Definition: osd.c:515
cPixmap::SetDrawPortPoint
virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty=true)
Sets the pixmap's draw port to the given Point.
Definition: osd.c:1085
cPixmap::SetLayer
virtual void SetLayer(int Layer)
Sets the layer of this pixmap to the given value.
Definition: osd.c:1024
cRect::cRect
cRect(void)
Definition: osd.h:358
cOsd::DrawPixel
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:1923
cTextScroller::CanScrollUp
bool CanScrollUp(void)
Definition: osd.h:1057
cTextScroller::left
int left
Definition: osd.h:1038
taRight
@ taRight
Definition: osd.h:160
cImage::Height
int Height(void) const
Definition: osd.h:436
cBitmap::DrawEllipse
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:632
tArea::x2
int x2
Definition: osd.h:299
cOsd::osdWidth
static int osdWidth
Definition: osd.h:727
cOsd::OsdTop
static int OsdTop(void)
Definition: osd.h:806
cPixmapMemory::Scroll
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:1585
cOsd
The cOsd class is the interface to the "On Screen Display".
Definition: osd.h:724
cPixmap::DrawImage
virtual void DrawImage(const cPoint &Point, const cImage &Image)=0
Draws the given Image into this pixmap at the given Point.
cRect::Left
int Left(void) const
Definition: osd.h:369
cSize::SetHeight
void SetHeight(int Height)
Definition: osd.h:344
cBitmap::Width
int Width(void) const
Definition: osd.h:188
cTextScroller::osd
cOsd * osd
Definition: osd.h:1037
cRect::operator==
bool operator==(const cRect &Rect) const
Definition: osd.h:363
cPixmap::DrawPixel
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.
cOsdProvider::oldAspect
static double oldAspect
Definition: osd.h:971
cPixmap::Alpha
int Alpha(void) const
Definition: osd.h:537
cOsd::maxPixmapSize
static cSize maxPixmapSize
Definition: osd.h:729
cRect::Width
int Width(void) const
Definition: osd.h:367
cRect::operator!=
bool operator!=(const cRect &Rect) const
Definition: osd.h:364
cPixmap::SetAlpha
virtual void SetAlpha(int Alpha)
Sets the alpha value of this pixmap to the given value.
Definition: osd.c:1046
cPixmapMemory::Pan
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:1619
cRect::SetTop
void SetTop(int Top)
Definition: osd.h:386
oeBppNotSupported
@ oeBppNotSupported
Definition: osd.h:47
cOsd::CreatePixmap
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:1716
cOsd::savedBitmap
cBitmap * savedBitmap
Definition: osd.h:732
cPixmap::DrawEllipse
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.
HsvToColor
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
cPixmap::SetClean
void SetClean(void)
Resets the "dirty" rectangles of this pixmap.
Definition: osd.c:1019
cBitmap::Scaled
cBitmap * Scaled(double FactorX, double FactorY, bool AntiAlias=false) const
Creates a copy of this bitmap, scaled by the given factors.
Definition: osd.c:838
cBitmap::DrawRectangle
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:611
cPoint::SetX
void SetX(int X)
Definition: osd.h:320
cRect::Shifted
cRect Shifted(const cPoint &Dp) const
Definition: osd.h:392
ALPHA_OPAQUE
#define ALPHA_OPAQUE
Definition: osd.h:26
cPixmap::SetViewPort
virtual void SetViewPort(const cRect &Rect)
Sets the pixmap's view port to the given Rect.
Definition: osd.c:1068
cTextScroller::height
int height
Definition: osd.h:1038
cRect::SetWidth
void SetWidth(int Width)
Definition: osd.h:383
ArgbToColor
tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
Definition: osd.h:58
taBottom
@ taBottom
Definition: osd.h:162
taBorder
@ taBorder
Definition: osd.h:163
cBitmap::DrawText
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:562
cRect::Right
int Right(void) const
Definition: osd.h:371
cTextScroller::CanScroll
bool CanScroll(void)
Definition: osd.h:1056
cFont
Definition: font.h:37
cPalette
Definition: osd.h:88
cOsdProvider::UpdateOsdSize
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:2037
cPixmapMemory::cPixmapMemory
cPixmapMemory(void)
Definition: osd.c:1144
cPixmapMemory::panning
bool panning
Definition: osd.h:689
cTextScroller::Width
int Width(void)
Definition: osd.h:1051
cOsd::SaveRegion
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:1866
cTextScroller::Offset
int Offset(void)
Definition: osd.h:1054
clrWhite
@ clrWhite
Definition: osd.h:41
cOsd::DestroyPixmap
virtual void DestroyPixmap(cPixmap *Pixmap)
Destroys the given Pixmap, which has previously been created by a call to CreatePixmap().
Definition: osd.c:1728
cMutexLock
Definition: thread.h:141
cRect::SetY
void SetY(int Y)
Definition: osd.h:382
MAXNUMCOLORS
#define MAXNUMCOLORS
Definition: osd.h:24
cBitmap::bitmap
tIndex * bitmap
Definition: osd.h:171
cPalette::Reset
void Reset(void)
Resets the palette, making it contain no colors.
Definition: osd.c:138
cOsd::bitmaps
cBitmap * bitmaps[MAXOSDAREAS]
Definition: osd.h:733
cOsdProvider::CreateOsd
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.
cImage
Definition: osd.h:419
tArea::bpp
int bpp
Definition: osd.h:300
Setup
cSetup Setup
Definition: config.c:372
cBitmap::dirtyX2
int dirtyX2
Definition: osd.h:174
cPalette::antiAliasGranularity
double antiAliasGranularity
Definition: osd.h:94
AlphaBlend
tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer=ALPHA_OPAQUE)
Definition: osd.c:81
RgbToColor
tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
Definition: osd.h:63
cTextScroller::Top
int Top(void)
Definition: osd.h:1050
cBitmap::x0
int x0
Definition: osd.h:172
cOsd::osdTop
static int osdTop
Definition: osd.h:727
cSize::Set
void Set(const cSize &Size)
Definition: osd.h:346
cSize::cSize
cSize(int Width, int Height)
Definition: osd.h:336
cOsd::DrawImage
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image on this OSD at the given Point.
Definition: osd.c:1911
cPixmapMemory::data
tColor * data
Definition: osd.h:688
cBitmap::LoadXpm
bool LoadXpm(const char *FileName)
Calls SetXpm() with the data from the file FileName.
Definition: osd.c:362
cPixmap::Scroll
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.
cVector< cOsd * >
RgbShade
tColor RgbShade(tColor Color, double Factor)
Returns a brighter (Factor > 0) or darker (Factor < 0) version of the given Color.
Definition: osd.c:43
clrGray50
@ clrGray50
Definition: osd.h:33
cBitmap::Intersects
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
cRect::Combine
void Combine(const cRect &Rect)
Combines this rectangle with the given Rect.
Definition: osd.c:934
cRect::SetSize
void SetSize(int Width, int Height)
Definition: osd.h:379
cOsd::DrawEllipse
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:1973
cTextScroller::shown
int shown
Definition: osd.h:1041
cOsdProvider::oldHeight
static int oldHeight
Definition: osd.h:970
oeTooManyAreas
@ oeTooManyAreas
Definition: osd.h:45
oeTooManyColors
@ oeTooManyColors
Definition: osd.h:46
taLeft
@ taLeft
Definition: osd.h:159
cPixmapMemory::Copy
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:1558
cMutex
Definition: thread.h:67
cPalette::SetBpp
void SetBpp(int Bpp)
Sets the color depth of this palette to the given value.
Definition: osd.c:165
cPixmap::Layer
int Layer(void) const
Definition: osd.h:536
oeWrongAreaSize
@ oeWrongAreaSize
Definition: osd.h:51
cPalette::Colors
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
cOsd::OsdHeight
static int OsdHeight(void)
Definition: osd.h:808
cBitmap::cBitmap
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
cOsdProvider::~cOsdProvider
virtual ~cOsdProvider()
Definition: osd.c:2012
cBitmap::Clean
void Clean(void)
Marks the dirty area as clean.
Definition: osd.c:354
cOsd::RestoreRegion
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition: osd.c:1882
cTextScroller::Scroll
void Scroll(bool Up, bool Page)
Definition: osd.c:2178
cPoint
Definition: osd.h:306
oeWrongAlignment
@ oeWrongAlignment
Definition: osd.h:49
cSize::operator==
bool operator==(const cSize &Size) const
Definition: osd.h:338
cRect::Point
const cPoint & Point(void) const
Definition: osd.h:373
cImage::data
tColor * data
Definition: osd.h:422
cOsd::DrawSlope
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:1983
cOsd::osdLeft
static int osdLeft
Definition: osd.h:727
cPalette::cPalette
cPalette(int Bpp=8)
Initializes the palette with the given color depth.
Definition: osd.c:117
cOsdProvider::Shutdown
static void Shutdown(void)
Shuts down the OSD provider facility by deleting the current OSD provider.
Definition: osd.c:2124
cTextScroller::Set
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:2148
cImage::~cImage
virtual ~cImage()
Definition: osd.c:1126
cBitmap
Definition: osd.h:169
tArea::x1
int x1
Definition: osd.h:299
cRect::Contains
bool Contains(const cPoint &Point) const
Returns true if this rectangle contains Point.
Definition: osd.c:898
cPixmapMemory::Fill
virtual void Fill(tColor Color)
Fills the pixmap's draw port with the given Color.
Definition: osd.c:1170
cPixmapMemory::DrawPixel
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:1262
cOsdProvider::StoreImage
static int StoreImage(const cImage &Image)
Stores the given Image for later use with DrawImage() on an OSD or pixmap.
Definition: osd.c:2111
cBitmap::Contains
bool Contains(int x, int y) const
Returns true if this bitmap contains the point (x, y).
Definition: osd.c:317
cPixmap::Unlock
static void Unlock(void)
Definition: osd.h:535
cSetup::OSDHeight
int OSDHeight
Definition: config.h:323
cPixmap::Tile
bool Tile(void) const
Definition: osd.h:538
cImage::Clear
void Clear(void)
Clears the image data by setting all pixels to be fully transparent.
Definition: osd.c:1131
taCenter
@ taCenter
Definition: osd.h:158
cRect::SetPoint
void SetPoint(int X, int Y)
Definition: osd.h:377
cRect::Set
void Set(int X, int Y, int Width, int Height)
Definition: osd.h:375
cOsd::MaxPixmapSize
virtual const cSize & MaxPixmapSize(void) const
Returns the maximum possible size of a pixmap this OSD can create.
Definition: osd.c:1711
tIndex
uint8_t tIndex
Definition: osd.h:56
cOsd::GetBitmap
cBitmap * GetBitmap(int Area)
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
Definition: osd.c:1706
cOsd::OsdLeft
static int OsdLeft(void)
Definition: osd.h:805
cPoint::operator==
bool operator==(const cPoint &Point) const
Definition: osd.h:314
cPoint::operator-
cPoint operator-(void) const
Definition: osd.h:316
oeOutOfMemory
@ oeOutOfMemory
Definition: osd.h:50
cRect::Grow
void Grow(int Dx, int Dy)
Grows the rectangle by the given number of pixels in either direction.
Definition: osd.c:892
clrBlue
@ clrBlue
Definition: osd.h:39
cTextScroller::font
const cFont * font
Definition: osd.h:1039
cBitmap::X0
int X0(void) const
Definition: osd.h:186
cOsd::RenderPixmaps
cPixmap * RenderPixmaps(void)
Renders the dirty part of all pixmaps into a resulting pixmap that shall be displayed on the OSD.
Definition: osd.c:1758
cPixmap::DrawPixmap
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty)
Draws the Dirty part of the given Pixmap into this pixmap.
Definition: osd.c:1179
cOsd::level
uint level
Definition: osd.h:738
cSize::operator<
bool operator<(const cSize &Size) const
Definition: osd.h:340
cTextScroller::Total
int Total(void)
Definition: osd.h:1053
font.h
cPixmapMemory::Render
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:1523
cOsd::Active
bool Active(void)
Definition: osd.h:761
cSize::Set
void Set(int Width, int Height)
Definition: osd.h:345
cPoint::operator!=
bool operator!=(const cPoint &Point) const
Definition: osd.h:315
cPoint::Set
void Set(int X, int Y)
Definition: osd.h:322
clrCyan
@ clrCyan
Definition: osd.h:40
tArea
Definition: osd.h:298
cImage::Data
const tColor * Data(void) const
Definition: osd.h:437
cRect::Intersected
cRect Intersected(const cRect &Rect) const
Returns the intersection of this rectangle and the given Rect.
Definition: osd.c:922
cRect::X
int X(void) const
Definition: osd.h:365
cPoint::X
int X(void) const
Definition: osd.h:318
cMutex::Unlock
void Unlock(void)
Definition: thread.c:228
cBitmap::y0
int y0
Definition: osd.h:172
clrTransparent
@ clrTransparent
Definition: osd.h:32
cOsd::height
int height
Definition: osd.h:737
cOsd::osdHeight
static int osdHeight
Definition: osd.h:727
cRect::Shifted
cRect Shifted(int Dx, int Dy) const
Definition: osd.h:391
cPixmapMemory::DrawText
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:1303
cPixmap::tile
bool tile
Definition: osd.h:461
cSize::operator!=
bool operator!=(const cSize &Size) const
Definition: osd.h:339
cPixmapMemory
Definition: osd.h:686
cMutexLock::Lock
bool Lock(cMutex *Mutex)
Definition: thread.c:400
cRect::Bottom
int Bottom(void) const
Definition: osd.h:372
cVector::Size
int Size(void) const
Definition: tools.h:717
cMutex::Lock
void Lock(void)
Definition: thread.c:222
cPixmapMemory::DrawImage
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image into this pixmap at the given Point.
Definition: osd.c:1230
cRect::SetBottom
void SetBottom(int Bottom)
Definition: osd.h:388
cPixmap
Definition: osd.h:454
cSize::height
int height
Definition: osd.h:333
cRect::SetLeft
void SetLeft(int Left)
Definition: osd.h:385
cOsd::isTrueColor
bool isTrueColor
Definition: osd.h:731
cPalette::SetColor
void SetColor(int Index, tColor Color)
Sets the palette entry at Index to Color.
Definition: osd.c:172
cOsd::Top
int Top(void)
Definition: osd.h:820
cOsd::cOsd
cOsd(int Left, int Top, uint Level)
Initializes the OSD with the given coordinates.
Definition: osd.c:1650
cPoint::cPoint
cPoint(void)
Definition: osd.h:311
cPalette::Take
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
cPoint::Shift
void Shift(int Dx, int Dy)
Definition: osd.h:324
cBitmap::DrawBitmap
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:533
clrMagenta
@ clrMagenta
Definition: osd.h:38
cRect::cRect
cRect(int X, int Y, int Width, int Height)
Definition: osd.h:359
cRect::SetRight
void SetRight(int Right)
Definition: osd.h:387
cBitmap::Covers
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
cPixmapMemory::Data
const uint8_t * Data(void)
Definition: osd.h:694
cTextScroller::colorFg
tColor colorFg
Definition: osd.h:1040
cRect::Top
int Top(void) const
Definition: osd.h:370
cPoint::y
int y
Definition: osd.h:309
cOsd::SetAntiAliasGranularity
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
Definition: osd.c:1698
clrYellow
@ clrYellow
Definition: osd.h:37
cOsd::active
bool active
Definition: osd.h:739
cOsd::Left
int Left(void)
Definition: osd.h:819
cOsd::DrawRectangle
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:1963
cImage::Size
const cSize & Size(void) const
Definition: osd.h:434
cImage::Fill
void Fill(tColor Color)
Fills the image data with the given Color.
Definition: osd.c:1136
cOsd::numBitmaps
int numBitmaps
Definition: osd.h:734
cOsdProvider::OsdSizeChanged
static bool OsdSizeChanged(int &State)
Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.
Definition: osd.c:2064
cPalette::ClosestColor
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
cPalette::maxColors
int maxColors
Definition: osd.h:92
cRect::Set
void Set(cPoint Point, cSize Size)
Definition: osd.h:376
cBitmap::width
int width
Definition: osd.h:173
cTextScroller::cTextScroller
cTextScroller(void)
Definition: osd.c:2132
cRect::Null
static const cRect Null
Definition: osd.h:357
cTextScroller::DrawText
void DrawText(void)
Definition: osd.c:2170
cPixmap::MarkDrawPortDirty
void MarkDrawPortDirty(const cRect &Rect)
Marks the given rectangle of the draw port of this pixmap as dirty.
Definition: osd.c:999
tArea::Intersects
bool Intersects(const tArea &Area) const
Definition: osd.h:303
cBitmap::dirtyY2
int dirtyY2
Definition: osd.h:174
cBitmap::SetXpm
bool SetXpm(const char *const Xpm[], bool IgnoreNone=false)
Sets this bitmap to the given XPM data.
Definition: osd.c:428
cBitmap::Y0
int Y0(void) const
Definition: osd.h:187
cPalette::Blend
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
cOsd::SetAreas
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition: osd.c:1831
cPixmapMemory::DrawRectangle
virtual void DrawRectangle(const cRect &Rect, tColor Color)
Draws a filled rectangle with the given Color.
Definition: osd.c:1352
cRect::point
cPoint point
Definition: osd.h:354
cPixmapMemory::~cPixmapMemory
virtual ~cPixmapMemory()
Definition: osd.c:1157
cRect::SetSize
void SetSize(const cSize &Size)
Definition: osd.h:380
cOsdProvider::StoreImageData
virtual int StoreImageData(const cImage &Image)
Copies the given Image and returns a handle for later reference.
Definition: osd.c:2082
cTextScroller::Height
int Height(void)
Definition: osd.h:1052
cOsdProvider::DropImageData
virtual void DropImageData(int ImageHandle)
Drops the image data referenced by ImageHandle.
Definition: osd.c:2094
cSetup::OSDTop
int OSDTop
Definition: config.h:323
cOsd::left
int left
Definition: osd.h:737
cBitmap::ReduceBpp
void ReduceBpp(const cPalette &Palette)
Reduces the color depth of the bitmap to that of the given Palette.
Definition: osd.c:765
cOsdProvider::cOsdProvider
cOsdProvider(void)
Definition: osd.c:2006
cTextScroller::Shown
int Shown(void)
Definition: osd.h:1055
cBitmap::Dirty
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
cOsdProvider
Definition: osd.h:965
taTop
@ taTop
Definition: osd.h:161
cImage::Width
int Width(void) const
Definition: osd.h:435
cImage::cImage
cImage(void)
Definition: osd.c:1104
cRect::Shift
void Shift(int Dx, int Dy)
Definition: osd.h:389
MAXOSDAREAS
#define MAXOSDAREAS
Definition: osd.h:711
cPixmapMutexLock
Definition: osd.h:676
MAXOSDIMAGES
#define MAXOSDIMAGES
Definition: osd.h:963
eTextAlignment
eTextAlignment
Definition: osd.h:158
cPixmapMemory::DrawSlope
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)
Draws a "slope" with the given Color into the given rectangle.
Definition: osd.c:1481
cPixmap::Fill
virtual void Fill(tColor Color)=0
Fills the pixmap's draw port with the given Color.
cTextScroller::offset
int offset
Definition: osd.h:1041
cPalette::~cPalette
virtual ~cPalette()
Definition: osd.c:123
cTextScroller::colorBg
tColor colorBg
Definition: osd.h:1040
cTextWrapper
Definition: font.h:104
OSD_LEVEL_DEFAULT
#define OSD_LEVEL_DEFAULT
Definition: osd.h:21
cOsd::DrawScaledBitmap
virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias=false)
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
Definition: osd.c:1943
tArea::Height
int Height(void) const
Definition: osd.h:302
cPalette::color
tColor color[MAXNUMCOLORS]
Definition: osd.h:90
cOsd::Height
int Height(void)
Definition: osd.h:822
cSize::Height
int Height(void) const
Definition: osd.h:342
cOsd::DrawBitmap
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:1933
cOsdProvider::osdState
static int osdState
Definition: osd.h:973
cBitmap::Height
int Height(void) const
Definition: osd.h:189
cOsd::SetOsdPosition
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:1690
config.h
cPixmap::alpha
int alpha
Definition: osd.h:460
cPixmapMemory::DrawBitmap
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:1276
cPixmap::DrawSlope
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)=0
Draws a "slope" with the given Color into the given rectangle.
cOsd::pixmaps
cVector< cPixmap * > pixmaps
Definition: osd.h:736
cPixmap::Pan
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...
cOsd::CanHandleAreas
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition: osd.c:1809
cTextScroller::textWrapper
cTextWrapper textWrapper
Definition: osd.h:1042
cOsd::DrawText
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:1953
cOsd::SetPalette
virtual eOsdError SetPalette(const cPalette &Palette, int Area)
Sets the Palette for the given Area (the first area is numbered 0).
Definition: osd.c:1900
cPalette::tIndexes
tIndex tIndexes[MAXNUMCOLORS]
Definition: osd.h:96
cPixmap::layer
int layer
Definition: osd.h:459
cTextScroller::Reset
void Reset(void)
Definition: osd.c:2165
tArea::y1
int y1
Definition: osd.h:299
cPixmap::Render
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.
tArea::Width
int Width(void) const
Definition: osd.h:301
clrRed
@ clrRed
Definition: osd.h:35
cOsdProvider::osdProvider
static cOsdProvider * osdProvider
Definition: osd.h:968
taDefault
@ taDefault
Definition: osd.h:164
tools.h
cPixmap::dirtyDrawPort
cRect dirtyDrawPort
Definition: osd.h:465
cPixmap::dirtyViewPort
cRect dirtyViewPort
Definition: osd.h:464
cSize::Contains
bool Contains(const cPoint &Point) const
Definition: osd.h:347
cTextScroller::Left
int Left(void)
Definition: osd.h:1049
cPixmap::DrawBitmap
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 ...
cPalette::Index
int Index(tColor Color)
Returns the index of the given Color (the first color has index 0).
Definition: osd.c:144
cPoint::operator-
cPoint operator-(const cPoint &Point) const
Definition: osd.h:317
cOsd::mutex
static cMutex mutex
Definition: osd.h:730
cRect::SetX
void SetX(int X)
Definition: osd.h:381
cRect::Intersects
bool Intersects(const cRect &Rect) const
Returns true if this rectangle intersects with Rect.
Definition: osd.c:914
oeUnknown
@ oeUnknown
Definition: osd.h:52
cPalette::Replace
void Replace(const cPalette &Palette)
Replaces the colors of this palette with the colors from the given palette.
Definition: osd.c:208
cSize::width
int width
Definition: osd.h:332
cPixmap::SetTile
virtual void SetTile(bool Tile)
Sets the tile property of this pixmap to the given value.
Definition: osd.c:1057
cOsd::Flush
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition: osd.c:1993
cOsd::Width
int Width(void)
Definition: osd.h:821
cTextScroller::width
int width
Definition: osd.h:1038
cOsd::AddPixmap
cPixmap * AddPixmap(cPixmap *Pixmap)
Adds the given Pixmap to the list of currently active pixmaps in this OSD.
Definition: osd.c:1745
oeAreasOverlap
@ oeAreasOverlap
Definition: osd.h:48
thread.h
tColor
uint32_t tColor
Definition: osd.h:55
cSize::Grown
cSize Grown(int Dw, int Dh) const
Definition: osd.h:349
cPixmap::DrawRectangle
virtual void DrawRectangle(const cRect &Rect, tColor Color)=0
Draws a filled rectangle with the given Color.
cPoint::Shift
void Shift(const cPoint &Dp)
Definition: osd.h:325
cBitmap::height
int height
Definition: osd.h:173
eOsdError
eOsdError
Definition: osd.h:44
Font
static const cCursesFont Font
Definition: skincurses.c:32
cRect::SetPoint
void SetPoint(const cPoint &Point)
Definition: osd.h:378
cPoint::Shifted
cPoint Shifted(const cPoint &Dp) const
Definition: osd.h:327
cSize::cSize
cSize(void)
Definition: osd.h:335
cTextScroller::CanScrollDown
bool CanScrollDown(void)
Definition: osd.h:1058
cPalette::numColors
int numColors
Definition: osd.h:92
cPoint::Y
int Y(void) const
Definition: osd.h:319
cPalette::modified
bool modified
Definition: osd.h:93
cOsd::top
int top
Definition: osd.h:737
cPixmap::cPixmap
cPixmap(void)
Definition: osd.c:962
cRect::Y
int Y(void) const
Definition: osd.h:366
tArea::y2
int y2
Definition: osd.h:299
cRect
Definition: osd.h:352
cRect::cRect
cRect(const cRect &Rect)
Definition: osd.h:362
cBitmap::ShrinkBpp
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:796
cOsdProvider::oldWidth
static int oldWidth
Definition: osd.h:969
cSize::SetWidth
void SetWidth(int Width)
Definition: osd.h:343
cPoint::cPoint
cPoint(int X, int Y)
Definition: osd.h:312
cOsdProvider::GetImageData
static const cImage * GetImageData(int ImageHandle)
Gets the image data referenced by ImageHandle.
Definition: osd.c:2103
cTextScroller
Definition: osd.h:1035
cPalette::SetAntiAliasGranularity
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
cOsdProvider::DropImage
static void DropImage(int ImageHandle)
Drops the image referenced by the given ImageHandle.
Definition: osd.c:2118
cPixmap::MarkViewPortDirty
void MarkViewPortDirty(const cRect &Rect)
Marks the given rectangle of the view port of this pixmap as dirty.
Definition: osd.c:987
cBitmap::DrawPixel
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:526