[an error occurred while processing this directive]
Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

hugin_base/panodata/Panorama.cpp File Reference

implementation of Panorama Class More...

#include "Panorama.h"
#include "PTScriptParsing.h"
#include "ImageVariableTranslate.h"
#include <panotools/PanoToolsInterface.h>
#include <algorithms/basic/CalculateOverlap.h>
#include <fstream>
#include <typeinfo>
#include <vigra/impex.hxx>
#include "image_variables.h"

Include dependency graph for Panorama.cpp:

Include dependency graph

Namespaces

namespace  HuginBase

Defines

#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)   dest->set##name (img.get##name());
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define image_variable(name, type, default_value)
#define RESET_LOCALE   setlocale(LC_NUMERIC,old_locale); free(old_locale);
#define image_variable(name, type, default_value)

Functions

 image_variable (Filename, std::string,"") image_variable(Size
RECTILINEAR image_variable (HFOV, double, 50.0) image_variable(ResponseType
RECTILINEAR RESPONSE_EMOR image_variable (EMoRParams, std::vector< float >, std::vector< float >(5, 0.0)) image_variable(ExposureValue
RECTILINEAR RESPONSE_EMOR image_variable (Gamma, double, 1.0) image_variable(WhiteBalanceRed
RECTILINEAR RESPONSE_EMOR image_variable (WhiteBalanceBlue, double, 1.0) image_variable(Roll
RECTILINEAR RESPONSE_EMOR image_variable (Pitch, double, 0.0) image_variable(Yaw
RECTILINEAR RESPONSE_EMOR image_variable (X, double, 0.0) image_variable(Y
RECTILINEAR RESPONSE_EMOR image_variable (Z, double, 0.0) image_variable(Stack
RECTILINEAR RESPONSE_EMOR image_variable (RadialDistortion, std::vector< double >, distortion_default) image_variable(RadialDistortionRed
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP 
image_variable (CropRect, vigra::Rect2D, vigra::Rect2D(0, 0, 0, 0)) image_variable(AutoCenterCrop
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (VigCorrMode, int, VIGCORR_RADIAL|VIGCORR_DIV) image_variable(FlatfieldFilename
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (RadialVigCorrCoeff, std::vector< double >, RadialVigCorrCoeff_default) image_variable(RadialVigCorrCenterShift
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (ExifMake, std::string,"") image_variable(ExifCropFactor
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (ExifFocalLength, double, 0) image_variable(ExifOrientation
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (ExifAperture, double, 0) image_variable(ExifISO
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (ExifDistance, double, 0) image_variable(ExifFocalLength35
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (ExifExposureTime, double, 0) image_variable(ExifDate
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true 
image_variable (FeatherWidth, unsigned int, 10) image_variable(Morph
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true false 
image_variable (Masks, HuginBase::MaskPolygonVector, defaultMaskVector) image_variable(ActiveMasks
 image_variable (Size, vigra::Size2D, vigra::Size2D(0, 0)) image_variable(Projection
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP
true false defaultMaskVector 
image_variable (Active, bool, true) void Panorama

Variables

RECTILINEAR RESPONSE_EMOR double
RECTILINEAR RESPONSE_EMOR
distortion_default NO_CROP 
bool

Detailed Description

implementation of Panorama Class

Author:
Pablo d'Angelo <pablo.dangelo@web.de>
$Id$

This program 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 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


Define Documentation

#define image_variable name,
type,
default_value   ) 
 

Value:

PTOVariableConverterFor##name::addToVariableMap(name_src.get##name##IV(), vars_for_name);\
        for (VariableMap::iterator vit = vars_for_name.begin();\
             vit != vars_for_name.end(); vit++)\
        {\
            if (link >= 0 && iImgInfo[i].links[vit->first] >= 0)\
            {\
                if (   !(PTGUILensLoaded && link == 0)\
                    && (int) images.size() < link && (!PTGUILensLoaded))\
                {\
                    DEBUG_ERROR("variables must be linked to an image with a lower number" << endl\
                                << "number links: " << link << " images: " << images.size() << endl\
                                << "error on line " << lineNr << ":" << endl\
                                << line);\
                    RESET_LOCALE\
                    return false;\
                }\
                DEBUG_DEBUG("anchored to image " << iImgInfo[i].links[vit->first]);\
                new_img.link##name(images[iImgInfo[i].links[vit->first]]);\
            } else {\
                double val = map_get(vars, vit->first).getValue();\
                new_img.setVar(vit->first, val);\
            }\
        }\
        vars_for_name.clear();
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

if (data.images[i]->name##isLinkedWith(*data.images[j]))\
            {\
                images[i]->link##name(images[j]);\
            }
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

if(img.name##isLinkedWith(newPano.getImage(j)))\
                {\
                    linkImageVariable##name(new_image_nr[i],new_image_nr[j]);\
                };
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

if (state.images[*i]->name##isLinkedWith(*state.images[*j]))\
            {\
                subset.state.images[ic]->link##name(subset.state.images[jc]);\
            }
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

for (std::size_t i = 0; i < getNrOfImages(); i++)\
    {\
        if(state.images[imgNr]->name##isLinkedWith(*state.images[i]))\
        {\
            imageChanged(i);\
        }\
    }
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   )     dest->set##name (img.get##name());
 

Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

void Panorama::unlinkImageVariable##name(unsigned int imgNr)\
{\
    state.images[imgNr]->unlink##name();\
    imageChanged(imgNr);\
    state.needsOptimization = true;\
}
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

void Panorama::linkImageVariable##name(unsigned int sourceImgNr, unsigned int destImgNr)\
{\
    state.images[destImgNr]->link##name(state.images[sourceImgNr]);\
    imageChanged(destImgNr);\
    imageChanged(sourceImgNr);\
    state.needsOptimization = true;\
}
Todo:
call imageChanged on those images changed by the linking.

#define image_variable name,
type,
default_value   ) 
 

Value:

if (PTOVariableConverterFor##name::checkApplicability(var.getName())) \
        {\
            for (std::size_t i = 0; i < getNrOfImages(); i++)\
            {\
                if (state.images[imgNr]->name##isLinkedWith(*state.images[i]))\
                {\
                    imageChanged(i);\
                }\
            }\
        }\
    else
Todo:
call imageChanged on those images changed by the linking.

#define RESET_LOCALE   setlocale(LC_NUMERIC,old_locale); free(old_locale);
 


Function Documentation

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true false defaultMaskVector image_variable Active  ,
bool  ,
true 
 

image_variable Size  ,
vigra::Size2D  ,
vigra::  Size2D(0, 0)
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true false HuginBase::image_variable Masks  ,
HuginBase::MaskPolygonVector  ,
defaultMaskVector 
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable FeatherWidth  ,
unsigned  int,
10 
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable ExifExposureTime  ,
double  ,
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable ExifDistance  ,
double  ,
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable ExifAperture  ,
double  ,
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable ExifFocalLength  ,
double  ,
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable ExifMake  ,
std::string  ,
"" 
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable RadialVigCorrCoeff  ,
std::vector< double ,
RadialVigCorrCoeff_default 
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::image_variable VigCorrMode  ,
int  ,
VIGCORR_RADIAL|  VIGCORR_DIV
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP HuginBase::image_variable CropRect  ,
vigra::Rect2D  ,
vigra::  Rect2D(0, 0, 0, 0)
 

RECTILINEAR RESPONSE_EMOR distortion_default HuginBase::image_variable RadialDistortion  ,
std::vector< double ,
distortion_default 
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable ,
double  ,
0.  0
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable ,
double  ,
0.  0
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable Pitch  ,
double  ,
0.  0
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable WhiteBalanceBlue  ,
double  ,
1.  0
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable Gamma  ,
double  ,
1.  0
 

RECTILINEAR RESPONSE_EMOR HuginBase::image_variable EMoRParams  ,
std::vector< float >  ,
std::vector< float >  (5, 0.0)
 

RECTILINEAR HuginBase::image_variable HFOV  ,
double  ,
50.  0
 

image_variable Filename  ,
std::string  ,
"" 
 

Note:
This file is #included multiple times after defining a macro for image_variable. The idea is to reduce the amount of tedoius code copy & pasted for each image variable. The list will be used to generate things the following:
  1. Member variables: ImageVarianle<[type]> m_[name];
  2. Accessor functions: [type] get[name]() const;
  3. Set functions: void set[name](const [type] data);
  4. Link functions: void link[name](SrcPanoImg)
  5. Unlink functions: void unlink[name]();
The arguments work as follows:
  1. the name of the variable
  2. the type of the variable
  3. the default value
There is some non automatic stuff in ImageVariableTranslate.h that will need changing if this list changes. That file handles the translation to and from PTO file format style variables.
See also:
ImageVariableTranslate.h


Variable Documentation

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::bool
 

RECTILINEAR RESPONSE_EMOR distortion_default NO_CROP true HuginBase::double
 


Generated on Mon Sep 20 01:01:31 2010 for Hugintrunk by doxygen 1.3.9.1