Homepage Demos Overview Downloads Tutorials Reference
Credits

RawCamBehavior.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_RawCamBehavior_h_
00003 #define INCLUDED_RawCamBehavior_h_
00004 
00005 #include "Behaviors/BehaviorBase.h"
00006 
00007 class Socket;
00008 class FilterBankGenerator;
00009 class FilterBankEvent;
00010 
00011 //! Forwards images from camera over wireless
00012 class RawCamBehavior : public BehaviorBase {
00013 public:
00014   //! constructor
00015   RawCamBehavior();
00016 
00017   static const unsigned int WIRELESS_BUFFER_SIZE=200000; //!< 200000 bytes for use up to 416x320 + 2*208x160 (double res Y, full res UV on ERS-7)
00018 
00019   virtual void DoStart();
00020 
00021   virtual void DoStop();
00022 
00023   virtual void processEvent(const EventBase& e);
00024 
00025   virtual std::string getName() const { return "RawCamServer"; }
00026 
00027   static std::string getClassDescription() { return "Forwards images from camera over wireless"; }
00028   
00029 protected:
00030   bool openPacket(FilterBankGenerator& fbkgen, unsigned int time, unsigned int layer); //!< opens a new packet, writes header info; returns true if open, false if otherwise open (check cur==NULL for error)
00031   bool writeColor(const FilterBankEvent& fbke); //!< writes a color image
00032   bool writeSingleChannel(const FilterBankEvent& fbke); //!< writes a single channel
00033   void closePacket(); //!< closes and sends a packet, does nothing if no packet open
00034 
00035   Socket * visRaw; //!< socket for sending the image stream
00036   char * packet; //!< point to the current buffer being prepared to be sent
00037   char * cur; //!< current location within that buffer
00038   unsigned int avail; //!< the number of bytes remaining in the buffer
00039 
00040 private:
00041   RawCamBehavior(const RawCamBehavior&); //!< don't call
00042   RawCamBehavior& operator=(const RawCamBehavior&); //!< don't call
00043 };
00044 
00045 /*! @file
00046  * @brief Describes RawCamBehavior, which forwards images from camera over wireless
00047  * @author ejt (Creator)
00048  *
00049  * $Author: ejt $
00050  * $Name: tekkotsu-2_0 $
00051  * $Revision: 1.6 $
00052  * $State: Exp $
00053  * $Date: 2004/01/18 10:16:57 $
00054  */
00055 
00056 #endif

Tekkotsu v2.0
Generated Wed Jan 21 03:20:29 2004 by Doxygen 1.3.4