32namespace PTScriptParsing {
39 int len = line.size();
40 for (
int i=1;
i < len;
i++) {
41 if (line[
i-1] ==
' ' && line[
i] !=
' ') {
58 size_t end = line.find(
'"',
i);
59 if (end == std::string::npos) {
67 size_t end = line.find_first_of(
" \t\n",
i);
80 size_t end = line.find(
'"',
i);
81 if (end == std::string::npos) {
91 size_t end = line.find_first_of(
" \t\n",
i);
92 if (end == std::string::npos) {
107 std::string::size_type p;
108 if ((p=line.find(std::string(
" ") +
parameter)) == std::string::npos) {
110 <<
" in line: " << line);
114 std::string::size_type p2 = line.find(
' ',p);
115 output = line.substr(p, p2-p);
122 std::string::size_type p;
123 if ((p=line.find(std::string(
" ") +
parameter +
"\"")) == std::string::npos) {
125 <<
" in line: " << line);
129 std::string::size_type e = line.find(
"\"",p);
131 output = line.substr(p,e-p);
138 std::string::size_type p;
139 if ((p=line.find(std::string(
" ") +
parameter +
":")) == std::string::npos) {
141 <<
" in line: " << line);
145 std::string::size_type e = line.find(
" ",p);
147 output = line.substr(p,e-p);
163 const std::string & line,
const std::string & var)
217const char *
ImgInfo::varnames[] = {
"v",
"a",
"b",
"c",
"d",
"e",
"g",
"t",
"r",
"p",
"y",
"j",
"TrX",
"TrY",
"TrZ",
"Tpy",
"Tpp",
218 "Va",
"Vb",
"Vc",
"Vd",
"Vx",
"Vy",
220 "Ra",
"Rb",
"Rc",
"Rd",
"Re", 0};
222double ImgInfo::defaultValues[] = {51.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
223 1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
225 0.0, 0.0, 0.0, 0.0, 0.0};
283 int left, right, top, bottom;
284 int n =
sscanf(
crop_str.c_str(),
"%d,%d,%d,%d", &left, &right, &top, &bottom);
286 crop = vigra::Rect2D(left, top, right, bottom);
292 int left, right, top, bottom;
293 int n =
sscanf(
crop_str.c_str(),
"%d,%d,%d,%d", &left, &right, &top, &bottom);
295 crop = vigra::Rect2D(left, top, right, bottom);
a variable has a value and a name.
const std::string & getName() const
#define DEBUG_ASSERT(cond)
bool getIntParam(T &value, const std::string &line, const std::string &name)
bool getPTDoubleParam(double &value, int &link, const std::string &line, const std::string &var)
bool readVar(Variable &var, int &link, const std::string &line)
bool getDoubleParam(double &d, const std::string &line, const std::string &name)
bool getPTParam(std::string &output, const std::string &line, const std::string ¶meter)
helper functions for parsing of a script line
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
bool stringToDouble(const STR &str_, double &dest)
convert a string to a double, ignore localisation.
bool stringToInt(const std::string &s, int &val)
convert string to integer value, returns true, if sucessful
std::map< std::string, int > links
std::string flatfieldname
std::map< std::string, double > vars
static const char * varnames[]
void parse(const std::string &line)
static double defaultValues[]
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.