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
[legend]
List of all members.

Public Types

enum  ImageVariableEnum {
  name, type, IVE_Filename, IVE_Size,
  IVE_Projection, IVE_HFOV, IVE_ResponseType, IVE_EMoRParams,
  IVE_ExposureValue, IVE_Gamma, IVE_WhiteBalanceRed, IVE_WhiteBalanceBlue,
  IVE_Roll, IVE_Pitch, IVE_Yaw, IVE_X,
  IVE_Y, IVE_Z, IVE_TranslationPlaneYaw, IVE_TranslationPlanePitch,
  IVE_Stack, IVE_RadialDistortion, IVE_RadialDistortionRed, IVE_RadialDistortionBlue,
  IVE_RadialDistortionCenterShift, IVE_Shear, IVE_CropMode, IVE_CropRect,
  IVE_AutoCenterCrop, IVE_VigCorrMode, IVE_FlatfieldFilename, IVE_RadialVigCorrCoeff,
  IVE_RadialVigCorrCenterShift, IVE_ExifModel, IVE_ExifMake, IVE_ExifLens,
  IVE_ExifCropFactor, IVE_ExifFocalLength, IVE_ExifOrientation, IVE_ExifAperture,
  IVE_ExifISO, IVE_ExifDistance, IVE_ExifFocalLength35, IVE_ExifExposureTime,
  IVE_ExifDate, IVE_ExifExposureMode, IVE_Masks, IVE_ActiveMasks,
  IVE_Active
}

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.
std::size_t getNumberOfParts ()
 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 int > m_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

enum HuginBase::ConstImageVariableGroup::ImageVariableEnum
 

Enumeration values:
name 
type 
IVE_Filename 
IVE_Size 
IVE_Projection 
IVE_HFOV 
IVE_ResponseType 
IVE_EMoRParams 
IVE_ExposureValue 
IVE_Gamma 
IVE_WhiteBalanceRed 
IVE_WhiteBalanceBlue 
IVE_Roll 
IVE_Pitch 
IVE_Yaw 
IVE_X 
IVE_Y 
IVE_Z 
IVE_TranslationPlaneYaw 
IVE_TranslationPlanePitch 
IVE_Stack 
IVE_RadialDistortion 
IVE_RadialDistortionRed 
IVE_RadialDistortionBlue 
IVE_RadialDistortionCenterShift 
IVE_Shear 
IVE_CropMode 
IVE_CropRect 
IVE_AutoCenterCrop 
IVE_VigCorrMode 
IVE_FlatfieldFilename 
IVE_RadialVigCorrCoeff 
IVE_RadialVigCorrCenterShift 
IVE_ExifModel 
IVE_ExifMake 
IVE_ExifLens 
IVE_ExifCropFactor 
IVE_ExifFocalLength 
IVE_ExifOrientation 
IVE_ExifAperture 
IVE_ExifISO 
IVE_ExifDistance 
IVE_ExifFocalLength35 
IVE_ExifExposureTime 
IVE_ExifDate 
IVE_ExifExposureMode 
IVE_Masks 
IVE_ActiveMasks 
IVE_Active 

Definition at line 67 of file ImageVariableGroup.h.


Constructor & Destructor Documentation

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().

HuginBase::ConstImageVariableGroup::~ConstImageVariableGroup  )  [virtual]
 

destructor

Definition at line 40 of file ImageVariableGroup.cpp.


Member Function Documentation

std::size_t HuginBase::ConstImageVariableGroup::getNumberOfParts  ) 
 

get the number of parts.

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

Definition at line 1193 of file ImageVariableGroup.cpp.

Referenced by PanoOperation::AssignStacksOperation::GetInternalCommand(), PanoOperation::ChangeStackOperation::GetInternalCommand(), PanoOperation::ChangeLensOperation::GetInternalCommand(), HuginBase::ConstStandardImageVariableGroups::getLens(), PanoOperation::ChangeStackOperation::IsEnabled(), PanoOperation::NewStackOperation::IsEnabled(), PanoOperation::ChangeLensOperation::IsEnabled(), PanoOperation::NewLensOperation::IsEnabled(), main(), ImagesTreeCtrl::panoramaImagesChanged(), PT::wxLoadPTProjectCmd::processPanorama(), OptimizePhotometricPanel::runOptimizer(), and HuginBase::SmartOptimise::smartOptimize().

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 PossiblePano::GeneratePanorama(), PanoOperation::LoadLensOperation::GetInternalCommand(), HuginBase::ConstStandardImageVariableGroups::getLens(), LensCalFrame::GetPanorama(), main(), PanoDetector::matchMultiRow(), ImagesTreeCtrl::panoramaImagesChanged(), PT::ChangePartNumberCmd::processPanorama(), PT::UpdateCropFactorCmd::processPanorama(), and PT::wxAddImagesCmd::processPanorama().

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:
variable the variable to check
part the 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 51 of file ImageVariableGroup.cpp.

Referenced by main(), and OptimizePhotometricPanel::runOptimizer().

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.

Definition at line 1203 of file ImageVariableGroup.cpp.

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

void HuginBase::ConstImageVariableGroup::updatePartNumbers  ) 
 

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

Definition at line 1198 of file ImageVariableGroup.cpp.

Referenced by processImg(), PT::ChangePartImagesLinkingCmd::processPanorama(), PT::wxApplyTemplateCmd::processPanorama(), and UnLinkVars().


Member Data Documentation

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

The part numbers for each image.

The image number is used as an index.

Definition at line 279 of file ImageVariableGroup.h.

Referenced by getPartNumber().

unsigned int HuginBase::ConstImageVariableGroup::m_num_parts [protected]
 

Definition at line 281 of file ImageVariableGroup.h.

const PanoramaData& HuginBase::ConstImageVariableGroup::m_pano [protected]
 

The panorama this group works on.

Reimplemented in HuginBase::ImageVariableGroup.

Definition at line 274 of file ImageVariableGroup.h.

Referenced by getPartNumber().

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

The set of variables which make up this group.

Definition at line 271 of file ImageVariableGroup.h.


The documentation for this class was generated from the following files:
Generated on Tue Jul 29 01:25:53 2014 for Hugintrunk by  doxygen 1.3.9.1