Fix compile warnings in pixelshift.cc
This commit is contained in:
@@ -456,9 +456,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
const int motion = bayerParams.pixelShiftMotion;
|
const int motion = bayerParams.pixelShiftMotion;
|
||||||
const bool showMotion = bayerParams.pixelShiftShowMotion;
|
const bool showMotion = bayerParams.pixelShiftShowMotion;
|
||||||
const bool showOnlyMask = bayerParams.pixelShiftShowMotionMaskOnly && showMotion;
|
const bool showOnlyMask = bayerParams.pixelShiftShowMotionMaskOnly && showMotion;
|
||||||
const RAWParams::BayerSensor::ePSMotionCorrection gridSize_ = bayerParams.pixelShiftMotionCorrection;
|
|
||||||
const bool adaptive = bayerParams.pixelShiftAutomatic;
|
const bool adaptive = bayerParams.pixelShiftAutomatic;
|
||||||
#ifdef PIXELSHIFTDEV
|
#ifdef PIXELSHIFTDEV
|
||||||
|
const RAWParams::BayerSensor::ePSMotionCorrection gridSize_ = bayerParams.pixelShiftMotionCorrection;
|
||||||
const bool detectMotion = bayerParams.pixelShiftMotion > 0;
|
const bool detectMotion = bayerParams.pixelShiftMotion > 0;
|
||||||
float stddevFactorGreen = bayerParams.pixelShiftStddevFactorGreen;
|
float stddevFactorGreen = bayerParams.pixelShiftStddevFactorGreen;
|
||||||
float stddevFactorRed = bayerParams.pixelShiftStddevFactorRed;
|
float stddevFactorRed = bayerParams.pixelShiftStddevFactorRed;
|
||||||
@@ -475,25 +475,25 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
const float redBlueWeight = 0.7f + 1.f;
|
const float redBlueWeight = 0.7f + 1.f;
|
||||||
#endif
|
#endif
|
||||||
float eperIso = bayerParams.pixelShiftEperIso;
|
float eperIso = bayerParams.pixelShiftEperIso;
|
||||||
const bool checkNonGreenHorizontal = bayerParams.pixelShiftNonGreenHorizontal;
|
|
||||||
const bool checkNonGreenVertical = bayerParams.pixelShiftNonGreenVertical;
|
|
||||||
const bool checkNonGreenCross = bayerParams.pixelShiftNonGreenCross;
|
const bool checkNonGreenCross = bayerParams.pixelShiftNonGreenCross;
|
||||||
const bool checkNonGreenAmaze = bayerParams.pixelShiftNonGreenAmaze;
|
|
||||||
const bool checkNonGreenCross2 = bayerParams.pixelShiftNonGreenCross2;
|
|
||||||
const bool checkGreen = bayerParams.pixelShiftGreen;
|
const bool checkGreen = bayerParams.pixelShiftGreen;
|
||||||
const float greenWeight = 2.f;
|
const float greenWeight = 2.f;
|
||||||
const bool blurMap = bayerParams.pixelShiftBlur;
|
const bool blurMap = bayerParams.pixelShiftBlur;
|
||||||
const float sigma = bayerParams.pixelShiftSigma;
|
const float sigma = bayerParams.pixelShiftSigma;
|
||||||
#ifdef PIXELSHIFTDEV
|
#ifdef PIXELSHIFTDEV
|
||||||
|
const bool checkNonGreenHorizontal = bayerParams.pixelShiftNonGreenHorizontal;
|
||||||
|
const bool checkNonGreenVertical = bayerParams.pixelShiftNonGreenVertical;
|
||||||
|
const bool checkNonGreenAmaze = bayerParams.pixelShiftNonGreenAmaze;
|
||||||
|
const bool checkNonGreenCross2 = bayerParams.pixelShiftNonGreenCross2;
|
||||||
const float threshold = bayerParams.pixelShiftSum + 9.f;
|
const float threshold = bayerParams.pixelShiftSum + 9.f;
|
||||||
|
const bool experimental0 = bayerParams.pixelShiftExp0;
|
||||||
|
const bool automatic = bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic;
|
||||||
#else
|
#else
|
||||||
constexpr float threshold = 3.f + 9.f;
|
constexpr float threshold = 3.f + 9.f;
|
||||||
#endif
|
#endif
|
||||||
const bool experimental0 = bayerParams.pixelShiftExp0;
|
|
||||||
const bool holeFill = bayerParams.pixelShiftHoleFill;
|
const bool holeFill = bayerParams.pixelShiftHoleFill;
|
||||||
const bool equalBrightness = bayerParams.pixelShiftEqualBright;
|
const bool equalBrightness = bayerParams.pixelShiftEqualBright;
|
||||||
const bool smoothTransitions = blurMap && bayerParams.pixelShiftSmoothFactor > 0. && !showOnlyMask;
|
const bool smoothTransitions = blurMap && bayerParams.pixelShiftSmoothFactor > 0. && !showOnlyMask;
|
||||||
const bool automatic = bayerParams.pixelShiftMotionCorrectionMethod == RAWParams::BayerSensor::Automatic;
|
|
||||||
const float smoothFactor = 1.0 - bayerParams.pixelShiftSmoothFactor;
|
const float smoothFactor = 1.0 - bayerParams.pixelShiftSmoothFactor;
|
||||||
|
|
||||||
static const float nReadK3II[] = { 3.4f, // ISO 100
|
static const float nReadK3II[] = { 3.4f, // ISO 100
|
||||||
@@ -606,8 +606,10 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef PIXELSHIFTDEV
|
||||||
const bool skip = (gridSize_ == RAWParams::BayerSensor::ePSMotionCorrection::Grid1x2);
|
const bool skip = (gridSize_ == RAWParams::BayerSensor::ePSMotionCorrection::Grid1x2);
|
||||||
int gridSize = 1;
|
int gridSize = 1;
|
||||||
|
|
||||||
bool nOf3x3 = false;
|
bool nOf3x3 = false;
|
||||||
|
|
||||||
switch (gridSize_) {
|
switch (gridSize_) {
|
||||||
@@ -632,6 +634,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
gridSize = 1;
|
gridSize = 1;
|
||||||
nOf3x3 = true;
|
nOf3x3 = true;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
const bool nOf3x3 = true;
|
||||||
|
#endif
|
||||||
|
|
||||||
if(adaptive && blurMap && nOf3x3 && smoothFactor == 0.f && !showMotion) {
|
if(adaptive && blurMap && nOf3x3 && smoothFactor == 0.f && !showMotion) {
|
||||||
if(plistener) {
|
if(plistener) {
|
||||||
@@ -707,9 +712,10 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
// If the values of two corresponding green pixels differ my more then motionThreshold %, the pixel will be treated as a badGreen pixel
|
// If the values of two corresponding green pixels differ my more then motionThreshold %, the pixel will be treated as a badGreen pixel
|
||||||
const float motionThreshold = 1.f - (motion / 100.f);
|
const float motionThreshold = 1.f - (motion / 100.f);
|
||||||
// For shades of green motion indicators
|
// For shades of green motion indicators
|
||||||
|
#ifdef PIXELSHIFTDEV
|
||||||
const float blendFactor = ((adaptive || motion == 0.f) ? 1.f : 1.f / (1.f - motionThreshold));
|
const float blendFactor = ((adaptive || motion == 0.f) ? 1.f : 1.f / (1.f - motionThreshold));
|
||||||
|
#endif
|
||||||
unsigned int offsX = 0, offsY = 0;
|
int offsX = 0, offsY = 0;
|
||||||
|
|
||||||
if(!bayerParams.pixelShiftMedian || !adaptive) {
|
if(!bayerParams.pixelShiftMedian || !adaptive) {
|
||||||
// We have to adjust the offsets for the selected subframe we use for areas with motion
|
// We have to adjust the offsets for the selected subframe we use for areas with motion
|
||||||
@@ -860,9 +866,11 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
for(int i = winy + border - offsY; i < winh - (border + offsY); ++i) {
|
for(int i = winy + border - offsY; i < winh - (border + offsY); ++i) {
|
||||||
|
#ifdef PIXELSHIFTDEV
|
||||||
float *greenDest = green[i + offsY];
|
float *greenDest = green[i + offsY];
|
||||||
float *redDest = red[i + offsY];
|
float *redDest = red[i + offsY];
|
||||||
float *blueDest = blue[i + offsY];
|
float *blueDest = blue[i + offsY];
|
||||||
|
#endif
|
||||||
int j = winx + border - offsX;
|
int j = winx + border - offsX;
|
||||||
|
|
||||||
#ifdef PIXELSHIFTDEV
|
#ifdef PIXELSHIFTDEV
|
||||||
|
Reference in New Issue
Block a user