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/hydroimagefile/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_FILE_H 00012 #define HYDRO_IMAGE_FILE_H 00013 00014 #include <vector> 00015 #include <string> 00016 00017 #include <hydrointerfaces/image.h> 00018 00019 #include <QImage> 00020 00021 namespace imagefile { 00022 00023 // 00024 // Bogus image driver that reads from a file, useful for testing the rest of the component. 00025 // 00026 class Driver : public hydrointerfaces::Image 00027 { 00028 00029 public: 00030 00031 Driver( Config &cfg, const hydroutil::Context &context ); 00032 virtual ~Driver(); 00033 00034 // Blocks till new data is available 00035 virtual void read( hydrointerfaces::Image::Data &data ); 00036 00037 private: 00038 00039 Image::Config config_; 00040 hydroutil::Context context_; 00041 std::string filename_; 00042 QImage image_; 00043 }; 00044 00045 // Used for dynamically loading driver 00046 class Factory : public hydrointerfaces::ImageFactory 00047 { 00048 public: 00049 hydrointerfaces::Image *createDriver( 00050 hydrointerfaces::Image::Config &config, 00051 const hydroutil::Context &context ) const 00052 { 00053 return new Driver( config, context ); 00054 } 00055 }; 00056 00057 } // namespace 00058 00059 // Used for dynamically loading driver 00060 extern "C" { 00061 hydrointerfaces::ImageFactory *createImageDriverFactory(); 00062 } 00063 00064 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)