INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
hydrodrivers/hydromultiimagecvcamera/driver.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2009 Tom Burdick, Alex Brooks, Alexei Makarenko, Tobias Kaupp, 00005 * Ben Upcroft 00006 * 00007 * This distribution is licensed to you under the terms described in 00008 * the LICENSE file included in this distribution. 00009 * 00010 */ 00011 00012 #ifndef HYDRO_MULTIIMAGE_CVCAMERA_H 00013 #define HYDRO_MULTIIMAGE_CVCAMERA_H 00014 00015 #include <hydrointerfaces/multiimage.h> 00016 #include <cv.h> 00017 #include <highgui.h> 00018 00019 namespace multiimagecvcamera { 00020 00021 // 00022 // OpenCV camera driver 00023 // 00024 class Driver : public hydrointerfaces::MultiImage 00025 { 00026 00027 public: 00028 00029 Driver( const Config& cfg, const hydroutil::Context &context ); 00030 virtual ~Driver(); 00031 00032 // Blocks until new data is available 00033 virtual void read( hydrointerfaces::MultiImage::Data& data ); 00034 00035 private: 00036 00037 // set the frame width and height 00038 void setWidthAndHeight(int width, int height, int cameraNumber ); 00039 00040 MultiImage::Config config_; 00041 hydroutil::Context context_; 00042 00043 // opencv structures 00044 // CvCapture* camera_; 00045 std::vector<CvCapture*> cameras_; 00046 std::vector<IplImage*> frames_; 00047 }; 00048 00049 // Used for dynamically loading driver 00050 class Factory : public hydrointerfaces::MultiImageFactory 00051 { 00052 public: 00053 hydrointerfaces::MultiImage *createDriver( 00054 hydrointerfaces::MultiImage::Config &config, 00055 const hydroutil::Context &context ) const 00056 { 00057 return new Driver( config, context ); 00058 } 00059 }; 00060 00061 } // namespace 00062 00063 // Used for dynamically loading driver 00064 extern "C" { 00065 hydrointerfaces::MultiImageFactory *createMultiImageDriverFactory(); 00066 } 00067 00068 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)