Maps sequence frame indices to filenames. More...
#include <vul_sequence_filename_map.h>
Public Member Functions | |
vul_sequence_filename_map () | |
vul_sequence_filename_map (vcl_string const &seq_template, vcl_vector< int > const &indices) | |
vul_sequence_filename_map (vcl_string const &seq_template, int start, int end, int step=1) | |
vul_sequence_filename_map (vcl_string const &seq_template, int step=1) | |
~vul_sequence_filename_map () | |
vcl_string | name (int frame) |
returns frame name with no extension, e.g. "img.003", "img.003.004". | |
vcl_string | pair_name (int i, int j) |
vcl_string | triplet_name (int i, int j, int k) |
vcl_string | image_name (int frame) |
vcl_string | get_image_dir () const |
returns the image directory e.g. "pgm/". | |
vcl_string | get_image_extension () const |
returns the image extension e.g. ".pgm". | |
vcl_string | get_base_name () const |
returns the base name e.h. "img.". | |
int | get_real_index (int frame) const |
returns the actually on-disk index corresponding to frame N. | |
vcl_vector< int > const & | get_real_indices () const |
int | get_mapped_index (int real) const |
returns the frame number corresp. to on-disk index N, or -1 if out-of-range. | |
int | get_nviews () const |
vcl_ostream & | print (vcl_ostream &s) const |
pretty print. | |
Protected Member Functions | |
bool | filter_dirent (char const *name, vcl_string const &extension) |
int | extract_index (char const *name) |
void | parse () |
Protected Attributes | |
vcl_string | seq_template_ |
vcl_vector< int > | indices_ |
vcl_string | basename_ |
vcl_string | index_format_ |
vcl_string | image_dir_ |
vcl_string | image_extension_ |
int | start_ |
int | step_ |
int | end_ |
Maps sequence frame indices to filenames.
vul_sequence_filename_map maps sequence frame indices to filenames. It also performs some disk probing functions to discover the image extension, directories and sequence template if not specified by the user.
The template can have any of the following forms : "pgm/img.%03d.pgm,0:5:100", "pgm/img.####.pgm", "img.###.pgm", "img.###,5:1:20", "img.%02d,:5:" (you get the idea..) If the image directory and/or filename extension are not specified they are automagically determined by probing the current directory for likely candidates.
The vector of indices specifies the mapping from sequence frame-index to filename-index. If not specified, the image directory is probed to determine the sequence start/end frames.
Definition at line 38 of file vul_sequence_filename_map.h.
vul_sequence_filename_map::vul_sequence_filename_map | ( | ) |
Definition at line 41 of file vul_sequence_filename_map.cxx.
vul_sequence_filename_map::vul_sequence_filename_map | ( | vcl_string const & | seq_template, |
vcl_vector< int > const & | indices | ||
) |
Definition at line 46 of file vul_sequence_filename_map.cxx.
vul_sequence_filename_map::vul_sequence_filename_map | ( | vcl_string const & | seq_template, |
int | start, | ||
int | end, | ||
int | step = 1 |
||
) |
Definition at line 52 of file vul_sequence_filename_map.cxx.
vul_sequence_filename_map::vul_sequence_filename_map | ( | vcl_string const & | seq_template, |
int | step = 1 |
||
) |
Definition at line 60 of file vul_sequence_filename_map.cxx.
vul_sequence_filename_map::~vul_sequence_filename_map | ( | ) |
Definition at line 66 of file vul_sequence_filename_map.cxx.
int vul_sequence_filename_map::extract_index | ( | char const * | name | ) | [protected] |
Definition at line 345 of file vul_sequence_filename_map.cxx.
bool vul_sequence_filename_map::filter_dirent | ( | char const * | name, |
vcl_string const & | extension | ||
) | [protected] |
Definition at line 331 of file vul_sequence_filename_map.cxx.
vcl_string vul_sequence_filename_map::get_base_name | ( | ) | const [inline] |
returns the base name e.h. "img.".
Definition at line 65 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::get_image_dir | ( | ) | const [inline] |
returns the image directory e.g. "pgm/".
Definition at line 59 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::get_image_extension | ( | ) | const [inline] |
returns the image extension e.g. ".pgm".
Definition at line 62 of file vul_sequence_filename_map.h.
int vul_sequence_filename_map::get_mapped_index | ( | int | real | ) | const |
returns the frame number corresp. to on-disk index N, or -1 if out-of-range.
Definition at line 305 of file vul_sequence_filename_map.cxx.
int vul_sequence_filename_map::get_nviews | ( | ) | const [inline] |
Definition at line 74 of file vul_sequence_filename_map.h.
int vul_sequence_filename_map::get_real_index | ( | int | frame | ) | const [inline] |
returns the actually on-disk index corresponding to frame N.
Definition at line 68 of file vul_sequence_filename_map.h.
vcl_vector<int> const& vul_sequence_filename_map::get_real_indices | ( | ) | const [inline] |
Definition at line 69 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::image_name | ( | int | frame | ) | [inline] |
Definition at line 55 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::name | ( | int | frame | ) |
returns frame name with no extension, e.g. "img.003", "img.003.004".
Definition at line 70 of file vul_sequence_filename_map.cxx.
vcl_string vul_sequence_filename_map::pair_name | ( | int | i, |
int | j | ||
) |
Definition at line 76 of file vul_sequence_filename_map.cxx.
void vul_sequence_filename_map::parse | ( | ) | [protected] |
Definition at line 90 of file vul_sequence_filename_map.cxx.
vcl_ostream & vul_sequence_filename_map::print | ( | vcl_ostream & | s | ) | const |
pretty print.
Definition at line 317 of file vul_sequence_filename_map.cxx.
vcl_string vul_sequence_filename_map::triplet_name | ( | int | i, |
int | j, | ||
int | k | ||
) |
Definition at line 82 of file vul_sequence_filename_map.cxx.
vcl_string vul_sequence_filename_map::basename_ [protected] |
Definition at line 86 of file vul_sequence_filename_map.h.
int vul_sequence_filename_map::end_ [protected] |
Definition at line 92 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::image_dir_ [protected] |
Definition at line 88 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::image_extension_ [protected] |
Definition at line 89 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::index_format_ [protected] |
Definition at line 87 of file vul_sequence_filename_map.h.
vcl_vector<int> vul_sequence_filename_map::indices_ [protected] |
Definition at line 85 of file vul_sequence_filename_map.h.
vcl_string vul_sequence_filename_map::seq_template_ [protected] |
Definition at line 84 of file vul_sequence_filename_map.h.
int vul_sequence_filename_map::start_ [protected] |
Definition at line 90 of file vul_sequence_filename_map.h.
int vul_sequence_filename_map::step_ [protected] |
Definition at line 91 of file vul_sequence_filename_map.h.