vdr 2.6.4
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.1 2021/05/21 12:54:08 kls Exp $
8 */
9
10#ifndef __OSD_H
11#define __OSD_H
12
13#include <limits.h>
14#include <stdio.h>
15#include <stdint.h>
16#include "config.h"
17#include "font.h"
18#include "thread.h"
19#include "tools.h"
20
21#define OSD_LEVEL_DEFAULT 0
22#define OSD_LEVEL_SUBTITLES 10
23
24#define MAXNUMCOLORS 256
25#define ALPHA_TRANSPARENT 0x00
26#define ALPHA_OPAQUE 0xFF
27#define IS_OPAQUE(c) ((c >> 24) == ALPHA_OPAQUE)
28#define TEXT_ALIGN_BORDER 10 // fraction of the font height used for sizing border
29
30enum {
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
44enum eOsdError { oeOk, // see also OsdErrorTexts in osd.c
53 };
54
55typedef uint32_t tColor; // see also font.h
56typedef uint8_t tIndex;
57
58inline 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
63inline tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
64{
65 return (tColor(R) << 16) | (tColor(G) << 8) | B;
66}
67
68inline 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
73tColor RgbShade(tColor Color, double Factor);
80
81tColor HsvToColor(double H, double S, double V);
85
86tColor AlphaBlend(tColor ColorFg, tColor ColorBg, uint8_t AlphaLayer = ALPHA_OPAQUE);
87
88class cPalette {
89private:
91 int bpp;
95protected:
97public:
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
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
167class cFont;
168
169class cBitmap : public cPalette {
170private:
172 int x0, y0;
175public:
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
298struct 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
306class cPoint {
307private:
308 int x;
309 int y;
310public:
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
330class cSize {
331private:
332 int width;
334public:
335 cSize(void) { width = height = 0; }
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
352class cRect {
353private:
356public:
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); }
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
419class cImage {
420private:
423public:
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
454class cPixmap {
455 friend class cOsd;
456 friend class cPixmapMutexLock;
457private:
458 static cMutex mutex;
459 int layer;
460 int alpha;
461 bool tile;
466protected:
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);
495public:
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 DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer = ALPHA_OPAQUE) { DrawPixel(Point, Color); }
614 virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false) = 0;
625 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;
631 virtual void DrawRectangle(const cRect &Rect, tColor Color) = 0;
633 virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0) = 0;
642 virtual void DrawSlope(const cRect &Rect, tColor Color, int Type) = 0;
653 virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
657 virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest) = 0;
662 virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
666 virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null) = 0;
678 };
679
681public:
683 };
684
685#define LOCK_PIXMAPS cPixmapMutexLock PixmapMutexLock
686
687// cPixmapMemory is an implementation of cPixmap that uses an array of tColor
688// values to store the pixmap.
689
690class cPixmapMemory : public cPixmap {
691private:
694public:
695 cPixmapMemory(void);
697 virtual ~cPixmapMemory();
698 const uint8_t *Data(void) { return (uint8_t *)data; }
699 virtual void Clear(void);
700 virtual void Fill(tColor Color);
701 virtual void DrawImage(const cPoint &Point, const cImage &Image);
702 virtual void DrawImage(const cPoint &Point, int ImageHandle);
703 virtual void DrawPixel(const cPoint &Point, tColor Color);
704 virtual void DrawBlendedPixel(const cPoint &Point, tColor Color, uint8_t AlphaLayer = ALPHA_OPAQUE);
705 virtual void DrawBitmap(const cPoint &Point, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool Overlay = false);
706 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);
707 virtual void DrawRectangle(const cRect &Rect, tColor Color);
708 virtual void DrawEllipse(const cRect &Rect, tColor Color, int Quadrants = 0);
709 virtual void DrawSlope(const cRect &Rect, tColor Color, int Type);
710 virtual void Render(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
711 virtual void Copy(const cPixmap *Pixmap, const cRect &Source, const cPoint &Dest);
712 virtual void Scroll(const cPoint &Dest, const cRect &Source = cRect::Null);
713 virtual void Pan(const cPoint &Dest, const cRect &Source = cRect::Null);
714 };
715
716#define MAXOSDAREAS 16
717
728
729class cOsd {
730 friend class cOsdProvider;
731private:
735 static cMutex mutex;
743 uint level;
744 bool active;
745protected:
746 cOsd(int Left, int Top, uint Level);
766 bool Active(void) { return active; }
767 virtual void SetActive(bool On) { active = On; }
770 cPixmap *AddPixmap(cPixmap *Pixmap);
776 cPixmap *RenderPixmaps(void);
793 cBitmap *GetBitmap(int Area);
801public:
802 virtual ~cOsd();
804 static int OsdLeft(void) { return osdLeft ? osdLeft : Setup.OSDLeft; }
805 static int OsdTop(void) { return osdTop ? osdTop : Setup.OSDTop; }
806 static int OsdWidth(void) { return osdWidth ? osdWidth : Setup.OSDWidth; }
807 static int OsdHeight(void) { return osdHeight ? osdHeight : Setup.OSDHeight; }
808 static void SetOsdPosition(int Left, int Top, int Width, int Height);
813 static int IsOpen(void) { return Osds.Size() && Osds[0]->level == OSD_LEVEL_DEFAULT; }
815 bool IsTrueColor(void) const { return isTrueColor; }
818 int Left(void) { return left; }
819 int Top(void) { return top; }
820 int Width(void) { return width; }
821 int Height(void) { return height; }
822 void SetAntiAliasGranularity(uint FixedColors, uint BlendColors);
833 virtual const cSize &MaxPixmapSize(void) const;
839 virtual cPixmap *CreatePixmap(int Layer, const cRect &ViewPort, const cRect &DrawPort = cRect::Null);
846 virtual void DestroyPixmap(cPixmap *Pixmap);
851 virtual void DrawImage(const cPoint &Point, const cImage &Image);
854 virtual void DrawImage(const cPoint &Point, int ImageHandle);
860 virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas);
868 virtual eOsdError SetAreas(const tArea *Areas, int NumAreas);
880 virtual void SaveRegion(int x1, int y1, int x2, int y2);
884 virtual void RestoreRegion(void);
887 virtual eOsdError SetPalette(const cPalette &Palette, int Area);
890 virtual void DrawPixel(int x, int y, tColor Color);
896 virtual void DrawBitmap(int x, int y, const cBitmap &Bitmap, tColor ColorFg = 0, tColor ColorBg = 0, bool ReplacePalette = false, bool Overlay = false);
907 virtual void DrawScaledBitmap(int x, int y, const cBitmap &Bitmap, double FactorX, double FactorY, bool AntiAlias = false);
912 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);
918 virtual void DrawRectangle(int x1, int y1, int x2, int y2, tColor Color);
921 virtual void DrawEllipse(int x1, int y1, int x2, int y2, tColor Color, int Quadrants = 0);
931 virtual void DrawSlope(int x1, int y1, int x2, int y2, tColor Color, int Type);
943 virtual void Flush(void);
960 };
961
962#define MAXOSDIMAGES 64
963
965 friend class cPixmapMemory;
966private:
968 static int oldWidth;
969 static int oldHeight;
970 static double oldAspect;
972 static int osdState;
973protected:
974 virtual cOsd *CreateOsd(int Left, int Top, uint Level) = 0;
977 virtual bool ProvidesTrueColor(void) { return false; }
979 virtual int StoreImageData(const cImage &Image);
990 virtual void DropImageData(int ImageHandle);
992 static const cImage *GetImageData(int ImageHandle);
994public:
995 cOsdProvider(void);
996 //XXX maybe parameter to make this one "sticky"??? (frame-buffer etc.)
997 virtual ~cOsdProvider();
998 static cOsd *NewOsd(int Left, int Top, uint Level = OSD_LEVEL_DEFAULT);
1004 static void UpdateOsdSize(bool Force = false);
1009 static bool OsdSizeChanged(int &State);
1015 static bool SupportsTrueColor(void);
1017 static int StoreImage(const cImage &Image);
1027 static void DropImage(int ImageHandle);
1030 static void Shutdown(void);
1032 };
1033
1035private:
1038 const cFont *font;
1042 void DrawText(void);
1043public:
1044 cTextScroller(void);
1045 cTextScroller(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1046 void Set(cOsd *Osd, int Left, int Top, int Width, int Height, const char *Text, const cFont *Font, tColor ColorFg, tColor ColorBg);
1047 void Reset(void);
1048 int Left(void) { return left; }
1049 int Top(void) { return top; }
1050 int Width(void) { return width; }
1051 int Height(void) { return height; }
1052 int Total(void) { return textWrapper.Lines(); }
1053 int Offset(void) { return offset; }
1054 int Shown(void) { return shown; }
1055 bool CanScroll(void) { return CanScrollUp() || CanScrollDown(); }
1056 bool CanScrollUp(void) { return offset > 0; }
1057 bool CanScrollDown(void) { return offset + shown < Total(); }
1058 void Scroll(bool Up, bool Page);
1059 };
1060
1061#endif //__OSD_H
Definition osd.h:169
int y0
Definition osd.h:172
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:195
int dirtyY2
Definition osd.h:174
int width
Definition osd.h:173
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:189
int height
Definition osd.h:173
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:186
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:277
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:174
tIndex * bitmap
Definition osd.h:171
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:174
int dirtyY1
Definition osd.h:174
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
virtual ~cBitmap()
Definition osd.c:289
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
int Y0(void) const
Definition osd.h:187
int x0
Definition osd.h:172
int Width(void) const
Definition osd.h:188
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:419
int Height(void) const
Definition osd.h:436
const tColor * Data(void) const
Definition osd.h:437
int Width(void) const
Definition osd.h:435
cImage(void)
Definition osd.c:1104
tColor * data
Definition osd.h:422
void SetPixel(const cPoint &Point, tColor Color)
Sets the pixel at the given Point to Color.
Definition osd.h:442
const cSize & Size(void) const
Definition osd.h:434
virtual ~cImage()
Definition osd.c:1126
cSize size
Definition osd.h:421
tColor GetPixel(const cPoint &Point) const
Returns the pixel value at the given Point.
Definition osd.h:438
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
cMutex * mutex
Definition thread.h:143
void Lock(void)
Definition thread.c:222
void Unlock(void)
Definition thread.c:228
static int oldHeight
Definition osd.h:969
static int oldWidth
Definition osd.h:968
virtual bool ProvidesTrueColor(void)
Returns true if this OSD provider is able to handle a true color OSD.
Definition osd.h:977
static cImage * images[MAXOSDIMAGES]
Definition osd.h:971
static double oldAspect
Definition osd.h:970
static bool OsdSizeChanged(int &State)
Checks if the OSD size has changed and a currently displayed OSD needs to be redrawn.
Definition osd.c:2262
static void DropImage(int ImageHandle)
Drops the image referenced by the given ImageHandle.
Definition osd.c:2316
virtual ~cOsdProvider()
Definition osd.c:2210
virtual int StoreImageData(const cImage &Image)
Copies the given Image and returns a handle for later reference.
Definition osd.c:2280
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:2292
static cOsdProvider * osdProvider
Definition osd.h:967
static int osdState
Definition osd.h:972
static int StoreImage(const cImage &Image)
Stores the given Image for later use with DrawImage() on an OSD or pixmap.
Definition osd.c:2309
cOsdProvider(void)
Definition osd.c:2204
static void Shutdown(void)
Shuts down the OSD provider facility by deleting the current OSD provider.
Definition osd.c:2322
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:2235
static const cImage * GetImageData(int ImageHandle)
Gets the image data referenced by ImageHandle.
Definition osd.c:2301
static bool SupportsTrueColor(void)
Returns true if the current OSD provider is able to handle a true color OSD.
Definition osd.c:2270
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:2215
The cOsd class is the interface to the "On Screen Display".
Definition osd.h:729
int numBitmaps
Definition osd.h:739
virtual eOsdError SetPalette(const cPalette &Palette, int Area)
Sets the Palette for the given Area (the first area is numbered 0).
Definition osd.c:2098
uint level
Definition osd.h:743
bool IsTrueColor(void) const
Returns 'true' if this is a true color OSD (providing full 32 bit color depth).
Definition osd.h:815
virtual const cSize & MaxPixmapSize(void) const
Returns the maximum possible size of a pixmap this OSD can create.
Definition osd.c:1909
int top
Definition osd.h:742
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image on this OSD at the given Point.
Definition osd.c:2109
static int osdHeight
Definition osd.h:732
virtual void SetActive(bool On)
Sets this OSD to be the active one.
Definition osd.h:767
int Width(void)
Definition osd.h:820
static int OsdHeight(void)
Definition osd.h:807
bool isTrueColor
Definition osd.h:736
cVector< cPixmap * > pixmaps
Definition osd.h:741
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
Definition osd.c:2029
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:2131
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:2171
cBitmap * GetBitmap(int Area)
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
Definition osd.c:1904
virtual void DestroyPixmap(cPixmap *Pixmap)
Destroys the given Pixmap, which has previously been created by a call to CreatePixmap().
Definition osd.c:1926
void SetAntiAliasGranularity(uint FixedColors, uint BlendColors)
Allows the system to optimize utilization of the limited color palette entries when generating blende...
Definition osd.c:1896
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:2121
bool active
Definition osd.h:744
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
Definition osd.c:2007
static int osdWidth
Definition osd.h:732
cPixmap * AddPixmap(cPixmap *Pixmap)
Adds the given Pixmap to the list of currently active pixmaps in this OSD.
Definition osd.c:1943
cPixmap * RenderPixmaps(void)
Renders the dirty part of all pixmaps into a resulting pixmap that shall be displayed on the OSD.
Definition osd.c:1956
static int OsdTop(void)
Definition osd.h:805
static int osdLeft
Definition osd.h:732
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:1914
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:1888
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:2064
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:2141
virtual void Flush(void)
Actually commits all data to the OSD hardware.
Definition osd.c:2191
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:2161
int Left(void)
Definition osd.h:818
static int OsdLeft(void)
Definition osd.h:804
cBitmap * bitmaps[MAXOSDAREAS]
Definition osd.h:738
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:2181
static cMutex mutex
Definition osd.h:735
int left
Definition osd.h:742
cPixmapMemory * savedPixmap
Definition osd.h:740
static int OsdWidth(void)
Definition osd.h:806
int height
Definition osd.h:742
static int osdTop
Definition osd.h:732
int Top(void)
Definition osd.h:819
virtual void RestoreRegion(void)
Restores the region previously saved by a call to SaveRegion().
Definition osd.c:2080
static cVector< cOsd * > Osds
Definition osd.h:733
cBitmap * savedBitmap
Definition osd.h:737
static cSize maxPixmapSize
Definition osd.h:734
virtual ~cOsd()
Shuts down the OSD.
Definition osd.c:1869
bool Active(void)
Definition osd.h:766
int width
Definition osd.h:742
int Height(void)
Definition osd.h:821
static int IsOpen(void)
Returns true if there is currently a level 0 OSD open.
Definition osd.h:813
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:2151
Definition osd.h:88
tColor Color(int Index) const
Returns the color at the given Index.
Definition osd.h:119
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:92
virtual ~cPalette()
Definition osd.c:123
bool modified
Definition osd.h:93
tIndex tIndexes[MAXNUMCOLORS]
Definition osd.h:96
int bpp
Definition osd.h:91
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:90
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:92
double antiAliasGranularity
Definition osd.h:94
int Bpp(void) const
Definition osd.h:111
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 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:1817
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:1783
const uint8_t * Data(void)
Definition osd.h:698
virtual void Clear(void)
Clears the pixmap's draw port by setting all pixels to be fully transparent.
Definition osd.c:1162
bool panning
Definition osd.h:693
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:1756
cPixmapMemory(void)
Definition osd.c:1144
virtual ~cPixmapMemory()
Definition osd.c:1157
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:1721
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.c:1276
virtual void DrawSlope(const cRect &Rect, tColor Color, int Type)
Draws a "slope" with the given Color into the given rectangle.
Definition osd.c:1621
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:1294
virtual void DrawImage(const cPoint &Point, const cImage &Image)
Draws the given Image into this pixmap at the given Point.
Definition osd.c:1230
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:1321
virtual void Fill(tColor Color)
Fills the pixmap's draw port with the given Color.
Definition osd.c:1170
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:1397
tColor * data
Definition osd.h:692
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
virtual void DrawRectangle(const cRect &Rect, tColor Color)
Draws a filled rectangle with the given Color.
Definition osd.c:1370
cPixmapMutexLock(void)
Definition osd.h:682
Definition osd.h:454
virtual void DrawPixmap(const cPixmap *Pixmap, const cRect &Dirty)
Draws the Dirty part of the given Pixmap into this pixmap.
Definition osd.c:1179
virtual ~cPixmap()
Definition osd.h:467
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:610
bool Tile(void) const
Definition osd.h:538
const cRect & DrawPort(void) const
Returns the pixmap's draw port, which is relative to the view port.
Definition osd.h:543
int alpha
Definition osd.h:460
const cRect & DirtyViewPort(void) const
Returns the "dirty" rectangle this pixmap causes on the OSD.
Definition osd.h:547
virtual void SetViewPort(const cRect &Rect)
Sets the pixmap's view port to the given Rect.
Definition osd.c:1068
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:535
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:465
cRect viewPort
Definition osd.h:462
const cRect & ViewPort(void) const
Returns the pixmap's view port, which is relative to the OSD's origin.
Definition osd.h:539
int Alpha(void) const
Definition osd.h:537
const cRect & DirtyDrawPort(void) const
Returns the "dirty" rectangle in the draw port of this this pixmap.
Definition osd.h:554
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:529
static cMutex mutex
Definition osd.h:458
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
Sets the pixel at the given Point to the given Color, which is a full 32 bit ARGB value.
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:461
cRect dirtyViewPort
Definition osd.h:464
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
int layer
Definition osd.h:459
cRect drawPort
Definition osd.h:463
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:536
Definition osd.h:306
cPoint(void)
Definition osd.h:311
void SetY(int Y)
Definition osd.h:321
cPoint operator-(void) const
Definition osd.h:316
int Y(void) const
Definition osd.h:319
int X(void) const
Definition osd.h:318
cPoint operator-(const cPoint &Point) const
Definition osd.h:317
cPoint(int X, int Y)
Definition osd.h:312
cPoint(const cPoint &Point)
Definition osd.h:313
bool operator!=(const cPoint &Point) const
Definition osd.h:315
void Set(int X, int Y)
Definition osd.h:322
void Set(const cPoint &Point)
Definition osd.h:323
void SetX(int X)
Definition osd.h:320
bool operator==(const cPoint &Point) const
Definition osd.h:314
cPoint Shifted(int Dx, int Dy) const
Definition osd.h:326
void Shift(int Dx, int Dy)
Definition osd.h:324
int y
Definition osd.h:309
int x
Definition osd.h:308
cPoint Shifted(const cPoint &Dp) const
Definition osd.h:327
void Shift(const cPoint &Dp)
Definition osd.h:325
Definition osd.h:352
static const cRect Null
Definition osd.h:357
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:364
int Top(void) const
Definition osd.h:370
cRect(const cSize &Size)
Definition osd.h:361
void SetHeight(int Height)
Definition osd.h:384
cSize size
Definition osd.h:355
void Set(cPoint Point, cSize Size)
Definition osd.h:376
void SetSize(const cSize &Size)
Definition osd.h:380
void Shift(const cPoint &Dp)
Definition osd.h:390
const cPoint & Point(void) const
Definition osd.h:373
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:377
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:368
int Left(void) const
Definition osd.h:369
int Bottom(void) const
Definition osd.h:372
void SetSize(int Width, int Height)
Definition osd.h:379
int Y(void) const
Definition osd.h:366
bool operator==(const cRect &Rect) const
Definition osd.h:363
void SetRight(int Right)
Definition osd.h:387
int X(void) const
Definition osd.h:365
void SetPoint(const cPoint &Point)
Definition osd.h:378
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:371
void SetTop(int Top)
Definition osd.h:386
void SetX(int X)
Definition osd.h:381
void SetLeft(int Left)
Definition osd.h:385
cRect Shifted(int Dx, int Dy) const
Definition osd.h:391
void SetBottom(int Bottom)
Definition osd.h:388
cPoint point
Definition osd.h:354
void SetY(int Y)
Definition osd.h:382
cRect(void)
Definition osd.h:358
void Shift(int Dx, int Dy)
Definition osd.h:389
cRect(const cRect &Rect)
Definition osd.h:362
void SetWidth(int Width)
Definition osd.h:383
int Width(void) const
Definition osd.h:367
cRect Combined(const cRect &Rect) const
Returns the surrounding rectangle that contains this rectangle and the given Rect.
Definition osd.h:407
cRect Grown(int Dw, int Dh) const
Definition osd.h:396
const cSize & Size(void) const
Definition osd.h:374
cRect(int X, int Y, int Width, int Height)
Definition osd.h:359
cRect Shifted(const cPoint &Dp) const
Definition osd.h:392
cRect Combined(const cPoint &Point) const
Returns the surrounding rectangle that contains this rectangle and the given Point.
Definition osd.h:412
cRect(const cPoint &Point, const cSize &Size)
Definition osd.h:360
bool IsEmpty(void) const
Returns true if this rectangle is empty.
Definition osd.h:415
void Set(int X, int Y, int Width, int Height)
Definition osd.h:375
int OSDHeight
Definition config.h:330
int OSDTop
Definition config.h:330
int OSDLeft
Definition config.h:330
int OSDWidth
Definition config.h:330
Definition osd.h:330
bool Contains(const cPoint &Point) const
Definition osd.h:347
int width
Definition osd.h:332
cSize(int Width, int Height)
Definition osd.h:336
void Set(const cSize &Size)
Definition osd.h:346
void Grow(int Dw, int Dh)
Definition osd.h:348
void SetWidth(int Width)
Definition osd.h:343
int Height(void) const
Definition osd.h:342
int Width(void) const
Definition osd.h:341
cSize(void)
Definition osd.h:335
void Set(int Width, int Height)
Definition osd.h:345
void SetHeight(int Height)
Definition osd.h:344
int height
Definition osd.h:333
bool operator!=(const cSize &Size) const
Definition osd.h:339
cSize Grown(int Dw, int Dh) const
Definition osd.h:349
bool operator==(const cSize &Size) const
Definition osd.h:338
cSize(const cSize &Size)
Definition osd.h:337
bool operator<(const cSize &Size) const
Definition osd.h:340
int Height(void)
Definition osd.h:1051
tColor colorBg
Definition osd.h:1039
int Left(void)
Definition osd.h:1048
void DrawText(void)
Definition osd.c:2368
bool CanScroll(void)
Definition osd.h:1055
int shown
Definition osd.h:1040
int Total(void)
Definition osd.h:1052
int height
Definition osd.h:1037
cTextWrapper textWrapper
Definition osd.h:1041
const cFont * font
Definition osd.h:1038
cTextScroller(void)
Definition osd.c:2330
void Scroll(bool Up, bool Page)
Definition osd.c:2376
int Top(void)
Definition osd.h:1049
int Offset(void)
Definition osd.h:1053
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:2346
void Reset(void)
Definition osd.c:2363
tColor colorFg
Definition osd.h:1039
int width
Definition osd.h:1037
int Shown(void)
Definition osd.h:1054
cOsd * osd
Definition osd.h:1036
bool CanScrollDown(void)
Definition osd.h:1057
int offset
Definition osd.h:1040
int Width(void)
Definition osd.h:1050
bool CanScrollUp(void)
Definition osd.h:1056
int Lines(void)
Returns the actual number of lines needed to display the full wrapped text.
Definition font.h:121
int Size(void) const
Definition tools.h:764
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:158
@ taCenter
Definition osd.h:158
@ taBorder
Definition osd.h:163
@ taTop
Definition osd.h:161
@ taBottom
Definition osd.h:162
@ taRight
Definition osd.h:160
@ taDefault
Definition osd.h:164
@ taLeft
Definition osd.h:159
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:44
@ oeTooManyColors
Definition osd.h:46
@ oeUnknown
Definition osd.h:52
@ oeTooManyAreas
Definition osd.h:45
@ oeWrongAreaSize
Definition osd.h:51
@ oeAreasOverlap
Definition osd.h:48
@ oeOutOfMemory
Definition osd.h:50
@ oeWrongAlignment
Definition osd.h:49
@ oeOk
Definition osd.h:44
@ oeBppNotSupported
Definition osd.h:47
tColor RgbToColor(uint8_t R, uint8_t G, uint8_t B)
Definition osd.h:63
#define OSD_LEVEL_DEFAULT
Definition osd.h:21
@ clrBlue
Definition osd.h:39
@ clrWhite
Definition osd.h:41
@ clrRed
Definition osd.h:35
@ clrYellow
Definition osd.h:37
@ clrCyan
Definition osd.h:40
@ clrBlack
Definition osd.h:34
@ clrMagenta
Definition osd.h:38
@ clrGray50
Definition osd.h:33
@ clrTransparent
Definition osd.h:32
@ clrGreen
Definition osd.h:36
tColor ArgbToColor(uint8_t A, uint8_t R, uint8_t G, uint8_t B)
Definition osd.h:58
#define MAXOSDAREAS
Definition osd.h:716
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:962
uint32_t tColor
Definition osd.h:55
uint8_t tIndex
Definition osd.h:56
static const cCursesFont Font
Definition skincurses.c:31
Definition osd.h:298
int Width(void) const
Definition osd.h:301
int bpp
Definition osd.h:300
int x2
Definition osd.h:299
int y1
Definition osd.h:299
int x1
Definition osd.h:299
int Height(void) const
Definition osd.h:302
bool Intersects(const tArea &Area) const
Definition osd.h:303
int y2
Definition osd.h:299