-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathSequence.tcc
More file actions
87 lines (69 loc) · 1.76 KB
/
Sequence.tcc
File metadata and controls
87 lines (69 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
inline std::string Sequence::getFirstFilename() const
{
return getFilenameAt( getFirstTime() );
}
inline std::string Sequence::getLastFilename() const
{
return getFilenameAt( getLastTime() );
}
inline char Sequence::getPatternCharacter() const
{
return getFixedPadding() ? '#' : '@';
}
inline std::string Sequence::getFilenameWithStandardPattern() const
{
return getPrefix() + std::string( getFixedPadding() ? getFixedPadding() : 1, getPatternCharacter() ) + getSuffix();
}
inline std::string Sequence::getFilenameWithPrintfPattern() const
{
std::string paddingStr = "%";
if( getFixedPadding() )
paddingStr += "0" + boost::lexical_cast<std::string>( getFixedPadding() );
paddingStr += "d";
return getPrefix() + paddingStr + getSuffix();
}
inline std::pair<Time, Time> Sequence::getGlobalRange() const
{
return std::pair<Time, Time > ( getFirstTime(), getLastTime() );
}
inline Time Sequence::getFirstTime() const
{
return _ranges.front().first;
}
inline Time Sequence::getLastTime() const
{
return _ranges.back().last;
}
inline std::size_t Sequence::getDuration() const
{
return getLastTime() - getFirstTime() + 1;
}
inline std::size_t Sequence::getFixedPadding() const
{
return _fixedPadding;
}
inline std::size_t Sequence::getMaxPadding() const
{
return _maxPadding;
}
inline bool Sequence::hasMissingFile() const
{
return _ranges.size() != 1 || _ranges.front().step != 1;
}
inline std::size_t Sequence::getNbMissingFiles() const
{
return (( getLastTime() - getFirstTime() ) + 1 ) - getNbFiles();
}
/// @brief filename without frame number
inline std::string Sequence::getIdentification() const
{
return _prefix + _suffix;
}
inline std::string Sequence::getPrefix() const
{
return _prefix;
}
inline std::string Sequence::getSuffix() const
{
return _suffix;
}