From: <hug...@li...> - 2011-05-01 18:00:00
|
branch: details: http://hugin.hg.sourceforge.net/hgweb/hugin/hugin/hgrepo/h/hu/hugin/hugin/rev/227b3a1a45fc changeset: 5190:227b3a1a45fc user: tmodes date: Sun May 01 19:58:36 2011 +0200 description: New mask type: exclude region from all images of the same lens diffstat: src/hugin1/hugin/xrc/mask_editor_panel.xrc | 1 + src/hugin_base/panodata/Mask.h | 3 ++- src/hugin_base/panodata/Panorama.cpp | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletions(-) diffs (90 lines): diff -r c3f95c9f0dd2 -r 227b3a1a45fc src/hugin1/hugin/xrc/mask_editor_panel.xrc --- a/src/hugin1/hugin/xrc/mask_editor_panel.xrc Sun May 01 18:57:42 2011 +0200 +++ b/src/hugin1/hugin/xrc/mask_editor_panel.xrc Sun May 01 19:58:36 2011 +0200 @@ -63,6 +63,7 @@ <item>Include region</item> <item>Exclude region from stack</item> <item>Include region from stack</item> + <item>Exclude region from all images of this lens</item> </content> <selection>0</selection> </object> diff -r c3f95c9f0dd2 -r 227b3a1a45fc src/hugin_base/panodata/Mask.h --- a/src/hugin_base/panodata/Mask.h Sun May 01 18:57:42 2011 +0200 +++ b/src/hugin_base/panodata/Mask.h Sun May 01 19:58:36 2011 +0200 @@ -60,7 +60,8 @@ Mask_negative=0, Mask_positive=1, Mask_Stack_negative=2, - Mask_Stack_positive=3 + Mask_Stack_positive=3, + Mask_negative_lens=4 }; /** constructor */ MaskPolygon() : m_maskType(Mask_negative), m_imgNr(0), m_invert(false) {}; diff -r c3f95c9f0dd2 -r 227b3a1a45fc src/hugin_base/panodata/Panorama.cpp --- a/src/hugin_base/panodata/Panorama.cpp Sun May 01 18:57:42 2011 +0200 +++ b/src/hugin_base/panodata/Panorama.cpp Sun May 01 19:58:36 2011 +0200 @@ -27,6 +27,7 @@ #include "PTScriptParsing.h" #include "ImageVariableTranslate.h" +#include "StandardImageVariableGroups.h" #include <panotools/PanoToolsInterface.h> #include <algorithms/basic/CalculateOverlap.h> @@ -1197,6 +1198,8 @@ CalculateImageOverlap overlap(this); overlap.limitToImages(imgWithPosMasks); overlap.calculate(10); + ConstStandardImageVariableGroups variable_groups(*this); + ConstImageVariableGroup & lenses = variable_groups.getLenses(); for(unsigned int i=0;i<state.images.size();i++) { if(state.images[i]->hasMasks()) @@ -1238,6 +1241,22 @@ transferMask(masks[j],i,imgStack); }; break; + case MaskPolygon::Mask_negative_lens: + { + unsigned int lensNr=lenses.getPartNumber(i); + //copy masks to all image of the same lens + UIntSet imgLens; + for(unsigned int k=0;k<getNrOfImages();k++) + { + if(lenses.getPartNumber(k)==lensNr) + { + masks[j].setImgNr(k); + masks[j].setMaskType(MaskPolygon::Mask_negative_lens); + state.images[k]->addActiveMask(masks[j]); + }; + }; + }; + break; }; } else @@ -1302,6 +1321,22 @@ transferMask(masks[j],i,imgs); }; break; + case MaskPolygon::Mask_negative_lens: + { + unsigned int lensNr=lenses.getPartNumber(i); + //copy masks to all image of the same lens + UIntSet imgLens; + for(unsigned int k=0;k<getNrOfImages();k++) + { + if(lenses.getPartNumber(k)==lensNr) + { + masks[j].setImgNr(k); + masks[j].setMaskType(MaskPolygon::Mask_negative_lens); + state.images[k]->addActiveMask(masks[j]); + }; + }; + }; + break; }; }; }; |