Fawkes API Fawkes Development Version
|
00001 00002 /*************************************************************************** 00003 * retriever_thread.h - FireVision Retriever Thread 00004 * 00005 * Created: Tue Jun 26 17:37:38 2007 00006 * Copyright 2006-2007 Tim Niemueller [www.niemueller.de] 00007 * 00008 ****************************************************************************/ 00009 00010 /* This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU Library General Public License for more details. 00019 * 00020 * Read the full text in the LICENSE.GPL file in the doc directory. 00021 */ 00022 00023 #ifndef __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_ 00024 #define __FIREVISION_APPS_RETRIEVER_RETRIEVER_THREAD_H_ 00025 00026 #include <core/threading/thread.h> 00027 00028 #include <aspect/configurable.h> 00029 #include <aspect/logging.h> 00030 #include <aspect/vision.h> 00031 00032 namespace fawkes { 00033 class TimeTracker; 00034 } 00035 namespace firevision { 00036 class Camera; 00037 class SharedMemoryImageBuffer; 00038 class SeqWriter; 00039 class ColorModelLookupTable; 00040 } 00041 00042 class FvRetrieverThread 00043 : public fawkes::Thread, 00044 public fawkes::ConfigurableAspect, 00045 public fawkes::LoggingAspect, 00046 public fawkes::VisionAspect 00047 { 00048 public: 00049 FvRetrieverThread(const char *camera_string, const char *id); 00050 virtual ~FvRetrieverThread(); 00051 00052 virtual void init(); 00053 virtual void finalize(); 00054 virtual void loop(); 00055 00056 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */ 00057 protected: virtual void run() { Thread::run(); } 00058 00059 private: 00060 char *__id; 00061 char *__camera_string; 00062 00063 firevision::Camera *cam; 00064 firevision::SharedMemoryImageBuffer *shm; 00065 firevision::SeqWriter *seq_writer; 00066 fawkes::TimeTracker *__tt; 00067 unsigned int __loop_count; 00068 unsigned int __ttc_capture; 00069 unsigned int __ttc_memcpy; 00070 unsigned int __ttc_dispose; 00071 bool __cam_has_timestamp_support; 00072 00073 firevision::ColorModelLookupTable *__cm; 00074 }; 00075 00076 00077 #endif