contrib/oxl/mvl/RawPMatrixStore.h
Go to the documentation of this file.
00001 // This is oxl/mvl/RawPMatrixStore.h
00002 #ifndef RawPMatrixStore_h_
00003 #define RawPMatrixStore_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007 //:
00008 // \file
00009 // \brief Demand-load image sequence from disk
00010 //
00011 //  The RawPMatrixStore provides demand-based access to an image sequence.
00012 //  Individual images are accessed via integer indices, and the class
00013 //  contains a printf-style format specifier to convert indices to
00014 //  filenames.
00015 //
00016 // \author
00017 //     Andrew W. Fitzgibbon, Oxford RRG, 22 Aug 97
00018 //
00019 //-----------------------------------------------------------------------------
00020 
00021 #include <vcl_vector.h>
00022 #include <mvl/FileNameGenerator.h>
00023 #include <mvl/PMatrix_sptr.h>
00024 
00025 class RawPMatrixStore
00026 {
00027  public:
00028   // Constructors/Destructors--------------------------------------------------
00029 
00030   //: Construct a PMatrix store given a FileNameGenerator
00031   RawPMatrixStore(FileNameGenerator const& fng) : fng_(fng) {}
00032 
00033   // Operations----------------------------------------------------------------
00034 
00035   bool Load(int image_index);
00036   bool Save(int i);
00037   PMatrix_sptr Get(int i);
00038 
00039   void AddExtension(char const*);
00040 
00041  protected:
00042 
00043   // Data Members--------------------------------------------------------------
00044   vcl_vector<PMatrix_sptr> pmatrix_;
00045   bool check_index(int i);
00046 
00047   FileNameGenerator fng_;
00048 };
00049 
00050 #endif // RawPMatrixStore_h_