diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 9ae313530..b843404e5 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -2349,6 +2349,35 @@ void CLASS unpacked_load_raw() && (unsigned) (col-left_margin) < width) derror(); } + +// RT +void CLASS sony_arq_load_raw() +{ + int row, col, bits=0; + ushort samples[4]; + + while (1 << ++bits < maximum); + for (row=0; row < ((shot_select < 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 + (shot_select & 1); + for (col=0; col < raw_width; col++) { + int c = col + ((shot_select >> 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 +6553,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/pixelshift.cc b/rtengine/pixelshift.cc index 256aaaf63..c2c0231a1 100644 --- a/rtengine/pixelshift.cc +++ b/rtengine/pixelshift.cc @@ -295,6 +295,43 @@ void calcFrameBrightnessFactor(unsigned int frame, uint32_t datalen, LUT *array2D_ptr; + RawDataFrameReorder(const std::string &model, array2D_ptr *rawDataFrames): + model_(model), + frames_(rawDataFrames) + { + if (model_ == "ILCE-7RM3") { + std::swap(frames_[2], frames_[3]); + } + } + + ~RawDataFrameReorder() + { + if (model_ == "ILCE-7RM3") { + std::swap(frames_[2], frames_[3]); + } + } + + unsigned int getframe(unsigned int frame) + { + if (model_ == "ILCE-7RM3") { + if (frame == 2) { + return 3; + } else if (frame == 3) { + return 2; + } + } + return frame; + } + +private: + std::string model_; + array2D_ptr *frames_; +}; + + } using namespace std; @@ -307,6 +344,9 @@ void RawImageSource::pixelshift(int winx, int winy, int winw, int winh, const RA return; } + RawDataFrameReorder reorder_frames(model, rawDataFrames); + frame = reorder_frames.getframe(frame); + RAWParams::BayerSensor bayerParams = bayerParamsIn; bayerParams.pixelShiftAutomatic = true;