24#ifndef _PANODATA_PANORAMA_H
25#define _PANODATA_PANORAMA_H
30#ifndef _HSI_IGNORE_SECTION
71 bool loadPTScript(std::istream &
i,
int &
ptoVersion,
const std::string & prefix =
"");
112 void deleteAllImages();
185 return new Panorama(this->getSubset(imgs));
191 return new Panorama(this->duplicate());
207 return state.images.size();
214 return *state.images[
nr];
220 setSrcImage(
nr, img);
231 void mergePanorama(
const Panorama &newPano);
246 void removeImage(
unsigned int nr);
252 void swapImages(
unsigned int img1,
unsigned int img2);
258 void moveImage(
size_t img1,
size_t img2);
284 void setImageFilename(
unsigned int img,
const std::string &
fname);
297 void activateImage(
unsigned int imgNr,
bool active=
true);
300 UIntSet getActiveImages()
const;
308 return state.ctrlPoints.size();
314 assert(
nr < state.ctrlPoints.size());
315 return state.ctrlPoints[
nr];
320 {
return state.ctrlPoints; };
323 std::vector<unsigned int> getCtrlPointsForImage(
unsigned int imgNr)
const;
327 CPointVector getCtrlPointsVectorForImage(
unsigned int imgNr)
const;
337 void removeCtrlPoint(
unsigned int pNr);
341 void removeDuplicateCtrlPoints();
345 void changeControlPoint(
unsigned int pNr,
const ControlPoint & point);
351 int getNextCPTypeLineNumber()
const;
354 void updateLineCtrlPoints();
371 void updateCtrlPointErrors(
const UIntSet & imgs,
const CPVector & cps);
374 const std::string getICCProfileDesc()
const;
376 void setICCProfileDesc(
const std::string&
newDesc);
379 const int getNrOfBands()
const;
381 void setNrOfBands(
const int nrBands);
395 const VariableMap getImageVariables(
unsigned int imgNr)
const;
410 virtual void updateVariables(
unsigned int imgNr,
const VariableMap & var);
417 virtual void updateVariable(
unsigned int imgNr,
const Variable &var);
427#define image_variable( name, type, default_value ) \
428 virtual void linkImageVariable##name(unsigned int sourceImgNr, unsigned int destImgNr);
435#define image_variable( name, type, default_value ) \
436 virtual void unlinkImageVariable##name(unsigned int imgNr);
446 const double getMaxExposureDifference()
const;
448 const bool hasPossibleStacks()
const;
455 {
return state.optvec; };
462 {
return state.optSwitch;};
464 void setOptimizerSwitch(
const int newSwitch);
468 {
return state.optPhotoSwitch; };
470 void setPhotometricOptimizerSwitch(
const int newSwitch);
482 {
return state.options; };
495 void printPanoramaScript(std::ostream & o,
503 void printStitcherScript(std::ostream & o,
537 void clearObservers();
544 const bool hasPendingChanges()
const;
565 { changeFinished(
false); }
572 void imageChanged(
unsigned int imgNr);
586 void updateOptimizeVector();
588 std::set<size_t> getRefImages();
615 {
return state.needsOptimization; };
619 { state.needsOptimization = !
optimized; };
631 bool ReadPTOFile(
const std::string& filename,
const std::string& prefix =
"");
633 bool WritePTOFile(
const std::string& filename,
const std::string& prefix =
"");
665 { imgFilePrefix = prefix; }
669 {
return imgFilePrefix; }
683 void centerCrop(
unsigned int imgNr);
685 vigra::Rect2D centerCropImage(
unsigned int imgNr);
687 void updateCropMode(
unsigned int imgNr);
virtual void clearDirty()
virtual void setDirty(const bool &dirty=true)
virtual bool isDirty() const
represents a control point
base class, which stores one mask polygon
Memento class for a PanoramaData object.
Memento class for a Panorama object.
std::vector< SrcPanoImage * > images
The images inside the panorama.
std::string iccProfileDesc
description of the icc profile
int optSwitch
stores the optimizer switch, use OR of HuginBase::OptimizerSwitches
int optPhotoSwitch
stores the photometric optimizer switch, use OR of HuginBase::OptimizerSwitches
this handler class will receive change events from the Panorama.
UIntSet changedImages
the images that have been changed since the last changeFinished()
const SrcPanoImage & getImage(std::size_t nr) const
get a panorama image, counting starts with 0
const PanoramaOptions & getOptions() const
returns the options for this panorama
PanoramaData * getNewCopy() const
virtual void clearDirty()
clear dirty flag.
bool isDirty() const
true if there are unsaved changes
std::string getFilePrefix() const
std::list< PanoramaObserver * > observers
void setImage(std::size_t nr, const SrcPanoImage &img)
set a panorama image, counting starts with 0
const ControlPoint & getCtrlPoint(std::size_t nr) const
get a control point, counting starts with 0
const int getPhotometricOptimizerSwitch() const
return the photometric optimizer master switch
std::size_t getNrOfCtrlPoints() const
number of control points
std::set< std::string > m_ptoptimizerVarNames
void markAsOptimized(bool optimized=true)
void changeFinished()
notify observers about changes in this class
const CPVector & getCtrlPoints() const
get all control point of this Panorama
bool dirty
this indicates that there are unsaved changes
PanoramaMemento getMemento() const
get the internal state
const OptimizeVector & getOptimizeVector() const
return the optimize settings stored inside panorama
PanoramaData * getNewSubset(const UIntSet &imgs) const
void setDirty(const bool &dirty=true)
std::string imgFilePrefix
const int getOptimizerSwitch() const
returns optimizer master switch
void adjustVarLinks()
adjust the links of the linked variables, must be called when a lens has been changed.
void setFilePrefix(std::string prefix)
sets the path prefix of the images reffered with relative paths
bool needsOptimization()
true if control points or lens variables have been changed after the last optimisation
std::size_t getNrOfImages() const
number of images.
All variables of a source image.
a variable has a value and a name.
This file specifies what image variables SrcPanoImg should have.
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
std::vector< MaskPolygon > MaskPolygonVector
std::vector< VariableMap > VariableMapVector
std::vector< ControlPoint > CPVector
std::vector< std::set< std::string > > OptimizeVector
std::vector< CPoint > CPointVector
std::vector< UIntSet > UIntSetVector
std::set< unsigned int > UIntSet
std::map< std::string, Variable > VariableMap
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.