]> git.vomp.tv Git - vompclient.git/blob - surfacedirectfb.h
Preparations for dynamic mode switching
[vompclient.git] / surfacedirectfb.h
1 /*\r
2     Copyright 2004-2005 Chris Tallon, 2009 Marten Richter\r
3     Portions copyright 2004 Jon Gettler\r
4 \r
5     This file is part of VOMP.\r
6 \r
7     VOMP is free software; you can redistribute it and/or modify\r
8     it under the terms of the GNU General Public License as published by\r
9     the Free Software Foundation; either version 2 of the License, or\r
10     (at your option) any later version.\r
11 \r
12     VOMP is distributed in the hope that it will be useful,\r
13     but WITHOUT ANY WARRANTY; without even the implied warranty of\r
14     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
15     GNU General Public License for more details.\r
16 \r
17     You should have received a copy of the GNU General Public License\r
18     along with VOMP; if not, write to the Free Software\r
19     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\r
20 */\r
21 \r
22 #ifndef SURFACEDirectFB_H\r
23 #define SURFACEDirectFB_H\r
24 \r
25 #include <stdio.h>\r
26 #include <string.h>\r
27 #include <unistd.h>\r
28 #include <sys/mman.h>\r
29 #include <sys/ioctl.h>\r
30 \r
31 extern "C"\r
32 {\r
33   #include <jpeglib.h>\r
34 }\r
35 \r
36 #include "defines.h"\r
37 #include "surface.h"\r
38 \r
39 #include <directfb.h>\r
40 \r
41 \r
42 \r
43 class SurfaceDirectFB : public Surface\r
44 {\r
45   public:\r
46     SurfaceDirectFB(int id = 0);\r
47     virtual ~SurfaceDirectFB();\r
48 \r
49     int create(UINT width, UINT height);\r
50     void display();\r
51 \r
52     int fillblt(int x, int y, int width, int height, unsigned int rgba);\r
53 \r
54     void drawHorzLine(int x1, int x2, int y, unsigned int c);\r
55     void drawVertLine(int x, int y1, int y2, unsigned int c);\r
56     void drawBitmap(int x, int y, const Bitmap& bm);\r
57     int updateToScreen(int sx, int sy, int w, int h, int dx, int dy);\r
58     void readPixel(int x, int y, unsigned char* r, unsigned char* g, unsigned char* b);\r
59     void screenShot(const char* fileName);\r
60     IDirectFBSurface* getSurfaceDFB(){return surface;};\r
61 \r
62 \r
63     int blt(int fd, unsigned long shandle, int sx, int sy, int width, int height, unsigned long dhandle, int dx, int dy);\r
64 \r
65   private:\r
66     IDirectFBSurface *surface;\r
67 \r
68     void drawPixel(int x, int y, unsigned int c, bool fastdraw=false);\r
69     void drawPixel(int x, int y, Colour& c, bool fastdraw=false);\r
70 \r
71 \r
72 \r
73 };\r
74 \r
75 #endif\r