diff --git a/rtdata/languages/default b/rtdata/languages/default
index fda54dd4d..832c9e264 100644
--- a/rtdata/languages/default
+++ b/rtdata/languages/default
@@ -725,6 +725,7 @@ HISTORY_MSG_490;HDR TM - Amount
HISTORY_MSG_491;White Balance
HISTORY_MSG_492;RGB Curves
HISTORY_MSG_493;L*a*b* Adjustments
+HISTORY_MSG_494;PS - Use single green
HISTORY_NEWSNAPSHOT;Add
HISTORY_NEWSNAPSHOT_TOOLTIP;Shortcut: Alt-s
HISTORY_SNAPSHOT;Snapshot
@@ -1729,7 +1730,7 @@ TP_RAW_DCBITERATIONS;Number of DCB iterations
TP_RAW_DMETHOD;Method
TP_RAW_DMETHOD_PROGRESSBAR;%1 demosaicing...
TP_RAW_DMETHOD_PROGRESSBAR_REFINE;Demosaicing refinement...
-TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files.
+TP_RAW_DMETHOD_TOOLTIP;Note: IGV and LMMSE are dedicated to high ISO images to aid in noise reduction without leading to maze patterns, posterization or a washed-out look.\nPixel Shift is for Pentax/Sony Pixel Shift files. It falls back to AMaZE for non-Pixel Shift files.
TP_RAW_EAHD;EAHD
TP_RAW_FALSECOLOR;False color suppression steps
TP_RAW_FAST;Fast
@@ -1738,7 +1739,7 @@ TP_RAW_HD_TOOLTIP;Lower values make hot/dead pixel detection more aggressive, bu
TP_RAW_HPHD;HPHD
TP_RAW_IGV;IGV
TP_RAW_IMAGENUM;Sub-image
-TP_RAW_IMAGENUM_TOOLTIP;Some raw files consist of several sub-images (Pentax Pixel Shift, Pentax 3-in-1 HDR, Canon Dual Pixel).\n\nWhen using any demosaicing method other than Pixel Shift, this selects which sub-image is used.\n\nWhen using the Pixel Shift demosaicing method on a Pixel Shift raw, all sub-images are used, and this selects which sub-image should be used for moving parts.
+TP_RAW_IMAGENUM_TOOLTIP;Some raw files consist of several sub-images (Pentax/Sony Pixel Shift, Pentax 3-in-1 HDR, Canon Dual Pixel).\n\nWhen using any demosaicing method other than Pixel Shift, this selects which sub-image is used.\n\nWhen using the Pixel Shift demosaicing method on a Pixel Shift raw, all sub-images are used, and this selects which sub-image should be used for moving parts.
TP_RAW_LABEL;Demosaicing
TP_RAW_LMMSE;LMMSE
TP_RAW_LMMSEITERATIONS;LMMSE enhancement steps
@@ -1760,6 +1761,7 @@ TP_RAW_PIXELSHIFTHOLEFILL;Fill holes in motion mask
TP_RAW_PIXELSHIFTHOLEFILL_TOOLTIP;Fill holes in motion mask
TP_RAW_PIXELSHIFTLMMSE;Use LMMSE for moving parts
TP_RAW_PIXELSHIFTLMMSE_TOOLTIP;Use LMMSE instead of AMaZE for areas of motion.\nUseful for high ISO images.
+TP_RAW_PIXELSHIFTONEGREEN_TOOLTIP;Use one green instead of averaging two greens for regions without motion.
TP_RAW_PIXELSHIFTMASKTHRESHOLD;3x3 new threshold
TP_RAW_PIXELSHIFTMEDIAN;Use median for moving parts
TP_RAW_PIXELSHIFTMEDIAN3;Exclude selected frame from median
@@ -1778,6 +1780,7 @@ TP_RAW_PIXELSHIFTNONGREENCROSS2;Check green AMaZE
TP_RAW_PIXELSHIFTNONGREENHORIZONTAL;Check red/blue horizontal
TP_RAW_PIXELSHIFTNONGREENVERTICAL;Check red/blue vertical
TP_RAW_PIXELSHIFTNREADISO;nRead
+TP_RAW_PIXELSHIFTONEGREEN;Use one green instead of average
TP_RAW_PIXELSHIFTPRNU;PRNU (%)
TP_RAW_PIXELSHIFTREDBLUEWEIGHT;Red&Blue weight
TP_RAW_PIXELSHIFTSHOWMOTION;Show motion mask
diff --git a/rtdata/profiles/Pentax Pixel Shift/PS ISO High.pp3 b/rtdata/profiles/Pixel Shift/PS ISO High.pp3
similarity index 100%
rename from rtdata/profiles/Pentax Pixel Shift/PS ISO High.pp3
rename to rtdata/profiles/Pixel Shift/PS ISO High.pp3
diff --git a/rtdata/profiles/Pentax Pixel Shift/PS ISO Low.pp3 b/rtdata/profiles/Pixel Shift/PS ISO Low.pp3
similarity index 100%
rename from rtdata/profiles/Pentax Pixel Shift/PS ISO Low.pp3
rename to rtdata/profiles/Pixel Shift/PS ISO Low.pp3
diff --git a/rtdata/profiles/Pentax Pixel Shift/PS ISO Medium.pp3 b/rtdata/profiles/Pixel Shift/PS ISO Medium.pp3
similarity index 100%
rename from rtdata/profiles/Pentax Pixel Shift/PS ISO Medium.pp3
rename to rtdata/profiles/Pixel Shift/PS ISO Medium.pp3
diff --git a/rtdata/profiles/Pentax Pixel Shift/PS No Motion.pp3 b/rtdata/profiles/Pixel Shift/PS No Motion.pp3
similarity index 100%
rename from rtdata/profiles/Pentax Pixel Shift/PS No Motion.pp3
rename to rtdata/profiles/Pixel Shift/PS No Motion.pp3
diff --git a/rtengine/camconst.json b/rtengine/camconst.json
index 5a3a18fd1..610a22310 100644
--- a/rtengine/camconst.json
+++ b/rtengine/camconst.json
@@ -2285,6 +2285,13 @@ Camera constants:
"ranges": { "black": 800, "white": 16300 }
},
+ { // Quality C,
+ "make_model": "Sony ILCE-7RM3",
+ "dcraw_matrix": [ 6640,-1847,-503,-5238,13010,2474,-993,1673,6527 ], // DNG_v10.1 D65
+ "raw_crop": [ 0, 0, -36, 0 ], // full raw frame 8000x5320 - 36 rightmost columns are garbage
+ "ranges": { "black": 512, "white": 16300 }
+ },
+
{ // Quality C, No proper color data, beta samples, frame set to official jpeg,
"make_model": [ "XIAOYI M1", "YI TECHNOLOGY M1" ],
"dcraw_matrix": [ 7158,-1911,-606,-3603,10669,2530,-659,1236,5530 ], // XIAO YI DNG D65
diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc
index 9ae313530..75891c589 100644
--- a/rtengine/dcraw.cc
+++ b/rtengine/dcraw.cc
@@ -2349,6 +2349,37 @@ void CLASS unpacked_load_raw()
&& (unsigned) (col-left_margin) < width) derror();
}
+
+// RT
+void CLASS sony_arq_load_raw()
+{
+ static unsigned frame2pos[] = { 0, 1, 3, 2 };
+ int row, col, bits=0;
+ ushort samples[4];
+ unsigned frame = frame2pos[shot_select];
+
+ while (1 << ++bits < maximum);
+ for (row=0; row < ((frame < 2) ? 1 : raw_height); row++) {
+ for (col=0; col < ((row == 0) ? raw_width : 1); col++) {
+ RAW(row,col) = 0;
+ }
+ }
+ for (row=0; row < raw_height; row++) {
+ int r = row + (frame & 1);
+ for (col=0; col < raw_width; col++) {
+ int c = col + ((frame >> 1) & 1);
+ read_shorts(samples, 4);
+ if (r < raw_height && c < raw_width) {
+ RAW(r,c) = samples[(2 * (r & 1)) + (c & 1)];
+ if ((RAW(r,c) >>= load_flags) >> bits
+ && (unsigned) (row-top_margin) < height
+ && (unsigned) (col-left_margin) < width) derror();
+ }
+ }
+ }
+}
+
+
void CLASS sinar_4shot_load_raw()
{
ushort *pixel;
@@ -6524,6 +6555,17 @@ void CLASS apply_tiff()
if (!strncmp(make,"OLYMPUS",7) &&
tiff_ifd[raw].bytes*7 > raw_width*raw_height)
load_raw = &CLASS olympus_load_raw;
+ // ------- RT -------
+ if (!strncmp(make,"SONY",4) &&
+ !strncmp(model,"ILCE-7RM3",9) &&
+ tiff_samples == 4 &&
+ tiff_ifd[raw].bytes == raw_width*raw_height*tiff_samples*2) {
+ load_raw = &CLASS sony_arq_load_raw;
+ colors = 3;
+ is_raw = 4;
+ filters = 0x94949494;
+ }
+ // ------------------
}
break;
case 6: case 7: case 99:
diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h
index 0a10f9732..5a2790801 100644
--- a/rtengine/dcraw.h
+++ b/rtengine/dcraw.h
@@ -409,6 +409,7 @@ sony_decrypt_t sony_decrypt;
void sony_load_raw();
void sony_arw_load_raw();
void sony_arw2_load_raw();
+void sony_arq_load_raw(); // RT
void smal_decode_segment (unsigned seg[2][2], int holes);
void smal_v6_load_raw();
diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc
index 47688fca6..f3516e5a8 100644
--- a/rtengine/imagedata.cc
+++ b/rtengine/imagedata.cc
@@ -473,7 +473,7 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
// ----------------------- Special file type detection (HDR, PixelShift) ------------------------
- uint16 bitspersample = 0, sampleformat = 0, photometric = 0, compression = 0;
+ uint16 bitspersample = 0, samplesperpixel = 0, sampleformat = 0, photometric = 0, compression = 0;
rtexif::Tag* bps = frameRootDir->findTag("BitsPerSample");
rtexif::Tag* spp = frameRootDir->findTag("SamplesPerPixel");
rtexif::Tag* sf = frameRootDir->findTag("SampleFormat");
@@ -535,6 +535,7 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
}
bitspersample = bps->toInt();
+ samplesperpixel = spp->toInt();
photometric = pi->toInt();
if (photometric == PHOTOMETRIC_LOGLUV) {
@@ -582,6 +583,26 @@ FrameData::FrameData (rtexif::TagDirectory* frameRootDir_, rtexif::TagDirectory*
sampleFormat = IIOSF_UNSIGNED_SHORT;
}
}
+ } else if (photometric == 34892 || photometric == 32892 /* Linear RAW (see DNG spec ; 32892 seem to be a flaw from Sony's ARQ files) */) {
+ if (sampleformat == SAMPLEFORMAT_IEEEFP) {
+ sampleFormat = IIOSF_FLOAT;
+ isHDR = true;
+#if PRINT_HDR_PS_DETECTION
+ printf("HDR detected ! -> sampleFormat = %d\n", sampleFormat);
+#endif
+ } else if (sampleformat == SAMPLEFORMAT_INT || sampleformat == SAMPLEFORMAT_UINT) {
+ if (bitspersample == 8) { // shouldn't occur...
+ sampleFormat = IIOSF_UNSIGNED_CHAR;
+ } else if (bitspersample <= 16) {
+ sampleFormat = IIOSF_UNSIGNED_SHORT;
+ if (mnote && (!make.compare (0, 4, "SONY")) && bitspersample >= 12 && samplesperpixel == 4) {
+ isPixelShift = true;
+#if PRINT_HDR_PS_DETECTION
+ printf("PixelShift detected ! -> \"Make\" = SONY, bitsPerPixel > 8, samplesPerPixel == 4\n");
+#endif
+ }
+ }
+ }
} else if (photometric == PHOTOMETRIC_LOGLUV) {
if (compression == COMPRESSION_SGILOG24) {
sampleFormat = IIOSF_LOGLUV24;
@@ -764,7 +785,7 @@ FrameData *FramesData::getFrameData (unsigned int frame) const
bool FramesData::getPixelShift (unsigned int frame) const
{
- // So far only Pentax provide multi-frame HDR file.
+ // So far only Pentax and Sony provide multi-frame HDR file.
// Only the first frame contains the HDR tag
// If more brand have to be supported, this rule may need
// to evolve
diff --git a/rtengine/pixelshift.cc b/rtengine/pixelshift.cc
index 256aaaf63..511e4c95d 100644
--- a/rtengine/pixelshift.cc
+++ b/rtengine/pixelshift.cc
@@ -1,6 +1,6 @@
////////////////////////////////////////////////////////////////
//
-// Algorithm for Pentax Pixel Shift raw files with motion detection
+// Algorithm for Pentax/Sony Pixel Shift raw files with motion detection
//
// Copyright (C) 2016 - 2017 Ingo Weyrich
//
@@ -294,12 +294,11 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUTsetProgressStr(Glib::ustring::compose(M("TP_RAW_DMETHOD_PROGRESSBAR"), RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT)));
plistener->setProgress(0.0);
@@ -531,6 +566,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
} else if(model.find("K-1") != string::npos) {
nRead = nReadK1[nReadIndex];
eperIsoModel = ePerIsoK1;
+ } else if(model.find("ILCE-7RM3") != string::npos) {
+ nRead = nReadILCE7RM3[nReadIndex];
+ eperIsoModel = ePerIsoILCE7RM3;
} else { // as long as we don't have values for Pentax KP, we use the values from K-70
nRead = nReadK70[nReadIndex];
eperIsoModel = ePerIsoK70;
@@ -887,11 +925,25 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
const float blend = smoothFactor == 0.f ? 1.f : pow_F(std::max(psMask[i][j] - 1.f, 0.f), smoothFactor);
#endif
redDest[j + offsX] = intp(blend, redDest[j + offsX], psRed[i][j] );
- greenDest[j + offsX] = intp(blend, greenDest[j + offsX], ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f);
+ if(bayerParams.pixelShiftOneGreen) {
+ int greenFrame = (1 - offset != 0) ? 1 - offset : 3 - offset;
+ int greenJ = (1 - offset != 0) ? j : j + 1;
+ int greenI = (1 - offset != 0) ? i - offset + 1 : i + offset;
+ greenDest[j + offsX] = intp(blend, greenDest[j + offsX], (*rawDataFrames[greenFrame])[greenI][greenJ] * greenBrightness[greenFrame]);
+ } else {
+ greenDest[j + offsX] = intp(blend, greenDest[j + offsX], ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f);
+ }
blueDest[j + offsX] = intp(blend, blueDest[j + offsX], psBlue[i][j]);
} else {
redDest[j + offsX] = psRed[i][j];
- greenDest[j + offsX] = ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f;
+ if(bayerParams.pixelShiftOneGreen) {
+ int greenFrame = (1 - offset != 0) ? 1 - offset : 3 - offset;
+ int greenJ = (1 - offset != 0) ? j : j + 1;
+ int greenI = (1 - offset != 0) ? i - offset + 1 : i + offset;
+ greenDest[j + offsX] = (*rawDataFrames[greenFrame])[greenI][greenJ] * greenBrightness[greenFrame];
+ } else {
+ greenDest[j + offsX] = ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f;
+ }
blueDest[j + offsX] = psBlue[i][j];
}
}
@@ -924,7 +976,14 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA
for(; j < winw - 1; ++j) {
// set red, green and blue values
- green[i][j] = ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f;
+ if(bayerParams.pixelShiftOneGreen) {
+ int greenFrame = (1 - offset != 0) ? 1 - offset : 3 - offset;
+ int greenJ = (1 - offset != 0) ? j : j + 1;
+ int greenI = (1 - offset != 0) ? i - offset + 1 : i + offset;
+ green[i][j] = (*rawDataFrames[greenFrame])[greenI][greenJ] * greenBrightness[greenFrame];
+ } else {
+ green[i][j] = ((*rawDataFrames[1 - offset])[i - offset + 1][j] * greenBrightness[1 - offset] + (*rawDataFrames[3 - offset])[i + offset][j + 1] * greenBrightness[3 - offset]) * 0.5f;
+ }
nonGreenDest0[j] = (*rawDataFrames[(offset << 1) + offset])[i][j + offset] * ngbright[ng][(offset << 1) + offset];
nonGreenDest1[j] = (*rawDataFrames[2 - offset])[i + 1][j - offset + 1] * ngbright[ng ^ 1][2 - offset];
offset ^= 1; // 0 => 1 or 1 => 0
diff --git a/rtengine/procevents.h b/rtengine/procevents.h
index f4dfd7dfb..b4bb6be73 100644
--- a/rtengine/procevents.h
+++ b/rtengine/procevents.h
@@ -520,6 +520,7 @@ enum ProcEvent {
EvWBEnabled = 490,
EvRGBEnabled = 491,
EvLEnabled = 492,
+ EvPixelShiftOneGreen = 493,
NUMOFEVENTS
diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc
index ccdafec5c..64a3fc67f 100644
--- a/rtengine/procparams.cc
+++ b/rtengine/procparams.cc
@@ -2353,6 +2353,7 @@ RAWParams::BayerSensor::BayerSensor() :
pixelShiftSmoothFactor(0.7),
pixelShiftExp0(false),
pixelShiftLmmse(false),
+ pixelShiftOneGreen(false),
pixelShiftEqualBright(false),
pixelShiftEqualBrightChannel(false),
pixelShiftNonGreenCross(true),
@@ -2402,6 +2403,7 @@ bool RAWParams::BayerSensor::operator ==(const BayerSensor& other) const
&& pixelShiftSmoothFactor == other.pixelShiftSmoothFactor
&& pixelShiftExp0 == other.pixelShiftExp0
&& pixelShiftLmmse == other.pixelShiftLmmse
+ && pixelShiftOneGreen == other.pixelShiftOneGreen
&& pixelShiftEqualBright == other.pixelShiftEqualBright
&& pixelShiftEqualBrightChannel == other.pixelShiftEqualBrightChannel
&& pixelShiftNonGreenCross == other.pixelShiftNonGreenCross
@@ -2440,6 +2442,7 @@ void RAWParams::BayerSensor::setPixelShiftDefaults()
pixelShiftSmoothFactor = 0.7;
pixelShiftExp0 = false;
pixelShiftLmmse = false;
+ pixelShiftOneGreen = false;
pixelShiftEqualBright = false;
pixelShiftEqualBrightChannel = false;
pixelShiftNonGreenCross = true;
@@ -3335,6 +3338,7 @@ int ProcParams::save(const Glib::ustring& fname, const Glib::ustring& fname2, bo
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftSmooth, "RAW Bayer", "pixelShiftSmoothFactor", raw.bayersensor.pixelShiftSmoothFactor, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftExp0, "RAW Bayer", "pixelShiftExp0", raw.bayersensor.pixelShiftExp0, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftLmmse, "RAW Bayer", "pixelShiftLmmse", raw.bayersensor.pixelShiftLmmse, keyFile);
+ saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftOneGreen, "RAW Bayer", "pixelShiftOneGreen", raw.bayersensor.pixelShiftOneGreen, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEqualBright, "RAW Bayer", "pixelShiftEqualBright", raw.bayersensor.pixelShiftEqualBright, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftEqualBrightChannel, "RAW Bayer", "pixelShiftEqualBrightChannel", raw.bayersensor.pixelShiftEqualBrightChannel, keyFile);
saveToKeyfile(!pedited || pedited->raw.bayersensor.pixelShiftNonGreenCross, "RAW Bayer", "pixelShiftNonGreenCross", raw.bayersensor.pixelShiftNonGreenCross, keyFile);
@@ -4627,6 +4631,7 @@ int ProcParams::load(const Glib::ustring& fname, ParamsEdited* pedited)
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftSmoothFactor", pedited, raw.bayersensor.pixelShiftSmoothFactor, pedited->raw.bayersensor.pixelShiftSmooth);
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftExp0", pedited, raw.bayersensor.pixelShiftExp0, pedited->raw.bayersensor.pixelShiftExp0);
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftLmmse", pedited, raw.bayersensor.pixelShiftLmmse, pedited->raw.bayersensor.pixelShiftLmmse);
+ assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftOneGreen", pedited, raw.bayersensor.pixelShiftOneGreen, pedited->raw.bayersensor.pixelShiftOneGreen);
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftEqualBright", pedited, raw.bayersensor.pixelShiftEqualBright, pedited->raw.bayersensor.pixelShiftEqualBright);
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftEqualBrightChannel", pedited, raw.bayersensor.pixelShiftEqualBrightChannel, pedited->raw.bayersensor.pixelShiftEqualBrightChannel);
assignFromKeyfile(keyFile, "RAW Bayer", "pixelShiftNonGreenCross", pedited, raw.bayersensor.pixelShiftNonGreenCross, pedited->raw.bayersensor.pixelShiftNonGreenCross);
diff --git a/rtengine/procparams.h b/rtengine/procparams.h
index 39d84ac12..6c95b3a7f 100644
--- a/rtengine/procparams.h
+++ b/rtengine/procparams.h
@@ -1244,6 +1244,7 @@ struct RAWParams {
double pixelShiftSmoothFactor;
bool pixelShiftExp0;
bool pixelShiftLmmse;
+ bool pixelShiftOneGreen;
bool pixelShiftEqualBright;
bool pixelShiftEqualBrightChannel;
bool pixelShiftNonGreenCross;
diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc
index bcc16d5cb..d8fba268a 100644
--- a/rtengine/rawimagesource.cc
+++ b/rtengine/rawimagesource.cc
@@ -2036,7 +2036,7 @@ void RawImageSource::demosaic(const RAWParams &raw)
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::AMAZE) ) {
amaze_demosaic_RT (0, 0, W, H, rawData, red, green, blue);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::PIXELSHIFT) ) {
- pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_model(), raw.expos);
+ pixelshift(0, 0, W, H, raw.bayersensor, currFrame, ri->get_maker(), ri->get_model(), raw.expos);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::DCB) ) {
dcb_demosaic(raw.bayersensor.dcb_iterations, raw.bayersensor.dcb_enhance);
} else if (raw.bayersensor.method == RAWParams::BayerSensor::getMethodString(RAWParams::BayerSensor::Method::EAHD)) {
diff --git a/rtengine/rawimagesource.h b/rtengine/rawimagesource.h
index 4924b955a..d1496d4fd 100644
--- a/rtengine/rawimagesource.h
+++ b/rtengine/rawimagesource.h
@@ -269,7 +269,7 @@ protected:
void xtransborder_interpolate (int border);
void xtrans_interpolate (const int passes, const bool useCieLab);
void fast_xtrans_interpolate ();
- void pixelshift(int winx, int winy, int winw, int winh, const RAWParams::BayerSensor &bayerParams, unsigned int frame, const std::string &model, float rawWpCorrection);
+ void pixelshift(int winx, int winy, int winw, int winh, const RAWParams::BayerSensor &bayerParams, unsigned int frame, const std::string &make, const std::string &model, float rawWpCorrection);
void hflip (Imagefloat* im);
void vflip (Imagefloat* im);
void getRawValues(int x, int y, int rotate, int &R, int &G, int &B);
diff --git a/rtengine/refreshmap.cc b/rtengine/refreshmap.cc
index 6105bb508..06879fb26 100644
--- a/rtengine/refreshmap.cc
+++ b/rtengine/refreshmap.cc
@@ -519,6 +519,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
HDR, // EvTMFattalAmount
ALLNORAW, // EvWBEnabled
RGBCURVE, // EvRGBEnabled
- LUMINANCECURVE // EvLEnabled
+ LUMINANCECURVE, // EvLEnabled
+ DEMOSAIC // EvPixelShiftOneGreen
};
diff --git a/rtengine/rtengine.h b/rtengine/rtengine.h
index edf903352..5c1343cc3 100644
--- a/rtengine/rtengine.h
+++ b/rtengine/rtengine.h
@@ -119,7 +119,7 @@ public:
/** @return the orientation of the image */
virtual std::string getOrientation (unsigned int frame = 0) const = 0;
- /** @return true if the file is a PixelShift shot (Pentax bodies) */
+ /** @return true if the file is a PixelShift shot (Pentax and Sony bodies) */
virtual bool getPixelShift (unsigned int frame = 0) const = 0;
/** @return false: not an HDR file ; true: single or multi-frame HDR file (e.g. Pentax HDR raw file or 32 bit float DNG file or Log compressed) */
virtual bool getHDR (unsigned int frame = 0) const = 0;
diff --git a/rtgui/bayerprocess.cc b/rtgui/bayerprocess.cc
index 9df7c106d..b294c9fee 100644
--- a/rtgui/bayerprocess.cc
+++ b/rtgui/bayerprocess.cc
@@ -225,6 +225,11 @@ BayerProcess::BayerProcess () : FoldableToolPanel(this, "bayerprocess", M("TP_RA
pixelShiftLmmse->set_tooltip_text (M("TP_RAW_PIXELSHIFTLMMSE_TOOLTIP"));
pixelShiftOptions->pack_start(*pixelShiftLmmse);
+// pixelShiftOneGreen = Gtk::manage (new CheckBox(M("TP_RAW_PIXELSHIFTONEGREEN"), multiImage));
+// pixelShiftOneGreen->setCheckBoxListener (this);
+// pixelShiftOneGreen->set_tooltip_text (M("TP_RAW_PIXELSHIFTONEGREEN_TOOLTIP"));
+// pixelShiftOptions->pack_start(*pixelShiftOneGreen);
+
#ifdef PIXELSHIFTDEV
pixelShiftMotion = Gtk::manage (new Adjuster (M("TP_RAW_PIXELSHIFTMOTION"), 0, 100, 1, 70));
pixelShiftMotion->setAdjusterListener (this);
@@ -376,6 +381,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
}
pixelShiftSmooth->setValue (pp->raw.bayersensor.pixelShiftSmoothFactor);
pixelShiftLmmse->setValue (pp->raw.bayersensor.pixelShiftLmmse);
+// pixelShiftOneGreen->setValue (pp->raw.bayersensor.pixelShiftOneGreen);
pixelShiftEqualBright->setValue (pp->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->set_sensitive (pp->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->setValue (pp->raw.bayersensor.pixelShiftEqualBrightChannel);
@@ -427,6 +433,7 @@ void BayerProcess::read(const rtengine::procparams::ProcParams* pp, const Params
pixelShiftBlur->setEdited (pedited->raw.bayersensor.pixelShiftBlur);
pixelShiftSmooth->setEditedState ( pedited->raw.bayersensor.pixelShiftSmooth ? Edited : UnEdited);
pixelShiftLmmse->setEdited (pedited->raw.bayersensor.pixelShiftLmmse);
+// pixelShiftOneGreen->setEdited (pedited->raw.bayersensor.pixelShiftOneGreen);
pixelShiftEqualBright->setEdited (pedited->raw.bayersensor.pixelShiftEqualBright);
pixelShiftEqualBrightChannel->setEdited (pedited->raw.bayersensor.pixelShiftEqualBrightChannel);
pixelShiftNonGreenCross->setEdited (pedited->raw.bayersensor.pixelShiftNonGreenCross);
@@ -531,6 +538,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pp->raw.bayersensor.pixelShiftBlur = pixelShiftBlur->getLastActive ();
pp->raw.bayersensor.pixelShiftSmoothFactor = pixelShiftSmooth->getValue();
pp->raw.bayersensor.pixelShiftLmmse = pixelShiftLmmse->getLastActive ();
+// pp->raw.bayersensor.pixelShiftOneGreen = pixelShiftOneGreen->getLastActive ();
pp->raw.bayersensor.pixelShiftEqualBright = pixelShiftEqualBright->getLastActive ();
pp->raw.bayersensor.pixelShiftEqualBrightChannel = pixelShiftEqualBrightChannel->getLastActive ();
pp->raw.bayersensor.pixelShiftNonGreenCross = pixelShiftNonGreenCross->getLastActive ();
@@ -583,6 +591,7 @@ void BayerProcess::write( rtengine::procparams::ProcParams* pp, ParamsEdited* pe
pedited->raw.bayersensor.pixelShiftBlur = !pixelShiftBlur->get_inconsistent();
pedited->raw.bayersensor.pixelShiftSmooth = pixelShiftSmooth->getEditedState();
pedited->raw.bayersensor.pixelShiftLmmse = !pixelShiftLmmse->get_inconsistent();
+// pedited->raw.bayersensor.pixelShiftOneGreen = !pixelShiftOneGreen->get_inconsistent();
pedited->raw.bayersensor.pixelShiftEqualBright = !pixelShiftEqualBright->get_inconsistent();
pedited->raw.bayersensor.pixelShiftEqualBrightChannel = !pixelShiftEqualBrightChannel->get_inconsistent();
pedited->raw.bayersensor.pixelShiftNonGreenCross = !pixelShiftNonGreenCross->get_inconsistent();
@@ -849,6 +858,10 @@ void BayerProcess::checkBoxToggled (CheckBox* c, CheckValue newval)
if (listener) {
listener->panelChanged (EvPixelShiftLmmse, pixelShiftLmmse->getValueAsStr ());
}
+// } else if (c == pixelShiftOneGreen) {
+// if (listener) {
+// listener->panelChanged (EvPixelShiftOneGreen, pixelShiftOneGreen->getValueAsStr ());
+// }
} else if (c == pixelShiftEqualBright) {
if (!batchMode) {
pixelShiftEqualBrightChannel->set_sensitive(newval != CheckValue::off);
diff --git a/rtgui/bayerprocess.h b/rtgui/bayerprocess.h
index 6d9dd6062..e1a620474 100644
--- a/rtgui/bayerprocess.h
+++ b/rtgui/bayerprocess.h
@@ -49,6 +49,7 @@ protected:
CheckBox* pixelShiftBlur;
CheckBox* pixelShiftHoleFill;
CheckBox* pixelShiftMedian;
+// CheckBox* pixelShiftOneGreen;
CheckBox* pixelShiftLmmse;
CheckBox* pixelShiftEqualBright;
CheckBox* pixelShiftEqualBrightChannel;
diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc
index 391438cd6..ea29079a0 100644
--- a/rtgui/paramsedited.cc
+++ b/rtgui/paramsedited.cc
@@ -415,6 +415,7 @@ void ParamsEdited::set (bool v)
raw.bayersensor.pixelShiftSmooth = v;
raw.bayersensor.pixelShiftExp0 = v;
raw.bayersensor.pixelShiftLmmse = v;
+ raw.bayersensor.pixelShiftOneGreen = v;
raw.bayersensor.pixelShiftEqualBright = v;
raw.bayersensor.pixelShiftEqualBrightChannel = v;
raw.bayersensor.pixelShiftNonGreenCross = v;
@@ -962,6 +963,7 @@ void ParamsEdited::initFrom (const std::vector
raw.bayersensor.pixelShiftSmooth = raw.bayersensor.pixelShiftSmooth && p.raw.bayersensor.pixelShiftSmoothFactor == other.raw.bayersensor.pixelShiftSmoothFactor;
raw.bayersensor.pixelShiftExp0 = raw.bayersensor.pixelShiftExp0 && p.raw.bayersensor.pixelShiftExp0 == other.raw.bayersensor.pixelShiftExp0;
raw.bayersensor.pixelShiftLmmse = raw.bayersensor.pixelShiftLmmse && p.raw.bayersensor.pixelShiftLmmse == other.raw.bayersensor.pixelShiftLmmse;
+ raw.bayersensor.pixelShiftOneGreen = raw.bayersensor.pixelShiftOneGreen && p.raw.bayersensor.pixelShiftOneGreen == other.raw.bayersensor.pixelShiftOneGreen;
raw.bayersensor.pixelShiftEqualBright = raw.bayersensor.pixelShiftEqualBright && p.raw.bayersensor.pixelShiftEqualBright == other.raw.bayersensor.pixelShiftEqualBright;
raw.bayersensor.pixelShiftEqualBrightChannel = raw.bayersensor.pixelShiftEqualBrightChannel && p.raw.bayersensor.pixelShiftEqualBrightChannel == other.raw.bayersensor.pixelShiftEqualBrightChannel;
raw.bayersensor.pixelShiftNonGreenCross = raw.bayersensor.pixelShiftNonGreenCross && p.raw.bayersensor.pixelShiftNonGreenCross == other.raw.bayersensor.pixelShiftNonGreenCross;
@@ -2549,6 +2551,10 @@ void ParamsEdited::combine (rtengine::procparams::ProcParams& toEdit, const rten
toEdit.raw.bayersensor.pixelShiftLmmse = mods.raw.bayersensor.pixelShiftLmmse;
}
+ if (raw.bayersensor.pixelShiftOneGreen) {
+ toEdit.raw.bayersensor.pixelShiftOneGreen = mods.raw.bayersensor.pixelShiftOneGreen;
+ }
+
if (raw.bayersensor.pixelShiftEqualBright) {
toEdit.raw.bayersensor.pixelShiftEqualBright = mods.raw.bayersensor.pixelShiftEqualBright;
}
@@ -3081,7 +3087,7 @@ bool RAWParamsEdited::BayerSensor::isUnchanged() const
return method && imageNum && dcbIterations && dcbEnhance && lmmseIterations/*&& allEnhance*/ && greenEq
&& pixelShiftMotion && pixelShiftMotionCorrection && pixelShiftMotionCorrectionMethod && pixelShiftStddevFactorGreen && pixelShiftStddevFactorRed && pixelShiftStddevFactorBlue && pixelShiftEperIso
&& pixelShiftNreadIso && pixelShiftPrnu && pixelShiftSigma && pixelShiftSum && pixelShiftRedBlueWeight && pixelShiftShowMotion && pixelShiftShowMotionMaskOnly
- && pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftExp0 && pixelShiftLmmse && pixelShiftEqualBright && pixelShiftEqualBrightChannel
+ && pixelShiftAutomatic && pixelShiftNonGreenHorizontal && pixelShiftNonGreenVertical && pixelShiftHoleFill && pixelShiftMedian && pixelShiftMedian3 && pixelShiftNonGreenCross && pixelShiftNonGreenCross2 && pixelShiftNonGreenAmaze && pixelShiftGreen && pixelShiftBlur && pixelShiftSmooth && pixelShiftExp0 && pixelShiftLmmse && pixelShiftOneGreen && pixelShiftEqualBright && pixelShiftEqualBrightChannel
&& linenoise && exBlack0 && exBlack1 && exBlack2 && exBlack3 && exTwoGreen;
}
diff --git a/rtgui/paramsedited.h b/rtgui/paramsedited.h
index fcb3a0b49..2727f01ec 100644
--- a/rtgui/paramsedited.h
+++ b/rtgui/paramsedited.h
@@ -737,6 +737,7 @@ public:
bool pixelShiftSmooth;
bool pixelShiftExp0;
bool pixelShiftLmmse;
+ bool pixelShiftOneGreen;
bool pixelShiftEqualBright;
bool pixelShiftEqualBrightChannel;
bool pixelShiftNonGreenCross;