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