Gallery2: Fix build in ISO C++11 mode
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
diff --git a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h b/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h
index 19f3905..e182bcb 100644
--- a/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h
+++ b/jni_mosaic/feature_mos/src/mosaic/AlignFeatures.h
@@ -29,6 +29,10 @@
#include "ImageUtils.h"
#include "MatrixUtils.h"
+#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(constexpr)
+#define constexpr const
+#endif
+
class Align {
public:
@@ -44,7 +48,7 @@
///// Settings for feature-based alignment
// Number of features to use from corner detection
static const int DEFAULT_NR_CORNERS=750;
- static const double DEFAULT_MAX_DISPARITY=0.1;//0.4;
+ static constexpr double DEFAULT_MAX_DISPARITY=0.1;//0.4;
// Type of homography to model
static const int DEFAULT_MOTION_MODEL=DB_HOMOGRAPHY_TYPE_R_T;
// static const int DEFAULT_MOTION_MODEL=DB_HOMOGRAPHY_TYPE_PROJECTIVE;
diff --git a/jni_mosaic/feature_mos/src/mosaic/Blend.h b/jni_mosaic/feature_mos/src/mosaic/Blend.h
index 2c7ee5c..fd33343 100644
--- a/jni_mosaic/feature_mos/src/mosaic/Blend.h
+++ b/jni_mosaic/feature_mos/src/mosaic/Blend.h
@@ -28,6 +28,10 @@
#define BLEND_RANGE_DEFAULT 6
#define BORDER 8
+#if __cplusplus < 201103L && !defined(__GXX_EXPERIMENTAL_CXX0X__) && !defined(constexpr)
+#define constexpr const
+#endif
+
// Percent of total mosaicing time spent on each of the following operations
const float TIME_PERCENT_ALIGN = 20.0;
const float TIME_PERCENT_BLEND = 75.0;
@@ -119,8 +123,8 @@
void CropFinalMosaic(YUVinfo &imgMos, MosaicRect &cropping_rect);
private:
- static const float LIMIT_SIZE_MULTIPLIER = 5.0f * 2.0f;
- static const float LIMIT_HEIGHT_MULTIPLIER = 2.5f;
+ static constexpr float LIMIT_SIZE_MULTIPLIER = 5.0f * 2.0f;
+ static constexpr float LIMIT_HEIGHT_MULTIPLIER = 2.5f;
int MosaicSizeCheck(float sizeMultiplier, float heightMultiplier);
void RoundingCroppingSizeToMultipleOf8(MosaicRect& rect);
};
diff --git a/jni_mosaic/feature_mos/src/mosaic/ImageUtils.cpp b/jni_mosaic/feature_mos/src/mosaic/ImageUtils.cpp
index 6d0aac0..541f43b 100644
--- a/jni_mosaic/feature_mos/src/mosaic/ImageUtils.cpp
+++ b/jni_mosaic/feature_mos/src/mosaic/ImageUtils.cpp
@@ -283,7 +283,7 @@
FILE *imgin = NULL;
int mval=0, format=0, eret;
- ImageType ret = IMAGE_TYPE_NOIMAGE;
+ ImageType ret = (ImageType) IMAGE_TYPE_NOIMAGE;
imgin = fopen(filename, "r");
if (imgin == NULL) {
diff --git a/jni_mosaic/feature_mos_jni.cpp b/jni_mosaic/feature_mos_jni.cpp
index 0fa792a..7d100a9 100644
--- a/jni_mosaic/feature_mos_jni.cpp
+++ b/jni_mosaic/feature_mos_jni.cpp
@@ -47,8 +47,8 @@
ImageType tImage[NR][MAX_FRAMES];// = {{ImageUtils::IMAGE_TYPE_NOIMAGE}}; // YVU24 format image
Mosaic *mosaic[NR] = {NULL,NULL};
-ImageType resultYVU = ImageUtils::IMAGE_TYPE_NOIMAGE;
-ImageType resultBGR = ImageUtils::IMAGE_TYPE_NOIMAGE;
+ImageType resultYVU = (ImageType) ImageUtils::IMAGE_TYPE_NOIMAGE;
+ImageType resultBGR = (ImageType) ImageUtils::IMAGE_TYPE_NOIMAGE;
float gTRS[11]; // 9 elements of the transformation, 1 for frame-number, 1 for alignment error code.
// Variables to keep track of the mosaic computation progress for both LR & HR.
float gProgress[NR];