summaryrefslogtreecommitdiff
path: root/dvbosd.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-10-03 10:34:48 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-10-03 10:34:48 +0200
commit6a50f37f25b43112d4a1fad8a5057089548dfc3c (patch)
treec3a28722d1c7b04c12174fe748aead391e7c0ed8 /dvbosd.h
parentb4faf3787a24c43b0a22b3ee695374012c992eb2 (diff)
downloadvdr-6a50f37f25b43112d4a1fad8a5057089548dfc3c.tar.gz
vdr-6a50f37f25b43112d4a1fad8a5057089548dfc3c.tar.bz2
Faster OSD by using bitmap
Diffstat (limited to 'dvbosd.h')
-rw-r--r--dvbosd.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/dvbosd.h b/dvbosd.h
new file mode 100644
index 00000000..f7a53635
--- /dev/null
+++ b/dvbosd.h
@@ -0,0 +1,74 @@
+/*
+ * dvbosd.h: Interface to the DVB On Screen Display
+ *
+ * See the main source file 'vdr.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: dvbosd.h 1.1 2000/10/01 15:00:00 kls Exp $
+ */
+
+#ifndef __DVBOSD_H
+#define __DVBOSD_H
+
+// FIXME: these should be defined in ../DVB/driver/dvb.h!!!
+typedef unsigned int __u32;
+typedef unsigned short __u16;
+typedef unsigned char __u8;
+
+#if defined(DEBUG_OSD) || defined(REMOTE_KBD)
+#include <ncurses.h>
+#endif
+#include <stdio.h>
+#include <dvb.h>
+#include "font.h"
+
+enum eDvbColor {
+#ifndef DEBUG_OSD
+ clrTransparent,
+#endif
+ clrBackground,
+#ifdef DEBUG_OSD
+ clrTransparent = clrBackground,
+ clrBlack = clrBackground,
+#else
+ clrBlack,
+#endif
+ clrRed,
+ clrGreen,
+ clrYellow,
+ clrBlue,
+ clrMagenta,
+ clrCyan,
+ clrWhite,
+ };
+
+class cBitmap {
+private:
+ cFont *font;
+protected:
+ int width, height;
+ char *bitmap;
+ int dirtyX1, dirtyY1, dirtyX2, dirtyY2;
+ void Clean(void);
+public:
+ cBitmap(int Width, int Height);
+ virtual ~cBitmap();
+ void SetFont(eDvbFont Font);
+ bool Dirty(void);
+ void SetPixel(int x, int y, eDvbColor Color);
+ void Text(int x, int y, const char *s, eDvbColor ColorFg = clrWhite, eDvbColor ColorBg = clrBackground);
+ void Fill(int x1, int y1, int x2, int y2, eDvbColor Color);
+ void Clear(void);
+ };
+
+class cDvbOsd : public cBitmap {
+private:
+ int videoDev;
+ void Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = NULL);
+public:
+ cDvbOsd(int VideoDev, int x1, int y1, int x2, int y2, int Bpp);
+ ~cDvbOsd();
+ void Flush(void);
+ };
+
+#endif //__DVBOSD_H