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

 

         

camerafake/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_FAKE_H
00012 #define HYDRO_CAMERA_FAKE_H
00013 
00014 #include <hydrointerfaces/camera.h>
00015 
00016 namespace camerafake {
00017 
00018 //
00019 // Bogus image driver, useful for testing the rest of the component.
00020 //
00021 class Driver : public hydrointerfaces::Camera
00022 {
00023 
00024 public:
00025 
00026     Driver( const Config &cfg, const hydroutil::Context &context );
00027     virtual ~Driver();
00028 
00029     // Blocks till new data is available
00030     virtual void read( hydrointerfaces::Camera::Data &data );
00031     
00032     virtual uint32_t availableCameras() { return 10; }
00033     
00034     virtual std::vector<hydroimage::ImageFormat> cameraImageFormats(uint32_t id) { std::vector <hydroimage::ImageFormat> formats; formats.push_back(hydroimage::ImageFormatModeBGR8); return formats; }
00035 
00036 private:
00037 
00038     Camera::Config config_;
00039     hydroutil::Context context_;
00040 };
00041 
00042 // Used for dynamically loading driver
00043 class Factory : public hydrointerfaces::CameraFactory
00044 {
00045 public:
00046     hydrointerfaces::Camera *createDriver( 
00047                 const hydrointerfaces::Camera::Config &config,
00048                 const hydroutil::Context &context ) const
00049     {
00050         return new Driver( config, context );
00051     }
00052 };
00053 
00054 } // namespace
00055 
00056 // Used for dynamically loading driver
00057 extern "C" {
00058     hydrointerfaces::CameraFactory *createDriverFactory();
00059 }
00060 
00061 #endif
 

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


Generated for Orca Robotics by  doxygen 1.4.5