Panda3D
|
00001 // Filename: webcamVideo.h 00002 // Created by: jyelon (01Nov2007) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef WEBCAMVIDEO_H 00016 #define WEBCAMVIDEO_H 00017 00018 #include "movieVideo.h" 00019 00020 //////////////////////////////////////////////////////////////////// 00021 // Class : WebcamVideo 00022 // Description : Allows you to open a webcam or other video capture 00023 // device as a video stream. 00024 //////////////////////////////////////////////////////////////////// 00025 class EXPCL_VISION WebcamVideo : public MovieVideo { 00026 00027 PUBLISHED: 00028 virtual ~WebcamVideo(); 00029 00030 static int get_num_options(); 00031 static PT(WebcamVideo) get_option(int n); 00032 MAKE_SEQ(get_options, get_num_options, get_option); 00033 00034 INLINE int get_size_x() const; 00035 INLINE int get_size_y() const; 00036 INLINE int get_fps() const; 00037 00038 virtual PT(MovieVideoCursor) open() = 0; 00039 00040 INLINE void output(ostream &out) const; 00041 00042 public: 00043 static void find_all_webcams(); 00044 00045 protected: 00046 int _size_x; 00047 int _size_y; 00048 int _fps; 00049 00050 static pvector<PT(WebcamVideo)> _all_webcams; 00051 00052 public: 00053 static TypeHandle get_class_type() { 00054 return _type_handle; 00055 } 00056 static void init_type() { 00057 MovieVideo::init_type(); 00058 register_type(_type_handle, "WebcamVideo", 00059 MovieVideo::get_class_type()); 00060 } 00061 virtual TypeHandle get_type() const { 00062 return get_class_type(); 00063 } 00064 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00065 00066 private: 00067 static TypeHandle _type_handle; 00068 }; 00069 00070 INLINE ostream &operator << (ostream &out, const WebcamVideo &n); 00071 00072 #include "webcamVideo.I" 00073 00074 #endif