orca-robotics


INTRODUCTION
Overview
Download and Install
Documentation

REPOSITORY
Interfaces
Drivers
Libraries
Utilities
Software Map

DEVELOPER
Dashboard

PEOPLE
Contributors
Users

SourceForge.net Logo
Project
Download
Mailing lists

 

         

cameralibdc1394/driver.h

00001 /*
00002  * Orca-Robotics Project: Components for robotics 
00003  *               http://orca-robotics.sf.net/
00004  * Copyright (c) 2004-2008 Tom Burdick, Alex Brooks, Alexei Makarenko, Tobias Kaupp
00005  *
00006  * This distribution is licensed to you under the terms described in
00007  * the LICENSE file included in this distribution.
00008  *
00009  */
00010 
00011 #ifndef HYDRO_CAMERA_OPENCV_H
00012 #define HYDRO_CAMERA_OPENCV_H
00013 
00014 #include <hydrointerfaces/camera.h>
00015 #include <opencv/cv.h>
00016 #include <opencv/highgui.h>
00017 
00018 namespace cameraopencv {
00019 
00020 //
00021 // Bogus image driver, useful for testing the rest of the component.
00022 //
00023 class Driver : public hydrointerfaces::Camera
00024 {
00025 
00026 public:
00027 
00028     Driver( const Config &cfg, const hydroutil::Context &context );
00029     virtual ~Driver();
00030 
00031     // Blocks til new data is available
00032     virtual void read( hydrointerfaces::Camera::Data &data );
00033     
00034     virtual uint32_t availableCameras() { return 10; }
00035     
00036     virtual std::vector<ImageFormat> cameraImageFormats(uint32_t id) { std::vector <ImageFormat> formats; formats.push_back(ImageFormatModeBGR8); return formats; }
00037 
00038 private:
00039 
00040     Camera::Config config_;
00041     hydroutil::Context context_;
00042 
00043     std::vector<CvCapture*> cameras_;
00044     std::vector<IplImage*> frames_;
00045 };
00046 
00047 // Used for dynamically loading driver
00048 class Factory : public hydrointerfaces::CameraFactory
00049 {
00050 public:
00051     hydrointerfaces::Camera *createDriver( 
00052                 const hydrointerfaces::Camera::Config &config,
00053                 const hydroutil::Context &context ) const
00054     {
00055         return new Driver( config, context );
00056     }
00057 };
00058 
00059 } // namespace
00060 
00061 // Used for dynamically loading driver
00062 extern "C" {
00063     hydrointerfaces::CameraFactory *createDriverFactory();
00064 }
00065 
00066 #endif
 

Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)


Generated for Orca Robotics by  doxygen 1.4.5