roiTracker.h

00001 /* Copyright (c) 2009       Maxim Makhinya
00002  *
00003  * This library is free software; you can redistribute it and/or modify it under
00004  * the terms of the GNU Lesser General Public License version 2.1 as published
00005  * by the Free Software Foundation.
00006  *  
00007  * This library is distributed in the hope that it will be useful, but WITHOUT
00008  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00009  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
00010  * details.
00011  * 
00012  * You should have received a copy of the GNU Lesser General Public License
00013  * along with this library; if not, write to the Free Software Foundation, Inc.,
00014  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00015  */
00016 
00017 #ifndef EQ_ROI_TRACKER_H
00018 #define EQ_ROI_TRACKER_H
00019 
00020 #include <eq/client/pixelViewport.h>
00021 #include <eq/client/types.h>
00022 #include <eq/base/stdExt.h>
00023 
00024 #include <vector>
00025 #include <string>
00026 
00027 
00028 namespace eq
00029 {
00034     class EQ_EXPORT ROITracker
00035     {
00036     public:
00037         ROITracker();
00038         virtual ~ROITracker();
00039 
00061         bool useROIFinder( const PixelViewport&   pvp,
00062                             const uint32_t        stage,
00063                             const uint32_t        frameID,
00064                                   uint8_t*&       ticket );
00065 
00078         void updateDelay( const PixelViewportVector& pvps,
00079                           const uint8_t*             ticket );
00080 
00081     protected:
00082 
00083     private:
00085         struct Area
00086         {
00087             Area( const PixelViewport& pvp_,
00088                         uint32_t       lastSkip_ = 0,
00089                         uint32_t       skip_     = 0 );
00090 
00091             PixelViewport pvp;
00092             uint32_t      lastSkip; 
00093             uint32_t      skip;     
00094         };
00096         struct Stage
00097         {
00098             std::vector< Area > areas;
00099         };
00103         stde::hash_map< uint32_t, Stage >* _curFrame;
00104 
00106         stde::hash_map< uint32_t, Stage >* _prvFrame;
00107 
00108         uint8_t* _ticket; 
00109         bool     _needsUpdate; 
00110         uint32_t _lastFrameID; 
00111         uint32_t _lastStage;   
00112 
00113         bool _returnPositive( uint8_t*& ticket );
00114     };
00115 }
00116 
00117 #endif //EQ_ROI_TRACKER_H
00118 
Generated on Mon Aug 10 18:58:41 2009 for Equalizer 0.9 by  doxygen 1.5.8