Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

FilterBankEvent.h

Go to the documentation of this file.
00001 //-*-c++-*-
00002 #ifndef INCLUDED_FilterBankEvent_h_
00003 #define INCLUDED_FilterBankEvent_h_
00004 
00005 #include "Events/EventBase.h"
00006 #include "Vision/FilterBankGenerator.h"
00007 
00008 //! This event gives access to a set of image channels at different resolutions, see FilterBankGenerator
00009 class FilterBankEvent : public EventBase {
00010 public:
00011   //! constructor
00012   FilterBankEvent(FilterBankGenerator* creator,EventBase::EventGeneratorID_t gid,unsigned int sid,EventBase::EventTypeID_t tid)
00013     : EventBase(gid,sid,tid,0,creator->getName()), src(creator)
00014   {}
00015 
00016   //! copy constructor (shallow copy -- the generator shouldn't be going anywhere)
00017   FilterBankEvent(const FilterBankEvent& fbk) : EventBase(fbk), src(fbk.src) {}
00018   
00019   //! assignment operator  (shallow copy -- the generator shouldn't be going anywhere)
00020   const FilterBankEvent& operator=(const FilterBankEvent& fbk) { EventBase::operator=(fbk); src=fbk.src; return *this; }
00021 
00022   virtual EventBase* clone() const { return new FilterBankEvent(*this); }
00023 
00024   //don't do this until we actually override the LoadSave interface
00025   //virtual unsigned int getClassTypeID() const { return makeClassTypeID("FBKE"); }
00026 
00027   //! Gives access to underlying generator
00028   inline FilterBankGenerator* getSource() const { return src; }
00029 
00030   //! returns the number of image layers (e.g. different resolutions available)
00031   inline unsigned int getNumLayers() const { return src->getNumLayers(); }
00032 
00033   //! returns the number of channels per image (e.g. Y, U, or V components)
00034   inline unsigned int getNumChannels() const { return src->getNumChannels(); }
00035 
00036   //! returns pointer to the beginning of the image data for the specified layer and channel
00037   /*! this will cause the data to be calculated and cached if it's not already available */
00038   inline unsigned char * getImage(unsigned int layer, unsigned int channel) const { return src->getImage(layer,channel); }
00039 
00040   //! returns width of the image in a given layer
00041   inline unsigned int getWidth(unsigned int layer) const { return src->getWidth(layer); }
00042   //! returns height of the image in a given layer
00043   inline unsigned int getHeight(unsigned int layer) const { return src->getHeight(layer); }
00044   //! returns the bytes to skip from the one-past-end of a row to get the beginning of the next
00045   inline unsigned int getSkip(unsigned int layer) const { return src->getSkip(layer); }
00046   //! returns the bytes to skip from the beginning of one row to get the beginning of the next
00047   /*! This is just for convenience; the stride is just the skip plus the width, but it's precomputed for you for speed and clarity */
00048   inline unsigned int getStride(unsigned int layer) const { return src->getStride(layer); }
00049   //! returns the increment to use to go from one sample to the next
00050   inline unsigned int getIncrement(unsigned int layer) const { return src->getIncrement(layer); }
00051 
00052   //! returns the frame number, see FilterBankGenerator::frameNumber
00053   inline unsigned int getFrameNumber() const { return src->getFrameNumber(); }
00054   //! returns the number of frames processed by the generator, see FilterBankGenerator::framesProcessed
00055   inline unsigned int getFramesProcessed() const { return src->getFramesProcessed(); }
00056   
00057 protected:
00058   //! pointer to generator which created this event
00059   /*! the generator holds all the actual image data to be more memory efficient */
00060   FilterBankGenerator* src;
00061 
00062 private:
00063 };
00064 
00065 /*! @file 
00066  * @brief Defines FilterBankEvent, an event for distributing raw image data
00067  * @author ejt (Creator)
00068  *
00069  * $Author: ejt $
00070  * $Name: tekkotsu-2_4_1 $
00071  * $Revision: 1.11 $
00072  * $State: Exp $
00073  * $Date: 2005/06/29 22:03:35 $
00074  */
00075 
00076 #endif

Tekkotsu v2.4.1
Generated Tue Aug 16 16:32:47 2005 by Doxygen 1.4.4