10 #include <../kernel-headers-5.13/osd.h>
12 #include <sys/ioctl.h>
13 #include <sys/unistd.h>
14 #include <vdr/tools.h>
18 #define MAXNUMWINDOWS 7
19 #define MAXOSDMEMORY 92000
26 void Cmd(
OSD_Command cmd,
int color = 0,
int x0 = 0,
int y0 = 0,
int x1 = 0,
int y1 = 0,
const void *data = NULL);
34 virtual void Flush(
void);
38 :
cOsd(Left, Top, Level)
46 #ifdef OSD_CAP_MEMSIZE
92 for (
int i = 0; i < NumAreas; i++) {
93 if (Areas[i].bpp != 1 && Areas[i].bpp != 2 && Areas[i].bpp != 4 && Areas[i].bpp != 8)
95 if ((Areas[i].
Width() & (8 / Areas[i].bpp - 1)) != 0)
99 TotalMemory += Areas[i].
Width() * Areas[i].
Height() / (8 / Areas[i].
bpp);
129 dc.
data = (
void *)data;
139 for (
int i = 0; (Bitmap =
GetBitmap(i)) != NULL; i++) {
143 int x1 = 0, y1 = 0, x2 = 0, y2 = 0;
144 if (!
shown || Bitmap->
Dirty(x1, y1, x2, y2)) {
147 x2 = Bitmap->
Width() - 1;
148 y2 = Bitmap->
Height() - 1;
153 while ((x1 > 0 || x2 < Bitmap->
Width() - 1) && ((x2 - x1) & 7) != 7) {
154 if (x2 < Bitmap->
Width() - 1)
160 while ((y1 > 0 || y2 < Bitmap->
Height() - 1) && (((x2 - x1 + 1) * (y2 - y1 + 1) / 2) & 7) != 0) {
161 if (y2 < Bitmap->
Height() - 1)
166 while ((x1 > 0 || x2 < Bitmap->
Width() - 1) && (((x2 - x1 + 1) * (y2 - y1 + 1) / 2) & 7) != 0) {
167 if (x2 < Bitmap->
Width() - 1)
178 for (
int i = 0; i < NumColors; i++) {
180 colors[i] = (Colors[i] & 0xFF000000) | ((Colors[i] & 0x0000FF) << 16) | (Colors[i] & 0x00FF00) | ((Colors[i] & 0xFF0000) >> 16);
193 for (
int i = 0; (Bitmap =
GetBitmap(i)) != NULL; i++) {
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 ...
void Clean(void)
Marks the dirty area as clean.
const tIndex * Data(int x, int y) const
Returns the address of the index byte at the given coordinates.
cDvbOsdProvider(int OsdDev)
virtual cOsd * CreateOsd(int Left, int Top, uint Level)
Returns a pointer to a newly created cOsd object, which will be located at the given coordinates.
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
void Cmd(OSD_Command cmd, int color=0, int x0=0, int y0=0, int x1=0, int y1=0, const void *data=NULL)
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
virtual void Flush(void)
Actually commits all data to the OSD hardware.
virtual void SetActive(bool On)
Sets this OSD to be the active one.
cDvbSdFfOsd(int Left, int Top, int OsdDev, uint Level)
The cOsd class is the interface to the "On Screen Display".
virtual void SetActive(bool On)
Sets this OSD to be the active one.
virtual eOsdError SetAreas(const tArea *Areas, int NumAreas)
Sets the sub-areas to the given areas.
cBitmap * GetBitmap(int Area)
Returns a pointer to the bitmap for the given Area, or NULL if no such bitmap exists.
virtual eOsdError CanHandleAreas(const tArea *Areas, int NumAreas)
Checks whether the OSD can display the given set of sub-areas.
const tColor * Colors(int &NumColors) const
Returns a pointer to the complete color table and stores the number of valid entries in NumColors.