vdr 2.8.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 5.4 2026/03/12 10:44:34 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
30enum {
31 //AARRGGBB
32 clrTransparent = 0x00000000, // not drawn if used as background color in DrawText()
33 clrTranslucent = 0x00000001, // always drawn, even as background color in DrawText()
34 clrGray50 = 0x7F000000, // 50% gray
35 clrBlack = 0xFF000000,
36 clrRed = 0xFFFC1414,
37 clrGreen = 0xFF24FC24,
38 clrYellow = 0xFFFCC024,
39 clrMagenta = 0xFFB000FC,
40 clrBlue = 0xFF0000FC,
41 clrCyan = 0xFF00FCFC,
42 clrWhite = 0xFFFCFCFC,
43 };
44
55
56typedef uint32_t tColor; // see also font.h
57typedef uint8_t tIndex;
58
59inline tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
60{
61 return (tColor(A) << 24) | (tColor(R) << 16) | (tColor(G) << 8) | B;
62}
63
64inline tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
65{
66 return (tColor(R) << 16) | (tColor(G) << 8) | B;
67}
68
69inline tColor RgbToColor(double R, double G, double B)
70{
71 return RgbToColor(uint8_t(0xFF * R), uint8_t(0xFF * G), uint8_t(0xFF * B));
72}
73
74tColor RgbShade(tColor Color, double Factor);
81
82tColor HsvToColor(double H, double S, double V);
86
87tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer = ALPHA_OPAQUE);
88
89class cPalette {
90private:
92 int bpp;
96protected:
98public:
99 cPalette(int Bpp = 8);
101 virtual ~cPalette();
102 void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
112 int Bpp(void) const { return bpp; }
113 void Reset(void);
115 int Index(tColor Color);
120 tColor Color(int Index) const { return Index < maxColors ? color[Index] : 0; }
123 void SetBpp(int Bpp);
126 void SetColor(int Index, tColor Color);
130 const tColor *Colors(int &NumColors) const;
135 void Take(const cPalette &Palette, tIndexes *Indexes = NULL, tColor ColorFg = 0, tColor ColorBg = 0);
142 void Replace(const cPalette &Palette);
145 tColor Blend(tColor ColorFg, tColor ColorBg, uint8_t Level) const;
151 int ClosestColor(tColor Color, int MaxDiff = INT_MAX) const;
157 };
158
160 taLeft = 0x01,
161 taRight = 0x02,
162 taTop = 0x04,
163 taBottom = 0x08,
164 taBorder = 0x10, // keeps some distance from the left or right alignment edge
166 };
167
168class cFont;
169
170class cBitmap : public cPalette {
171private:
173 int x0, y0;
176public:
177 cBitmap(int Width, int Height, int Bpp, int X0 = 0, int Y0 = 0);
182 cBitmap(const char *FileName);
184 cBitmap(const char *const Xpm[]);
186 virtual ~cBitmap() override;
187 int X0(void) const { return x0; }
188 int Y0(void) const { return y0; }
189 int Width(void) const { return width; }
190 int Height(void) const { return height; }
191 void SetSize(int Width, int Height);
196 void SetOffset(int X0, int Y0) { x0 = X0; y0 = Y0; }
198 bool Contains(int x, int y) const;
200 bool Covers(int x1, int y1, int x2, int y2) const;
203 bool Intersects(int x1, int y1, int x2, int y2) const;
206 bool Dirty(int &x1, int &y1, int &x2, int &y2);
209 void Clean(void);
211 bool LoadXpm(const char *FileName);
214 bool SetXpm(const char *const Xpm[], bool IgnoreNone = false);
224 void SetIndex(int x, int y, tIndex Index);
227 void Fill(tIndex Index);
229 void DrawPixel(int x, int y, tColor Color);
233 void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
243 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);
250 void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
255 void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
265 void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
277 const tIndex *Data(int x, int y) const;
279 tColor GetColor(int x, int y) const { return Color(*Data(x, y)); }
281 void ReduceBpp(const cPalette &Palette);
287 void ShrinkBpp(int NewBpp);
292 cBitmap *Scaled(double FactorX, double FactorY, bool AntiAlias = false) const;
298 };
299
300struct tArea {
301 int x1, y1, x2, y2;
302 int bpp;
303 int Width(void) const { return x2 - x1 + 1; }
304 int Height(void) const { return y2 - y1 + 1; }
305 bool Intersects(const tArea &Area) const { return !(x2 < Area.x1 || x1 > Area.x2 || y2 < Area.y1 || y1 > Area.y2); }
306 };
307
308class cPoint {
309private:
310 int x;
311 int y;
312public:
313 cPoint(void) { x = y = 0; }
314 cPoint(int X, int Y) { x = X; y = Y; }
315 cPoint(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
316 bool operator==(const cPoint &Point) const { return x == Point.X() && y == Point.Y(); }
317 bool operator!=(const cPoint &Point) const { return !(*this == Point); }
318 cPoint operator-(void) const { return cPoint(-x, -y); }
319 cPoint operator-(const cPoint &Point) const { return cPoint(x - Point.X(), y - Point.Y()); }
320 int X(void) const { return x; }
321 int Y(void) const { return y; }
322 void SetX(int X) { x = X; }
323 void SetY(int Y) { y = Y; }
324 void Set(int X, int Y) { x = X; y = Y; }
325 void Set(const cPoint &Point) { x = Point.X(); y = Point.Y(); }
326 void Shift(int Dx, int Dy) { x += Dx; y += Dy; }
327 void Shift(const cPoint &Dp) { x += Dp.X(); y += Dp.Y(); }
328 cPoint Shifted(int Dx, int Dy) const { cPoint p(*this); p.Shift(Dx, Dy); return p; }
329 cPoint Shifted(const cPoint &Dp) const { cPoint p(*this); p.Shift(Dp); return p; }
330 };
331
332class cSize {
333private:
334 int width;
336public:
337 cSize(void) { width = height = 0; }
339 cSize(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
340 bool operator==(const cSize &Size) const { return width == Size.Width() && height == Size.Height(); }
341 bool operator!=(const cSize &Size) const { return !(*this == Size); }
342 bool operator<(const cSize &Size) const { return width < Size.Width() && height < Size.Height(); }
343 int Width(void) const { return width; }
344 int Height(void) const { return height; }
345 void SetWidth(int Width) { width = Width; }
346 void SetHeight(int Height) { height = Height; }
347 void Set(int Width, int Height) { width = Width; height = Height; }
348 void Set(const cSize &Size) { width = Size.Width(); height = Size.Height(); }
349 bool Contains(const cPoint &Point) const { return 0 <= Point.X() && 0 <= Point.Y() && Point.X() < width && Point.Y() < height; }
350 void Grow(int Dw, int Dh) { width += 2 * Dw; height += 2 * Dh; }
351 cSize Grown(int Dw, int Dh) const { cSize s(*this); s.Grow(Dw, Dh); return s; }
352 };
353
354class cRect {
355private:
358public:
359 static const cRect Null;
360 cRect(void): point(0, 0), size(0, 0) {}
361 cRect(int X, int Y, int Width, int Height): point(X, Y), size(Width, Height) {}
362 cRect(const cPoint &Point, const cSize &Size): point(Point), size(Size) {}
363 cRect(const cSize &Size): point(0, 0), size(Size) {}
364 cRect(const cRect &Rect): point(Rect.Point()), size(Rect.Size()) {}
365 bool operator==(const cRect &Rect) const { return point == Rect.Point() && size == Rect.Size(); }
366 bool operator!=(const cRect &Rect) const { return !(*this == Rect); }
367 int X(void) const { return point.X(); }
368 int Y(void) const { return point.Y(); }
369 int Width(void) const { return size.Width(); }
370 int Height(void) const { return size.Height(); }
371 int Left(void) const { return X(); }
372 int Top(void) const { return Y(); }
373 int Right(void) const { return X() + Width() - 1; }
374 int Bottom(void) const { return Y() + Height() - 1; }
375 const cPoint &Point(void) const { return point; }
376 const cSize &Size(void) const { return size; }
377 void Set(int X, int Y, int Width, int Height) { point.Set(X, Y); size.Set(Width, Height); }
378 void Set(cPoint Point, cSize Size) { point.Set(Point); size.Set(Size); }
379 void SetPoint(int X, int Y) { point.Set(X, Y); }
380 void SetPoint(const cPoint &Point) { point.Set(Point); }
381 void SetSize(int Width, int Height) { size.Set(Width, Height); }
382 void SetSize(const cSize &Size) { size.Set(Size); }
383 void SetX(int X) { point.SetX(X); }
384 void SetY(int Y) { point.SetY(Y); }
385 void SetWidth(int Width) { size.SetWidth(Width); }
386 void SetHeight(int Height) { size.SetHeight(Height); }
387 void SetLeft(int Left) { SetWidth(Width() + X() - Left); SetX(Left); }
388 void SetTop(int Top) { SetHeight(Height() + Y() - Top); SetY(Top); }
389 void SetRight(int Right) { SetWidth(Right - X() + 1); }
390 void SetBottom(int Bottom) { SetHeight(Bottom - Y() + 1); }
391 void Shift(int Dx, int Dy) { point.Shift(Dx, Dy); }
392 void Shift(const cPoint &Dp) { point.Shift(Dp); }
393 cRect Shifted(int Dx, int Dy) const { cRect r(*this); r.Shift(Dx, Dy); return r; }
394 cRect Shifted(const cPoint &Dp) const { cRect r(*this); r.Shift(Dp); return r; }
395 void Grow(int Dx, int Dy);
398 cRect Grown(int Dw, int Dh) const { cRect r(*this); r.Grow(Dw, Dh); return r; }
399 bool Contains(const cPoint &Point) const;
401 bool Contains(const cRect &Rect) const;
403 bool Intersects(const cRect &Rect) const;
405 cRect Intersected(const cRect &Rect) const;
407 void Combine(const cRect &Rect);
409 cRect Combined(const cRect &Rect) const { cRect r(*this); r.Combine(Rect); return r; }
412 void Combine(const cPoint &Point);
414 cRect Combined(const cPoint &Point) const { cRect r(*this); r.Combine(Point); return r; }
417 bool IsEmpty(void) const { return Width() <= 0 || Height() <= 0; }
419 };
420
421class cImage {
422private:
425public:
426 cImage(void);
427 cImage(const cImage &Image);
428 cImage(const cSize &Size, const tColor *Data = NULL);
435 virtual ~cImage();
436 const cSize &Size(void) const { return size; }
437 int Width(void) const { return size.Width(); }
438 int Height(void) const { return size.Height(); }
439 const tColor *Data(void) const { return data; }
440 tColor GetPixel(const cPoint &Point) const { return data[size.Width() * Point.Y() + Point.X()]; }
444 void SetPixel(const cPoint &Point, tColor Color) { data[size.Width() * Point.Y() + Point.X()] = Color; }
448 void Clear(void);
450 void Fill(tColor Color);
452 cImage *Scaled(double FactorX, double FactorY, bool AntiAlias = false) const;
457 };
458
459#define MAXPIXMAPLAYERS 8
460
461class cPixmap {
462 friend class cOsd;
463 friend class cPixmapMutexLock;
464private:
465 static cMutex mutex;
466 int layer;
467 int alpha;
468 bool tile;
473protected:
474 virtual ~cPixmap() {}
475 void MarkViewPortDirty(const cRect &Rect);
479 void MarkViewPortDirty(const cPoint &Point);
483 void MarkDrawPortDirty(const cRect &Rect);
489 void MarkDrawPortDirty(const cPoint &Point);
495 void SetClean(void);
497 virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty);
502public:
503 cPixmap(void);
504 cPixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
536 static void Lock(void) { mutex.Lock(); }
542 static void Unlock(void) { mutex.Unlock(); }
543 int Layer(void) const { return layer; }
544 int Alpha(void) const { return alpha; }
545 bool Tile(void) const { return tile; }
546 const cRect &ViewPort(void) const { return viewPort; }
550 const cRect &DrawPort(void) const { return drawPort; }
554 const cRect &DirtyViewPort(void) const { return dirtyViewPort; }
561 const cRect &DirtyDrawPort(void) const { return dirtyDrawPort; }
568 virtual void SetLayer(int Layer);
575 virtual void SetAlpha(int Alpha);
580 virtual void SetTile(bool Tile);
586 virtual void SetViewPort(const cRect &Rect);
590 virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty = true);
599 virtual void Clear(void) = 0;
602 virtual void Fill(tColor Color) = 0;
605 virtual void DrawImage(const cPoint &Point, const cImage &Image) = 0;
607 virtual void DrawImage(const cPoint &Point, int ImageHandle) = 0;
612 virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias = false) {};
619 virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias = false) {};
629 virtual void DrawPixel(const cPoint &Point, tColor Color) = 0;
634 virtual void DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer = ALPHA_OPAQUE) { DrawPixel(Point, Color); }
638 virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false) = 0;
649 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;
656 virtual void DrawRectangle(const cRect &Rect, tColor Color) = 0;
658 virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0) = 0;
667 virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) = 0;
678 virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
682 virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
687 virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
691 virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
703 };
704
706public:
708 };
709
710#define LOCK_PIXMAPS cPixmapMutexLock PixmapMutexLock
711
712// cPixmapMemory is an implementation of cPixmap that uses an array of tColor
713// values to store the pixmap.
714
715class cPixmapMemory : public cPixmap {
716private:
719public:
720 cPixmapMemory(void);
722 virtual ~cPixmapMemory() override;
723 const uint8_t *Data(void) { return (uint8_t *)data; }
724 virtual void Clear(void) override;
725 virtual void Fill(tColor Color) override;
726 virtual void DrawImage(const cPoint &Point, const cImage &Image) override;
727 virtual void DrawImage(const cPoint &Point, int ImageHandle) override;
728 virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias = false) override;
729 virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias = false) override;
730 virtual void DrawPixel(const cPoint &Point, tColor Color) override;
731 virtual void DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer = ALPHA_OPAQUE) override;
732 virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false) override;
733 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) override;
734 virtual void DrawRectangle(const cRect &Rect, tColor Color) override;
735 virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0) override;
736 virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) override;
737 virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) override;
738 virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) override;
739 virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null) override;
740 virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null) override;
741 };
742
743#define MAXOSDAREAS 16
744
755
756class cOsd {
757 friend class cOsdProvider;
758private:
762 static cMutex mutex;
770 uint level;
771 bool active;
772protected:
773 cOsd(int Left, int Top, uint Level);
793 bool Active(void) { return active; }
794 virtual void SetActive(bool On) { active = On; }
797 cPixmap *AddPixmap(cPixmap *Pixmap);
803 cPixmap *RenderPixmaps(void);
820 cBitmap *GetBitmap(int Area);
828public:
829 virtual ~cOsd();
831 static int OsdLeft(void) { return osdLeft ? osdLeft : Setup.OSDLeft; }
832 static int OsdTop(void) { return osdTop ? osdTop : Setup.OSDTop; }
833 static int OsdWidth(void) { return osdWidth ? osdWidth : Setup.OSDWidth; }
834 static int OsdHeight(void) { return osdHeight ? osdHeight : Setup.OSDHeight; }
835 static void SetOsdPosition(int Left, int Top, int Width, int Height);
840 static int IsOpen(void) { return Osds.Size() && Osds[0]->level == OSD_LEVEL_DEFAULT; }
842 bool IsTrueColor(void) const { return isTrueColor; }
845 int Left(void) { return left; }
846 int Top(void) { return top; }
847 int Width(void) { return width; }
848 int Height(void) { return height; }
849 void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
860 virtual const cSize &MaxPixmapSize(void) const;
866 virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
873 virtual void DestroyPixmap(cPixmap *Pixmap);
878 virtual void DrawImage(const cPoint &Point, const cImage &Image);
881 virtual void DrawImage(const cPoint &Point, int ImageHandle);
887 virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias = false);
892 virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias = false);
900 virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
908 virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
920 virtual void SaveRegion(int x1, int y1, int x2, int y2);
924 virtual void RestoreRegion(void);
927 virtual eOsdError SetPalette(const cPalette &Palette, int Area);
930 virtual void DrawPixel(int x, int y, tColor Color);
936 virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
947 virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias = false);
952 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);
959 virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
962 virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
972 virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
984 virtual void Flush(void);
1001 };
1002
1003#define MAXOSDIMAGES 64
1004
1006 friend class cPixmapMemory;
1007private:
1009 static int oldWidth;
1010 static int oldHeight;
1011 static double oldAspect;
1012 static cImage *images[MAXOSDIMAGES];
1013 static int osdState;
1014protected:
1015 virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0;
1018 virtual bool ProvidesTrueColor(void) { return false; }
1020 virtual int StoreImageData(const cImage &Image);
1031 virtual void DropImageData(int ImageHandle);
1033 static const cImage *GetImageData(int ImageHandle);
1035public:
1036 cOsdProvider(void);
1037 //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.)
1038 virtual ~cOsdProvider();
1039 static cOsd *NewOsd(int Left, int Top, uint Level = OSD_LEVEL_DEFAULT);
1045 static void UpdateOsdSize(bool Force = false);
1050 static bool OsdSizeChanged(int &State);
1056 static bool SupportsTrueColor(void);
1058 static int StoreImage(const cImage &Image);
1068 static void DropImage(int ImageHandle);
1071 static void Shutdown(void);
1073 };
1074
1076private:
1079 const cFont *font;
1083 void DrawText(void);
1084public:
1085 cTextScroller(void);
1086 cTextScroller(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1087 void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1088 void Reset(void);
1089 int Left(void) { return left; }
1090 int Top(void) { return top; }
1091 int Width(void) { return width; }
1092 int Height(void) { return height; }
1093 int Total(void) { return textWrapper.Lines(); }
1094 int Offset(void) { return offset; }
1095 int Shown(void) { return shown; }
1096 bool CanScroll(void) { return CanScrollUp() || CanScrollDown(); }
1097 bool CanScrollUp(void) { return offset > 0; }
1098 bool CanScrollDown(void) { return offset + shown < Total(); }
1099 void Scroll(bool Up, bool Page);
1100 };
1101
1102#endif //__OSD_H
Definition osd.h:170
int y0
Definition osd.h:173
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
void SetOffset(int X0, int Y0)
Sets the offset of this bitmap to the given values.
Definition osd.h:196
int dirtyY2
Definition osd.h:175
int width
Definition osd.h:174
void ReduceBpp(const cPalette &Palette)
Reduces the color depth of the bitmap to that of the given Palette.
Definition osd.c:765
int Height(void) const
Definition osd.h:190
int height
Definition osd.h:174
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
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
int X0(void) const
Definition osd.h:187
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
tColor GetColor(int x, int y) const
Returns the color at the given coordinates.
Definition osd.h:279
bool Contains(int x, int y) const
Returns true if this bitmap contains the point (x, y).
Definition osd.c:317
void SetIndex(int x, int y, tIndex Index)
Sets the index at the given coordinates to Index.
Definition osd.c:500
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
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
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 Clean(void)
Marks the dirty area as clean.
Definition osd.c:354
int dirtyX1
Definition osd.h:175
tIndex * bitmap
Definition osd.h:172
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
void SetSize(int Width, int Height)
Sets the size of this bitmap to the given values.
Definition osd.c:294
void Fill(tIndex Index)
Fills the bitmap data with the given Index.
Definition osd.c:515
int dirtyX2
Definition osd.h:175
int dirtyY1
Definition osd.h:175
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
bool SetXpm(const char *const Xpm[], bool IgnoreNone=false)
Sets this bitmap to the given XPM data.
Definition osd.c:428
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
bool LoadXpm(const char *FileName)
Calls SetXpm() with the data from the file FileName.
Definition osd.c: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
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 ~cBitmap() override
Definition osd.c:289
int Y0(void) const
Definition osd.h:188
int x0
Definition osd.h:173
int Width(void) const
Definition osd.h:189
const tIndex * Data(int x, int y) const
Returns the address of the index byte at the given coordinates.
Definition osd.c:760
Definition font.h:37
Definition osd.h:421
int Height(void) const
Definition osd.h:438
const tColor * Data(void) const
Definition osd.h:439
int Width(void) const
Definition osd.h:437
cImage(void)
Definition osd.c:1104
tColor * data
Definition osd.h:424
void SetPixel(const cPoint &Point, tColor Color)
Sets the pixel at the given Point to Color.
Definition osd.h:444
const cSize & Size(void) const
Definition osd.h:436
virtual ~cImage()
Definition osd.c:1126
cSize size
Definition osd.h:423
cImage * Scaled(double FactorX, double FactorY, bool AntiAlias=false) const
Creates a copy of this image, scaled by the given factors.
Definition osd.c:1142
tColor GetPixel(const cPoint &Point) const
Returns the pixel value at the given Point.
Definition osd.h:440
void Clear(void)
Clears the image data by setting all pixels to be fully transparent.
Definition osd.c:1131
void Fill(tColor Color)
Fills the image data with the given Color.
Definition osd.c:1136
cMutexLock(cMutex *Mutex=NULL)
Definition thread.c:389
cMutex * mutex
Definition thread.h:143
static int oldHeight
Definition osd.h:1010
static int oldWidth
Definition osd.h:1009
virtual bool ProvidesTrueColor(void)
Returns true if this OSD provider is able to handle a true color OSD.
Definition osd.h:1018
static cImage * images[MAXOSDIMAGES]
Definition osd.h:2276
static double oldAspect
Definition osd.h:1011
static bool OsdSizeChanged(int &State)
Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.
Definition osd.c:2337
static void DropImage(int ImageHandle)
Drops the image referenced by the given ImageHandle.
Definition osd.c:2391
virtual ~cOsdProvider()
Definition osd.c:2285
virtual int StoreImageData(const cImage &Image)
Copies the given Image and returns a handle for later reference.
Definition osd.c:2355
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 DropImageData(int ImageHandle)
Drops the image data referenced by ImageHandle.
Definition osd.c:2367
static cOsdProvider * osdProvider
Definition osd.h:1008
static int osdState
Definition osd.h:1013
static int StoreImage(const cImage &Image)
Stores the given Image for later use with DrawImage() on an OSD or pixmap.
Definition osd.c:2384
cOsdProvider(void)
Definition osd.c:2279
friend class cPixmapMemory
Definition osd.h:1006
static void Shutdown(void)
Shuts down the OSD provider facility by deleting the current OSD provider.
Definition osd.c:2397
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:2310
static const cImage * GetImageData(int ImageHandle)
Gets the image data referenced by ImageHandle.
Definition osd.c:2376
static bool SupportsTrueColor(void)
Returns true if the current OSD provider is able to handle a true color OSD.
Definition osd.c:2345
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:2290
The cOsd class is the interface to the "On Screen Display".
Definition osd.h:756
int numBitmaps
Definition osd.h:766
cOsd(int Left, int Top, uint Level)
Initializes the OSD with the given coordinates.
Definition osd.c:1911
virtual eOsdError SetPalette(const cPalette &Palette, int Area)
Sets the Palette for the given Area (the first area is numbered 0).
Definition osd.c:2161
uint level
Definition osd.h:770
bool IsTrueColor(void) const
Returns 'true' if this is a true color OSD (providing full 32 bit color depth).
Definition osd.h:842
virtual const cSize & MaxPixmapSize(void) const
Returns the maximum possible size of a pixmap this OSD can create.
Definition osd.c:1972
int top
Definition osd.h:769
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image on this OSD at the given Point.
Definition osd.c:2172
static int osdHeight
Definition osd.h:759
virtual void SetActive(bool On)
Sets this OSD to be the active one.
Definition osd.h:794
int Width(void)
Definition osd.h:847
static int OsdHeight(void)
Definition osd.h:834
bool isTrueColor
Definition osd.h:763
cVector< cPixmap * > pixmaps
Definition osd.h:768
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition osd.c:2092
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:2206
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:2246
cBitmap * GetBitmap(int Area)
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
Definition osd.c:1967
virtual void DestroyPixmap(cPixmap *Pixmap)
Destroys the given Pixmap, which has previously been created by a call to CreatePixmap().
Definition osd.c:1989
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
Definition osd.c:1959
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:2196
bool active
Definition osd.h:771
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition osd.c:2070
static int osdWidth
Definition osd.h:759
cPixmap * AddPixmap(cPixmap *Pixmap)
Adds the given Pixmap to the list of currently active pixmaps in this OSD.
Definition osd.c:2006
cPixmap * RenderPixmaps(void)
Renders the dirty part of all pixmaps into a resulting pixmap that shall be displayed on the OSD.
Definition osd.c:2019
static int OsdTop(void)
Definition osd.h:832
static int osdLeft
Definition osd.h:759
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:1977
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:1951
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:2127
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:2216
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition osd.c:2266
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:2236
int Left(void)
Definition osd.h:845
static int OsdLeft(void)
Definition osd.h:831
cBitmap * bitmaps[MAXOSDAREAS]
Definition osd.h:765
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:2256
static cMutex mutex
Definition osd.h:762
int left
Definition osd.h:769
cPixmapMemory * savedPixmap
Definition osd.h:767
static int OsdWidth(void)
Definition osd.h:833
int height
Definition osd.h:769
static int osdTop
Definition osd.h:759
int Top(void)
Definition osd.h:846
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition osd.c:2143
static cVector< cOsd * > Osds
Definition osd.h:760
cBitmap * savedBitmap
Definition osd.h:764
static cSize maxPixmapSize
Definition osd.h:761
virtual ~cOsd()
Shuts down the OSD.
Definition osd.c:1932
bool Active(void)
Definition osd.h:793
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias=false)
Draws the given Image on this OSD at the given Point and scales it.
Definition osd.c:2184
int width
Definition osd.h:769
int Height(void)
Definition osd.h:848
static int IsOpen(void)
Returns true if there is currently a level 0 OSD open.
Definition osd.h:840
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:2226
friend class cOsdProvider
Definition osd.h:757
Definition osd.h:89
tColor Color(int Index) const
Returns the color at the given Index.
Definition osd.h:120
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
void Reset(void)
Resets the palette, making it contain no colors.
Definition osd.c:138
void Replace(const cPalette &Palette)
Replaces the colors of this palette with the colors from the given palette.
Definition osd.c:208
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
int maxColors
Definition osd.h:93
virtual ~cPalette()
Definition osd.c:123
bool modified
Definition osd.h:94
tIndex tIndexes[MAXNUMCOLORS]
Definition osd.h:97
int bpp
Definition osd.h:92
void SetBpp(int Bpp)
Sets the color depth of this palette to the given value.
Definition osd.c:165
void SetColor(int Index, tColor Color)
Sets the palette entry at Index to Color.
Definition osd.c:172
tColor color[MAXNUMCOLORS]
Definition osd.h:91
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
int Index(tColor Color)
Returns the index of the given Color (the first color has index 0).
Definition osd.c:144
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
int numColors
Definition osd.h:93
cPalette(int Bpp=8)
Initializes the palette with the given color depth.
Definition osd.c:117
double antiAliasGranularity
Definition osd.h:95
int Bpp(void) const
Definition osd.h:112
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 DrawRectangle(const cRect &Rect, tColor Color) override
Draws a filled rectangle with the given Color.
Definition osd.c:1433
virtual void Clear(void) override
Clears the pixmap's draw port by setting all pixels to be fully transparent.
Definition osd.c:1205
virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) override
Copies the part of the given Pixmap covered by Source into this pixmap at location Dest.
Definition osd.c:1819
virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) override
Renders the part of the given Pixmap covered by Source into this pixmap at location Dest.
Definition osd.c:1784
virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants=0) override
Draws a filled ellipse with the given Color that fits into the given rectangle.
Definition osd.c:1460
virtual void Scroll(const cPoint &Dest, const cRect &Source=cRect::Null) override
Scrolls the data in the pixmap's draw port to the given Dest point.
Definition osd.c:1846
const uint8_t * Data(void)
Definition osd.h:723
bool panning
Definition osd.h:718
virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg=0, tColor ColorBg=0, bool Overlay=false) override
Sets the pixels in the OSD with the data from the given Bitmap, putting the upper left corner of the ...
Definition osd.c:1357
cPixmapMemory(void)
Definition osd.c:1187
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) override
Draws the given string at Point with the given foreground and background color and font.
Definition osd.c:1384
virtual void Fill(tColor Color) override
Fills the pixmap's draw port with the given Color.
Definition osd.c:1213
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) override
Draws a "slope" with the given Color into the given rectangle.
Definition osd.c:1684
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias=false) override
Definition osd.c:1305
tColor * data
Definition osd.h:717
virtual void DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer=ALPHA_OPAQUE) override
Like DrawPixel(), but with an additional AlphaLayer, and works on any pixmap, not only the background...
Definition osd.c:1339
virtual void DrawImage(const cPoint &Point, const cImage &Image) override
Draws the given Image into this pixmap at the given Point.
Definition osd.c:1273
virtual void Pan(const cPoint &Dest, const cRect &Source=cRect::Null) override
Does the same as Scroll(), but also shifts the draw port accordingly, so that the view port doesn't g...
Definition osd.c:1880
virtual void DrawPixel(const cPoint &Point, tColor Color) override
Draws the image referenced by the given ImageHandle into this pixmap at the given Point and scales it...
Definition osd.c:1325
virtual ~cPixmapMemory() override
Definition osd.c:1200
cPixmapMutexLock(void)
Definition osd.h:707
Definition osd.h:461
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty)
Draws the Dirty part of the given Pixmap into this pixmap.
Definition osd.c:1222
virtual ~cPixmap()
Definition osd.h:474
virtual void DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer=ALPHA_OPAQUE)
Like DrawPixel(), but with an additional AlphaLayer, and works on any pixmap, not only the background...
Definition osd.h:634
bool Tile(void) const
Definition osd.h:545
const cRect & DrawPort(void) const
Returns the pixmap's draw port, which is relative to the view port.
Definition osd.h:550
friend class cPixmapMutexLock
Definition osd.h:463
int alpha
Definition osd.h:467
const cRect & DirtyViewPort(void) const
Returns the "dirty" rectangle this pixmap causes on the OSD.
Definition osd.h:554
virtual void SetViewPort(const cRect &Rect)
Sets the pixmap's view port to the given Rect.
Definition osd.c:1068
virtual void DrawScaledImage(const cPoint &Point, const cImage &Image, double FactorX, double FactorY, bool AntiAlias=false)
Definition osd.h:612
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)=0
Draws a "slope" with the given Color into the given rectangle.
cPixmap(void)
Definition osd.c:962
static void Unlock(void)
Definition osd.h:542
virtual void DrawScaledImage(const cPoint &Point, int ImageHandle, double FactorX, double FactorY, bool AntiAlias=false)
Draws the given Image into this pixmap at the given Point and scales it.
Definition osd.h:619
virtual void DrawImage(const cPoint &Point, int ImageHandle)=0
Draws the image referenced by the given ImageHandle into this pixmap at the given Point.
virtual void Clear(void)=0
Clears the pixmap's draw port by setting all pixels to be fully transparent.
void MarkViewPortDirty(const cRect &Rect)
Marks the given rectangle of the view port of this pixmap as dirty.
Definition osd.c:987
cRect dirtyDrawPort
Definition osd.h:472
cRect viewPort
Definition osd.h:469
const cRect & ViewPort(void) const
Returns the pixmap's view port, which is relative to the OSD's origin.
Definition osd.h:546
int Alpha(void) const
Definition osd.h:544
const cRect & DirtyDrawPort(void) const
Returns the "dirty" rectangle in the draw port of this this pixmap.
Definition osd.h:561
virtual void DrawImage(const cPoint &Point, const cImage &Image)=0
Draws the given Image into this pixmap at the given Point.
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...
virtual void DrawRectangle(const cRect &Rect, tColor Color)=0
Draws a filled rectangle with the given Color.
virtual void SetDrawPortPoint(const cPoint &Point, bool Dirty=true)
Sets the pixmap's draw port to the given Point.
Definition osd.c:1085
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:536
static cMutex mutex
Definition osd.h:465
virtual void SetLayer(int Layer)
Sets the layer of this pixmap to the given value.
Definition osd.c:1024
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 ...
void MarkDrawPortDirty(const cRect &Rect)
Marks the given rectangle of the draw port of this pixmap as dirty.
Definition osd.c:999
void SetClean(void)
Resets the "dirty" rectangles of this pixmap.
Definition osd.c:1019
virtual void DrawPixel(const cPoint &Point, tColor Color)=0
Draws the image referenced by the given ImageHandle into this pixmap at the given Point and scales it...
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 Fill(tColor Color)=0
Fills the pixmap's draw port with the given Color.
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.
bool tile
Definition osd.h:468
cRect dirtyViewPort
Definition osd.h:471
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.
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.
virtual void SetAlpha(int Alpha)
Sets the alpha value of this pixmap to the given value.
Definition osd.c:1046
friend class cOsd
Definition osd.h:462
int layer
Definition osd.h:466
cRect drawPort
Definition osd.h:470
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.
virtual void SetTile(bool Tile)
Sets the tile property of this pixmap to the given value.
Definition osd.c:1057
int Layer(void) const
Definition osd.h:543
Definition osd.h:308
cPoint(void)
Definition osd.h:313
void SetY(int Y)
Definition osd.h:323
cPoint operator-(void) const
Definition osd.h:318
int Y(void) const
Definition osd.h:321
int X(void) const
Definition osd.h:320
cPoint operator-(const cPoint &Point) const
Definition osd.h:319
cPoint(int X, int Y)
Definition osd.h:314
cPoint(const cPoint &Point)
Definition osd.h:315
bool operator!=(const cPoint &Point) const
Definition osd.h:317
void Set(int X, int Y)
Definition osd.h:324
void Set(const cPoint &Point)
Definition osd.h:325
void SetX(int X)
Definition osd.h:322
bool operator==(const cPoint &Point) const
Definition osd.h:316
cPoint Shifted(int Dx, int Dy) const
Definition osd.h:328
void Shift(int Dx, int Dy)
Definition osd.h:326
int y
Definition osd.h:311
int x
Definition osd.h:310
cPoint Shifted(const cPoint &Dp) const
Definition osd.h:329
void Shift(const cPoint &Dp)
Definition osd.h:327
Definition osd.h:354
static const cRect Null
Definition osd.h:359
void Combine(const cRect &Rect)
Combines this rectangle with the given Rect.
Definition osd.c:934
bool operator!=(const cRect &Rect) const
Definition osd.h:366
int Top(void) const
Definition osd.h:372
cRect(const cSize &Size)
Definition osd.h:363
void SetHeight(int Height)
Definition osd.h:386
cSize size
Definition osd.h:357
void Set(cPoint Point, cSize Size)
Definition osd.h:378
void SetSize(const cSize &Size)
Definition osd.h:382
void Shift(const cPoint &Dp)
Definition osd.h:392
const cPoint & Point(void) const
Definition osd.h:375
bool Intersects(const cRect &Rect) const
Returns true if this rectangle intersects with Rect.
Definition osd.c:914
bool Contains(const cPoint &Point) const
Returns true if this rectangle contains Point.
Definition osd.c:898
void SetPoint(int X, int Y)
Definition osd.h:379
cRect Intersected(const cRect &Rect) const
Returns the intersection of this rectangle and the given Rect.
Definition osd.c:922
int Height(void) const
Definition osd.h:370
int Left(void) const
Definition osd.h:371
int Bottom(void) const
Definition osd.h:374
void SetSize(int Width, int Height)
Definition osd.h:381
int Y(void) const
Definition osd.h:368
bool operator==(const cRect &Rect) const
Definition osd.h:365
void SetRight(int Right)
Definition osd.h:389
int X(void) const
Definition osd.h:367
void SetPoint(const cPoint &Point)
Definition osd.h:380
void Grow(int Dx, int Dy)
Grows the rectangle by the given number of pixels in either direction.
Definition osd.c:892
int Right(void) const
Definition osd.h:373
void SetTop(int Top)
Definition osd.h:388
void SetX(int X)
Definition osd.h:383
void SetLeft(int Left)
Definition osd.h:387
cRect Shifted(int Dx, int Dy) const
Definition osd.h:393
void SetBottom(int Bottom)
Definition osd.h:390
cPoint point
Definition osd.h:356
void SetY(int Y)
Definition osd.h:384
cRect(void)
Definition osd.h:360
void Shift(int Dx, int Dy)
Definition osd.h:391
cRect(const cRect &Rect)
Definition osd.h:364
void SetWidth(int Width)
Definition osd.h:385
int Width(void) const
Definition osd.h:369
cRect Combined(const cRect &Rect) const
Returns the surrounding rectangle that contains this rectangle and the given Rect.
Definition osd.h:409
cRect Grown(int Dw, int Dh) const
Definition osd.h:398
const cSize & Size(void) const
Definition osd.h:376
cRect(int X, int Y, int Width, int Height)
Definition osd.h:361
cRect Shifted(const cPoint &Dp) const
Definition osd.h:394
cRect Combined(const cPoint &Point) const
Returns the surrounding rectangle that contains this rectangle and the given Point.
Definition osd.h:414
cRect(const cPoint &Point, const cSize &Size)
Definition osd.h:362
bool IsEmpty(void) const
Returns true if this rectangle is empty.
Definition osd.h:417
void Set(int X, int Y, int Width, int Height)
Definition osd.h:377
Definition osd.h:332
bool Contains(const cPoint &Point) const
Definition osd.h:349
int width
Definition osd.h:334
cSize(int Width, int Height)
Definition osd.h:338
void Set(const cSize &Size)
Definition osd.h:348
void Grow(int Dw, int Dh)
Definition osd.h:350
void SetWidth(int Width)
Definition osd.h:345
int Height(void) const
Definition osd.h:344
int Width(void) const
Definition osd.h:343
cSize(void)
Definition osd.h:337
void Set(int Width, int Height)
Definition osd.h:347
void SetHeight(int Height)
Definition osd.h:346
int height
Definition osd.h:335
bool operator!=(const cSize &Size) const
Definition osd.h:341
cSize Grown(int Dw, int Dh) const
Definition osd.h:351
bool operator==(const cSize &Size) const
Definition osd.h:340
cSize(const cSize &Size)
Definition osd.h:339
bool operator<(const cSize &Size) const
Definition osd.h:342
int Height(void)
Definition osd.h:1092
tColor colorBg
Definition osd.h:1080
int Left(void)
Definition osd.h:1089
void DrawText(void)
Definition osd.c:2443
bool CanScroll(void)
Definition osd.h:1096
int shown
Definition osd.h:1081
int Total(void)
Definition osd.h:1093
int height
Definition osd.h:1078
cTextWrapper textWrapper
Definition osd.h:1082
const cFont * font
Definition osd.h:1079
cTextScroller(void)
Definition osd.c:2405
void Scroll(bool Up, bool Page)
Definition osd.c:2451
int Top(void)
Definition osd.h:1090
int Offset(void)
Definition osd.h:1094
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:2421
void Reset(void)
Definition osd.c:2438
tColor colorFg
Definition osd.h:1080
int width
Definition osd.h:1078
int Shown(void)
Definition osd.h:1095
cOsd * osd
Definition osd.h:1077
bool CanScrollDown(void)
Definition osd.h:1098
int offset
Definition osd.h:1081
int Width(void)
Definition osd.h:1091
bool CanScrollUp(void)
Definition osd.h:1097
cSetup Setup
Definition config.c:372
uint32_t tColor
Definition font.h:30
uint8_t tIndex
Definition font.h:31
#define ALPHA_OPAQUE
Definition osd.h:26
tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer=ALPHA_OPAQUE)
Definition osd.c:81
eTextAlignment
Definition osd.h:159
@ taCenter
Definition osd.h:159
@ taBorder
Definition osd.h:164
@ taTop
Definition osd.h:162
@ taBottom
Definition osd.h:163
@ taRight
Definition osd.h:161
@ taDefault
Definition osd.h:165
@ taLeft
Definition osd.h:160
tColor RgbShade(tColor Color, double Factor)
Returns a brighter (Factor > 0) or darker (Factor < 0) version of the given Color.
Definition osd.c:43
#define MAXNUMCOLORS
Definition osd.h:24
eOsdError
Definition osd.h:45
@ oeTooManyColors
Definition osd.h:47
@ oeUnknown
Definition osd.h:53
@ oeTooManyAreas
Definition osd.h:46
@ oeWrongAreaSize
Definition osd.h:52
@ oeAreasOverlap
Definition osd.h:49
@ oeOutOfMemory
Definition osd.h:51
@ oeWrongAlignment
Definition osd.h:50
@ oeOk
Definition osd.h:45
@ oeBppNotSupported
Definition osd.h:48
tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
Definition osd.h:64
#define OSD_LEVEL_DEFAULT
Definition osd.h:21
tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
Definition osd.h:59
#define MAXOSDAREAS
Definition osd.h:743
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
#define MAXOSDIMAGES
Definition osd.h:1003
@ clrTranslucent
Definition osd.h:33
@ clrGray50
Definition osd.h:34
#define clrBlue
Definition skincurses.c:41
#define clrTransparent
Definition skincurses.c:36
#define clrBlack
Definition skincurses.c:37
#define clrWhite
Definition skincurses.c:44
#define clrGreen
Definition skincurses.c:39
#define clrRed
Definition skincurses.c:38
#define clrYellow
Definition skincurses.c:40
#define clrMagenta
Definition skincurses.c:42
#define clrCyan
Definition skincurses.c:43
static const cCursesFont Font
Definition skincurses.c:31
Definition osd.h:300
int Width(void) const
Definition osd.h:303
int bpp
Definition osd.h:302
int x2
Definition osd.h:301
int y1
Definition osd.h:301
int x1
Definition osd.h:301
int Height(void) const
Definition osd.h:304
bool Intersects(const tArea &Area) const
Definition osd.h:305
int y2
Definition osd.h:301