// -*- c-basic-offset: 4 -*- /** @file PanoramaVariable.h * * @author Pablo d'Angelo * * $Id$ * * !! from PanoramaMemento.h 1970 * * This is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this software; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ #include "PanoramaVariable.h" #include #include #include namespace HuginBase { std::ostream & Variable::print(std::ostream & o) const { return o << name << std::setprecision(15) << value; } std::ostream & LensVariable::printLink(std::ostream & o, unsigned int linkImage) const { return o << name << "=" << linkImage; } void fillVariableMap(VariableMap & vars) { vars.insert(std::pair("y",Variable("y",0))); vars.insert(std::pair("r",Variable("r",0))); vars.insert(std::pair("p",Variable("p",0))); vars.insert(std::pair("TrX",Variable("TrX",0))); vars.insert(std::pair("TrY",Variable("TrY",0))); vars.insert(std::pair("TrZ",Variable("TrZ",0))); vars.insert(std::pair("j",Variable("j",0))); // Lens variables vars.insert(std::pair("v",Variable("v",51))); vars.insert(std::pair("a",Variable("a",0.0))); vars.insert(std::pair("b",Variable("b",0.0))); vars.insert(std::pair("c",Variable("c",0.0))); vars.insert(std::pair("d",Variable("d",0))); vars.insert(std::pair("e",Variable("e",0))); vars.insert(std::pair("g",Variable("g",0))); vars.insert(std::pair("t",Variable("t",0))); vars.insert(std::pair("Va",Variable("Va",1))); vars.insert(std::pair("Vb",Variable("Vb",0))); vars.insert(std::pair("Vc",Variable("Vc",0))); vars.insert(std::pair("Vd",Variable("Vd",0))); vars.insert(std::pair("Vx",Variable("Vx",0))); vars.insert(std::pair("Vy",Variable("Vy",0))); // exposure value and white balance vars.insert(std::pair("Eev",Variable("Eev",0.0))); vars.insert(std::pair("Er",Variable("Er",1.0))); vars.insert(std::pair("Eb",Variable("Eb",1.0))); // emor response variables vars.insert(std::pair("Ra",Variable("Ra",0.0))); vars.insert(std::pair("Rb",Variable("Rb",0.0))); vars.insert(std::pair("Rc",Variable("Rc",0.0))); vars.insert(std::pair("Rd",Variable("Rd",0.0))); vars.insert(std::pair("Re",Variable("Re",0.0))); } void fillLensVarMap(LensVarMap & variables) { variables.insert(std::pair("v",LensVariable("v", 51, true))); variables.insert(std::pair("a",LensVariable("a", 0.0, true ))); variables.insert(std::pair("b",LensVariable("b", 0.0, true))); variables.insert(std::pair("c",LensVariable("c", 0.0, true))); variables.insert(std::pair("d",LensVariable("d", 0.0, true))); variables.insert(std::pair("e",LensVariable("e", 0.0, true))); variables.insert(std::pair("g",LensVariable("g", 0.0, true))); variables.insert(std::pair("t",LensVariable("t", 0.0, true))); // vignetting correction variables variables.insert(std::pair("Va",LensVariable("Va", 1.0, true))); variables.insert(std::pair("Vb",LensVariable("Vb", 0.0, true))); variables.insert(std::pair("Vc",LensVariable("Vc", 0.0, true))); variables.insert(std::pair("Vd",LensVariable("Vd", 0.0, true))); variables.insert(std::pair("Vx",LensVariable("Vx", 0.0, true))); variables.insert(std::pair("Vy",LensVariable("Vy", 0.0, true))); // exposure variables.insert(std::pair("Eev",LensVariable("Eev", 0.0, false))); variables.insert(std::pair("Er",LensVariable("Er", 1.0, false))); variables.insert(std::pair("Eb",LensVariable("Eb", 1.0, false))); // emor response variables variables.insert(std::pair("Ra",LensVariable("Ra",0.0, true))); variables.insert(std::pair("Rb",LensVariable("Rb",0.0, true))); variables.insert(std::pair("Rc",LensVariable("Rc",0.0, true))); variables.insert(std::pair("Rd",LensVariable("Rd",0.0, true))); variables.insert(std::pair("Re",LensVariable("Re",0.0, true))); } void printVariableMap(std::ostream & o, const VariableMap & vars) { for ( VariableMap::const_iterator it = vars.begin(); it != vars.end();++it) { it->second.print(o); o << " "; } } } // namespace