File SrcPanoImage_init.patch of Package hugin
diff --git a/src/hugin_base/panodata/SrcPanoImage.cpp b/src/hugin_base/panodata/SrcPanoImage.cpp
--- a/src/hugin_base/panodata/SrcPanoImage.cpp
+++ b/src/hugin_base/panodata/SrcPanoImage.cpp
@@ -123,23 +123,6 @@
return false;
}
-void BaseSrcPanoImage::setDefaults()
-{
- /* Some of the vectors are difficult to initalise with the variables list
- * header, so we make some local variables which are used in it.
- */
- // Radial Distortion defaults
- std::vector<double> distortion_default(4, 0.0);
- distortion_default[3] = 1;
-
- std::vector<double> RadialVigCorrCoeff_default(4, 0.0);
- RadialVigCorrCoeff_default[0] = 1;
- HuginBase::MaskPolygonVector defaultMaskVector;
-#define image_variable( name, type, default_value ) m_##name.setData(default_value);
-#include "image_variables.h"
-#undef image_variable
-}
-
bool SrcPanoImage::isInside(vigra::Point2D p, bool ignoreMasks) const
{
bool insideCrop=false;
diff --git a/src/hugin_base/panodata/SrcPanoImage.h b/src/hugin_base/panodata/SrcPanoImage.h
--- a/src/hugin_base/panodata/SrcPanoImage.h
+++ b/src/hugin_base/panodata/SrcPanoImage.h
@@ -111,9 +111,7 @@
public:
///
BaseSrcPanoImage()
- {
- setDefaults();
- }
+ {};
virtual ~BaseSrcPanoImage() {};
@@ -178,12 +176,9 @@
#undef image_variable
protected:
- ///
- void setDefaults();
-
// the image variables m_[variable name]
#define image_variable( name, type, default_value ) \
- ImageVariable<type > m_##name;
+ ImageVariable<type> m_##name {ImageVariable<type>(default_value)};
#include "image_variables.h"
#undef image_variable
};
@@ -200,10 +195,8 @@
{
public:
///
- SrcPanoImage()
- {
- setDefaults();
- }
+ SrcPanoImage() :BaseSrcPanoImage()
+ {};
virtual ~SrcPanoImage() {};
public:
diff --git a/src/hugin_base/panodata/image_variables.h b/src/hugin_base/panodata/image_variables.h
--- a/src/hugin_base/panodata/image_variables.h
+++ b/src/hugin_base/panodata/image_variables.h
@@ -64,7 +64,7 @@
// projection variables
image_variable( Projection, HuginBase::BaseSrcPanoImage::Projection, RECTILINEAR )
image_variable( HFOV, double, 50.0 )
-image_variable( CropFactor, double, 0 )
+image_variable( CropFactor, double, 0.0 )
// colour response variables
image_variable( ResponseType, HuginBase::BaseSrcPanoImage::ResponseType, RESPONSE_EMOR )
@@ -90,11 +90,11 @@
image_variable( Stack, double, 0.0 )
// radial lens distortion
-image_variable( RadialDistortion, std::vector<double>, distortion_default )
+image_variable(RadialDistortion, std::vector<double>, std::vector<double>({ 0.0, 0.0, 0.0, 1.0 }))
// radial lens distortion (red, blue channel), for TCA correction
-image_variable( RadialDistortionRed, std::vector<double>, distortion_default )
-image_variable( RadialDistortionBlue, std::vector<double>, distortion_default )
+image_variable( RadialDistortionRed, std::vector<double>, std::vector<double>({ 0.0, 0.0, 0.0, 1.0 }))
+image_variable( RadialDistortionBlue, std::vector<double>, std::vector<double>({ 0.0, 0.0, 0.0, 1.0 }))
// Center shift
image_variable( RadialDistortionCenterShift, hugin_utils::FDiff2D, hugin_utils::FDiff2D(0.0, 0.0) )
@@ -112,7 +112,7 @@
// coefficients for vignetting correction (even degrees: 0,2,4,6, ...)
image_variable( FlatfieldFilename, std::string, "" )
-image_variable( RadialVigCorrCoeff, std::vector<double>, RadialVigCorrCoeff_default )
+image_variable(RadialVigCorrCoeff, std::vector<double>, std::vector<double>({ 1.0, 0.0, 0.0, 0.0 }))
image_variable( RadialVigCorrCenterShift, hugin_utils::FDiff2D, hugin_utils::FDiff2D(0.0, 0.0) )
// linear pixel transform
@@ -126,18 +126,18 @@
image_variable( ExifModel, std::string, "" )
image_variable( ExifMake, std::string, "" )
image_variable( ExifLens, std::string, "" )
-image_variable( ExifFocalLength, double, 0 )
-image_variable( ExifOrientation, double, 0 )
-image_variable( ExifAperture, double, 0 )
-image_variable( ExifISO, double, 0 )
-image_variable( ExifDistance, double, 0 )
-image_variable( ExifFocalLength35, double, 0)
-image_variable( ExifCropFactor, double, 0)
-image_variable( ExifExposureTime, double, 0)
+image_variable( ExifFocalLength, double, 0.0 )
+image_variable( ExifOrientation, double, 0.0 )
+image_variable( ExifAperture, double, 0.0 )
+image_variable( ExifISO, double, 0.0 )
+image_variable( ExifDistance, double, 0.0 )
+image_variable( ExifFocalLength35, double, 0.0)
+image_variable( ExifCropFactor, double, 0.0)
+image_variable( ExifExposureTime, double, 0.0)
image_variable( ExifDate, std::string, "")
-image_variable( ExifExposureMode, int, 0)
-image_variable( ExifRedBalance, double, 1)
-image_variable( ExifBlueBalance, double, 1)
+image_variable( ExifExposureMode, int, 0.0)
+image_variable( ExifRedBalance, double, 1.0)
+image_variable( ExifBlueBalance, double, 1.0)
image_variable( FileMetadata, HuginBase::FileMetaData, HuginBase::FileMetaData())
#if 0
@@ -152,10 +152,10 @@
// mask handling
// Masks is list of loaded or created textures
-image_variable( Masks, HuginBase::MaskPolygonVector, defaultMaskVector)
+image_variable( Masks, HuginBase::MaskPolygonVector, HuginBase::MaskPolygonVector())
// ActiveMasks contains list of all negative masks, which should be applied to
// a given image, this is used to propagate positive masks
-image_variable( ActiveMasks, HuginBase::MaskPolygonVector, defaultMaskVector)
+image_variable( ActiveMasks, HuginBase::MaskPolygonVector, HuginBase::MaskPolygonVector())
// If the image is selected to be used in the preview and for optimisation.
image_variable( Active, bool, true )