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/hydroimagefake/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 * 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_FAKE_H 00012 #define HYDRO_IMAGE_FAKE_H 00013 00014 #include <hydrointerfaces/image.h> 00015 00016 namespace imagefake { 00017 00018 // 00019 // Bogus image driver, useful for testing the rest of the component. 00020 // 00021 class Driver : public hydrointerfaces::Image 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::Image::Data &data ); 00031 00032 private: 00033 enum Mode { 00034 Noise, 00035 Smooth 00036 }; 00037 Mode mode_; 00038 // alexm: I'm not actually sure what this value is 00039 unsigned char prevIntensity_; 00040 Image::Config config_; 00041 hydroutil::Context context_; 00042 }; 00043 00044 // Used for dynamically loading driver 00045 class Factory : public hydrointerfaces::ImageFactory 00046 { 00047 public: 00048 hydrointerfaces::Image *createDriver( 00049 hydrointerfaces::Image::Config &config, 00050 const hydroutil::Context &context ) const 00051 { 00052 return new Driver( config, context ); 00053 } 00054 }; 00055 00056 } // namespace 00057 00058 // Used for dynamically loading driver 00059 extern "C" { 00060 hydrointerfaces::ImageFactory *createImageDriverFactory(); 00061 } 00062 00063 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)