Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vul_sequence_filename_map Class Reference

Maps sequence frame indices to filenames. More...

#include <vul_sequence_filename_map.h>

Public Member Functions

 vul_sequence_filename_map ()
 
 vul_sequence_filename_map (std::string seq_template, std::vector< int > indices)
 
 vul_sequence_filename_map (std::string seq_template, int start, int end, int step=1)
 
 vul_sequence_filename_map (std::string seq_template, int step=1)
 
 ~vul_sequence_filename_map ()
 
std::string name (int frame)
 returns frame name with no extension, e.g. "img.003", "img.003.004". More...
 
std::string pair_name (int i, int j)
 
std::string triplet_name (int i, int j, int k)
 
std::string image_name (int frame)
 
std::string get_image_dir () const
 returns the image directory e.g. "pgm/". More...
 
std::string get_image_extension () const
 returns the image extension e.g. ".pgm". More...
 
std::string get_base_name () const
 returns the base name e.h. "img.". More...
 
int get_real_index (int frame) const
 returns the actually on-disk index corresponding to frame N. More...
 
std::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. More...
 
int get_nviews () const
 
std::ostream & print (std::ostream &s) const
 pretty print. More...
 

Protected Member Functions

bool filter_dirent (char const *name, std::string const &extension)
 
int extract_index (char const *name)
 
void parse ()
 

Protected Attributes

std::string seq_template_
 
std::vector< int > indices_
 
std::string basename_
 
std::string index_format_
 
std::string image_dir_
 
std::string image_extension_
 
int start_
 
int step_
 
int end_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ vul_sequence_filename_map() [1/4]

vul_sequence_filename_map::vul_sequence_filename_map ( )

Definition at line 42 of file vul_sequence_filename_map.cxx.

◆ vul_sequence_filename_map() [2/4]

vul_sequence_filename_map::vul_sequence_filename_map ( std::string  seq_template,
std::vector< int >  indices 
)

Definition at line 47 of file vul_sequence_filename_map.cxx.

◆ vul_sequence_filename_map() [3/4]

vul_sequence_filename_map::vul_sequence_filename_map ( std::string  seq_template,
int  start,
int  end,
int  step = 1 
)

Definition at line 53 of file vul_sequence_filename_map.cxx.

◆ vul_sequence_filename_map() [4/4]

vul_sequence_filename_map::vul_sequence_filename_map ( std::string  seq_template,
int  step = 1 
)

Definition at line 61 of file vul_sequence_filename_map.cxx.

◆ ~vul_sequence_filename_map()

vul_sequence_filename_map::~vul_sequence_filename_map ( )
default

Member Function Documentation

◆ extract_index()

int vul_sequence_filename_map::extract_index ( char const *  name)
protected

Definition at line 344 of file vul_sequence_filename_map.cxx.

◆ filter_dirent()

bool vul_sequence_filename_map::filter_dirent ( char const *  name,
std::string const &  extension 
)
protected

Definition at line 330 of file vul_sequence_filename_map.cxx.

◆ get_base_name()

std::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.

◆ get_image_dir()

std::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.

◆ get_image_extension()

std::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.

◆ get_mapped_index()

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 304 of file vul_sequence_filename_map.cxx.

◆ get_nviews()

int vul_sequence_filename_map::get_nviews ( ) const
inline

Definition at line 74 of file vul_sequence_filename_map.h.

◆ get_real_index()

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.

◆ get_real_indices()

std::vector<int> const& vul_sequence_filename_map::get_real_indices ( ) const
inline

Definition at line 69 of file vul_sequence_filename_map.h.

◆ image_name()

std::string vul_sequence_filename_map::image_name ( int  frame)
inline

Definition at line 55 of file vul_sequence_filename_map.h.

◆ name()

std::string vul_sequence_filename_map::name ( int  frame)

returns frame name with no extension, e.g. "img.003", "img.003.004".

Definition at line 69 of file vul_sequence_filename_map.cxx.

◆ pair_name()

std::string vul_sequence_filename_map::pair_name ( int  i,
int  j 
)

Definition at line 75 of file vul_sequence_filename_map.cxx.

◆ parse()

void vul_sequence_filename_map::parse ( )
protected

Definition at line 89 of file vul_sequence_filename_map.cxx.

◆ print()

std::ostream & vul_sequence_filename_map::print ( std::ostream &  s) const

pretty print.

Definition at line 316 of file vul_sequence_filename_map.cxx.

◆ triplet_name()

std::string vul_sequence_filename_map::triplet_name ( int  i,
int  j,
int  k 
)

Definition at line 81 of file vul_sequence_filename_map.cxx.

Member Data Documentation

◆ basename_

std::string vul_sequence_filename_map::basename_
protected

Definition at line 86 of file vul_sequence_filename_map.h.

◆ end_

int vul_sequence_filename_map::end_
protected

Definition at line 92 of file vul_sequence_filename_map.h.

◆ image_dir_

std::string vul_sequence_filename_map::image_dir_
protected

Definition at line 88 of file vul_sequence_filename_map.h.

◆ image_extension_

std::string vul_sequence_filename_map::image_extension_
protected

Definition at line 89 of file vul_sequence_filename_map.h.

◆ index_format_

std::string vul_sequence_filename_map::index_format_
protected

Definition at line 87 of file vul_sequence_filename_map.h.

◆ indices_

std::vector<int> vul_sequence_filename_map::indices_
protected

Definition at line 85 of file vul_sequence_filename_map.h.

◆ seq_template_

std::string vul_sequence_filename_map::seq_template_
protected

Definition at line 84 of file vul_sequence_filename_map.h.

◆ start_

int vul_sequence_filename_map::start_
protected

Definition at line 90 of file vul_sequence_filename_map.h.

◆ step_

int vul_sequence_filename_map::step_
protected

Definition at line 91 of file vul_sequence_filename_map.h.


The documentation for this class was generated from the following files: