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

SourceForge.net Logo
Project
Download
Mailing lists

 

         

hydrodrivers/hydroimagecvcamera/driver.h

00001 /*
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  *
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_IMAGE_CVCAMERA_H
00012 #define HYDRO_IMAGE_CVCAMERA_H
00013 
00014 #include <hydrointerfaces/image.h>
00015 #include <cv.h>
00016 #include <highgui.h>
00017 
00018 namespace imagecvcamera {
00019 
00020 //
00021 // OpenCV camera driver
00022 //
00023 class Driver : public hydrointerfaces::Image
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::Image::Data &data );
00033 
00034 private:
00035 
00036     // set the frame width and height
00037     void setWidthAndHeight(int width, int height);
00038     
00039     Image::Config config_;
00040     hydroutil::Context context_;
00041 
00042     // opencv structures
00043     CvCapture* camera_;
00044     IplImage* frame_;
00045 };
00046 
00047 // Used for dynamically loading driver
00048 class Factory : public hydrointerfaces::ImageFactory
00049 {
00050 public:
00051     hydrointerfaces::Image *createDriver( 
00052                 hydrointerfaces::Image::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::ImageFactory *createImageDriverFactory();
00064 }
00065 
00066 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5