Go to the documentation of this file.00001
00002 #ifndef vul_sequence_filename_map_h_
00003 #define vul_sequence_filename_map_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <vcl_string.h>
00019 #include <vcl_iosfwd.h>
00020 #include <vcl_vector.h>
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class vul_sequence_filename_map
00039 {
00040 public:
00041 vul_sequence_filename_map ();
00042 vul_sequence_filename_map (vcl_string const & seq_template,
00043 vcl_vector<int> const & indices);
00044 vul_sequence_filename_map (vcl_string const & seq_template,
00045 int start, int end, int step = 1);
00046 vul_sequence_filename_map (vcl_string const & seq_template,
00047 int step = 1);
00048 ~vul_sequence_filename_map ();
00049
00050
00051 vcl_string name(int frame);
00052 vcl_string pair_name(int i, int j);
00053 vcl_string triplet_name(int i, int j, int k);
00054
00055 vcl_string image_name(int frame)
00056 { return image_dir_ + name(frame) + image_extension_; }
00057
00058
00059 vcl_string get_image_dir() const { return image_dir_; }
00060
00061
00062 vcl_string get_image_extension() const { return image_extension_; }
00063
00064
00065 vcl_string get_base_name() const { return basename_; }
00066
00067
00068 int get_real_index(int frame) const { return indices_[frame]; }
00069 vcl_vector<int> const& get_real_indices() const { return indices_; }
00070
00071
00072 int get_mapped_index(int real) const;
00073
00074 int get_nviews() const { return int(indices_.size()); }
00075
00076
00077
00078 vcl_ostream& print(vcl_ostream& s) const;
00079
00080 protected:
00081 bool filter_dirent(char const* name, vcl_string const& extension);
00082 int extract_index(char const* name);
00083
00084 vcl_string seq_template_;
00085 vcl_vector<int> indices_;
00086 vcl_string basename_;
00087 vcl_string index_format_;
00088 vcl_string image_dir_;
00089 vcl_string image_extension_;
00090 int start_;
00091 int step_;
00092 int end_;
00093
00094 void parse();
00095 };
00096
00097 vcl_ostream& operator<<(vcl_ostream &os, const vul_sequence_filename_map& s);
00098
00099 #endif // vul_sequence_filename_map_h_