Hugin trunk 0.1
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HuginBase::ConstImageVariableGroup Class Reference

An ImageVariableGroup is a collection of image variables that can have some shared variable values. More...

#include <ImageVariableGroup.h>

Inheritance diagram for HuginBase::ConstImageVariableGroup:
Inheritance graph

Public Types

enum  ImageVariableEnum
 

Public Member Functions

 ConstImageVariableGroup (std::set< ImageVariableEnum > variables, const PanoramaData &pano)
 constructor
 
virtual ~ConstImageVariableGroup ()
 destructor
 
unsigned int getPartNumber (unsigned int imageNr) const
 Get a part number from an image number.
 
UIntSetVector getPartsSet () const
 return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numbers
 
std::size_t getNumberOfParts () const
 get the number of parts.
 
bool getVarLinkedInPart (ImageVariableEnum variable, std::size_t part) const
 Get the linked status of a particular variable for a given part number.
 
void updatePartNumbers ()
 Update the part numbers, call this when the panorama changes.
 

Protected Member Functions

void setPartNumbers ()
 Set the part numbers in m_image_part_numbers, and notify observers of changes.
 

Protected Attributes

std::set< ImageVariableEnumm_variables
 The set of variables which make up this group.
 
const PanoramaDatam_pano
 The panorama this group works on.
 
std::vector< unsigned intm_image_part_numbers
 The part numbers for each image.
 
unsigned int m_num_parts
 

Detailed Description

An ImageVariableGroup is a collection of image variables that can have some shared variable values.

It is useful to group the image variables to those that are shared because of the same setup: for example lens variables, sensor variables, exposures of particular brackets, positions of particular stacks.

We can partition the set of images in a panorama based on shared (linked) values for some of the variables in the group. (For example, we can Partion the images by Lens given that a lens consists of a projection type, horizontal field of view, and distortion coefficents.) The parts are assigned a number. (e.g. Lens number) We can also unlink a variable across a part, if it is part of the group of variables (For example, it might be necessary to unlink the centre shift of a particular lens). Note that if all the variables in a part are unlinked, this is equivalent to each image being in a separate part, which changes the part numbers. We can also switch an image into a different partition by changing what its variables are linked to.

Another object can listen to changes of part allocations in an ImageVariableGroup, it should inherit from ImageVariableGroupObserver, and register itself with the ImageVariableGroup(s) it wants to hear from.

Definition at line 64 of file ImageVariableGroup.h.

Member Enumeration Documentation

◆ ImageVariableEnum

Definition at line 67 of file ImageVariableGroup.h.

Constructor & Destructor Documentation

◆ ConstImageVariableGroup()

HuginBase::ConstImageVariableGroup::ConstImageVariableGroup ( std::set< ImageVariableEnum variables,
const PanoramaData pano 
)

constructor

Assign the ImageVariableGroup the image variables and the panorama that it should be handling.

Definition at line 31 of file ImageVariableGroup.cpp.

References setPartNumbers().

◆ ~ConstImageVariableGroup()

HuginBase::ConstImageVariableGroup::~ConstImageVariableGroup ( )
virtual

destructor

Definition at line 40 of file ImageVariableGroup.cpp.

Member Function Documentation

◆ getNumberOfParts()

std::size_t HuginBase::ConstImageVariableGroup::getNumberOfParts ( ) const

get the number of parts.

Returns
the number of unlinked parts in the associated panorama's images.

Definition at line 261 of file ImageVariableGroup.cpp.

References m_num_parts.

Referenced by HuginBase::ConstStandardImageVariableGroups::getLens(), getPartsSet(), and ImagesTreeCtrl::panoramaImagesChanged().

◆ getPartNumber()

unsigned int HuginBase::ConstImageVariableGroup::getPartNumber ( unsigned int  imageNr) const

Get a part number from an image number.

Returns
a number unique to a subset in a partition of the images, such that there is at least of the variables in this group linked.

Definition at line 44 of file ImageVariableGroup.cpp.

References DEBUG_ASSERT, HuginBase::PanoramaData::getNrOfImages(), m_image_part_numbers, and m_pano.

Referenced by HuginBase::ConstStandardImageVariableGroups::getLens(), PanoCommand::UpdateCropFactorCmd::processPanorama(), and ImagesTreeCtrl::UpdateImageText().

◆ getPartsSet()

UIntSetVector HuginBase::ConstImageVariableGroup::getPartsSet ( ) const

return a vector which contains a HuginBase::UIntSet for each group with the corresponding images numbers

Definition at line 51 of file ImageVariableGroup.cpp.

References getNumberOfParts(), and m_image_part_numbers.

Referenced by ImagesTreeCtrl::panoramaImagesChanged(), and MaskEditorPanel::UpdateCrop().

◆ getVarLinkedInPart()

bool HuginBase::ConstImageVariableGroup::getVarLinkedInPart ( ImageVariableEnum  variable,
std::size_t  part 
) const

Get the linked status of a particular variable for a given part number.

Parameters
variablethe variable to check
partthe part number to check
Returns
true if there is only one image in this part or the first image in this part has links. False otherwise.
Note
If there is only one image in the given part, true is returned. This should make sense as variables are linked by default.

Definition at line 61 of file ImageVariableGroup.cpp.

References threshold().

◆ setPartNumbers()

void HuginBase::ConstImageVariableGroup::setPartNumbers ( )
protected

Set the part numbers in m_image_part_numbers, and notify observers of changes.

This should be called whenever the images change.

Todo:
Check for multiple parts. If there is some complex set of links, we may need to merge two parts together.

Definition at line 271 of file ImageVariableGroup.cpp.

References DEBUG_TRACE, HuginBase::PanoramaData::getNrOfImages(), m_image_part_numbers, m_num_parts, m_pano, m_variables, and threshold().

Referenced by ConstImageVariableGroup(), HuginBase::ImageVariableGroup::linkVariablePart(), HuginBase::ImageVariableGroup::switchParts(), HuginBase::ImageVariableGroup::unlinkVariablePart(), and updatePartNumbers().

◆ updatePartNumbers()

void HuginBase::ConstImageVariableGroup::updatePartNumbers ( )

Update the part numbers, call this when the panorama changes.

Definition at line 266 of file ImageVariableGroup.cpp.

References setPartNumbers().

Referenced by HuginBase::ConstStandardImageVariableGroups::update(), and HuginBase::StandardImageVariableGroups::update().

Member Data Documentation

◆ m_image_part_numbers

std::vector<unsigned int> HuginBase::ConstImageVariableGroup::m_image_part_numbers
protected

◆ m_num_parts

unsigned int HuginBase::ConstImageVariableGroup::m_num_parts
protected

◆ m_pano

const PanoramaData& HuginBase::ConstImageVariableGroup::m_pano
protected

The panorama this group works on.

Definition at line 120 of file ImageVariableGroup.h.

Referenced by getPartNumber(), and setPartNumbers().

◆ m_variables

std::set<ImageVariableEnum> HuginBase::ConstImageVariableGroup::m_variables
protected

The documentation for this class was generated from the following files: