00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WEBCAMVIDEOCURSOROPENCV_H
00016 #define WEBCAMVIDEOCURSOROPENCV_H
00017
00018 #include "pandabase.h"
00019
00020 #ifdef HAVE_OPENCV
00021
00022 #include "webcamVideo.h"
00023
00024 class WebcamVideoOpenCV;
00025
00026
00027
00028
00029
00030 class WebcamVideoCursorOpenCV : public MovieVideoCursor {
00031 public:
00032 WebcamVideoCursorOpenCV(WebcamVideoOpenCV *src);
00033 virtual ~WebcamVideoCursorOpenCV();
00034 virtual PT(Buffer) fetch_buffer();
00035
00036 private:
00037 bool get_frame_data(const unsigned char *&r,
00038 const unsigned char *&g,
00039 const unsigned char *&b,
00040 int &x_pitch, int &y_pitch);
00041
00042 CvCapture *_capture;
00043
00044 public:
00045 static TypeHandle get_class_type() {
00046 return _type_handle;
00047 }
00048 static void init_type() {
00049 MovieVideoCursor::init_type();
00050 register_type(_type_handle, "WebcamVideoCursorOpenCV",
00051 MovieVideoCursor::get_class_type());
00052 }
00053 virtual TypeHandle get_type() const {
00054 return get_class_type();
00055 }
00056 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00057
00058 private:
00059 static TypeHandle _type_handle;
00060 };
00061
00062 #endif // HAVE_OPENCV
00063
00064 #endif