Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / BilatTools_OpenCV / src / core / capture / header / Capture_A.h
1 #ifndef CAPTURE_A_H_
2 #define CAPTURE_A_H_
3
4 #include <string>
5
6 #include <opencv.hpp>
7 #include <highgui.hpp>
8
9 #include "Chronos.h"
10 #include "cudaType.h"
11
12 using namespace cv;
13
14 /*----------------------------------------------------------------------*\
15 |* Declaration *|
16 \*---------------------------------------------------------------------*/
17
18 /*--------------------------------------*\
19 |* Public *|
20 \*-------------------------------------*/
21
22 /**
23 * http://opencv.willowgarage.com/wiki/VideoCodecs
24 */
25 class Capture_A
26 {
27 /*--------------------------------------*\
28 |* Constructor *|
29 \*-------------------------------------*/
30
31 public:
32
33 Capture_A(VideoCapture* ptrCaptureStream,const string& title, uchar4* ptrHostMemory=NULL);
34 virtual ~Capture_A(void);
35
36 /*--------------------------------------*\
37 |* Methodes *|
38 \*-------------------------------------*/
39
40 public:
41
42 VideoCapture* getVideoCapture(void);
43 int getW(void);
44 int getH(void);
45 string getTitle(void);
46 Chronos getChronos(void);
47 int fpsCapture(void);
48
49 bool isOpened(void);
50 int nbOctetImage(void);
51 long nbCapture(void);
52
53 virtual void printInfo(void);
54
55 /**
56 * Temps a attendre entre 2 captures pour respecter fps original
57 */
58 virtual int dtOriginalMS(void);
59
60 /**
61 * To be call periodicly to obtain image
62 * Type pas RVBA, mais BVRA
63 */
64 Mat capturer(void);
65
66 // Tools
67 static uchar4* castToUChar4(uchar* ptrTab);
68 static uchar4* castToUChar4(Mat* ptrMap);
69
70 protected:
71
72 virtual void readStream(VideoCapture* ptrCaptureStream, Mat* ptrMatCaptureSrc)=0;
73
74 private:
75
76
77 /*--------------------------------------*\
78 |* Attributs *|
79 \*-------------------------------------*/
80
81 private:
82
83 // Inputs
84 string title;
85
86
87 // Tools
88 Mat matCaptureSrc;
89
90 // Outputs
91 float w;
92 int h;
93 Mat matCaptureDest;
94 long compteurCapture;
95 Chronos chrono;
96
97 protected:
98 VideoCapture* ptrCaptureStream;
99 };
100
101 #endif
102
103 /*----------------------------------------------------------------------*\
104 |* End *|
105 \*---------------------------------------------------------------------*/