diff --git a/rtengine/dcraw.cc b/rtengine/dcraw.cc index 81013bc0b..943d5a96a 100644 --- a/rtengine/dcraw.cc +++ b/rtengine/dcraw.cc @@ -6463,6 +6463,9 @@ guess_cfa_pc: xyz[2] = 1 - xyz[0] - xyz[1]; FORC3 xyz[c] /= d65_white[c]; break; + case 50730: /* BaselineExposure */ + if (dng_version) RT_baseline_exposure = getreal(type); + break; case 50740: /* DNGPrivateData */ if (dng_version) break; parse_minolta (j = get4()+base); diff --git a/rtengine/dcraw.h b/rtengine/dcraw.h index e1b296dbf..c3794ea5f 100644 --- a/rtengine/dcraw.h +++ b/rtengine/dcraw.h @@ -58,6 +58,7 @@ public: ,RT_whitelevel_from_constant(ThreeValBool::X) ,RT_blacklevel_from_constant(ThreeValBool::X) ,RT_matrix_from_constant(ThreeValBool::X) + ,RT_baseline_exposure(0) ,getbithuff(this,ifp,zero_after_ff) ,nikbithuff(ifp) { @@ -154,6 +155,7 @@ protected: ThreeValBool RT_blacklevel_from_constant; ThreeValBool RT_matrix_from_constant; std::string RT_software; + double RT_baseline_exposure; float cam_mul[4], pre_mul[4], cmatrix[3][4], rgb_cam[3][4]; diff --git a/rtengine/rawimage.h b/rtengine/rawimage.h index 7595ad196..f6b8190e4 100644 --- a/rtengine/rawimage.h +++ b/rtengine/rawimage.h @@ -125,6 +125,8 @@ public: float** data; // holds pixel values, data[i][j] corresponds to the ith row and jth column unsigned prefilters; // original filters saved ( used for 4 color processing ) unsigned int getFrameCount() const { return is_raw; } + + double getBaselineExposure() const { return RT_baseline_exposure; } protected: Glib::ustring filename; // complete filename int rotate_deg; // 0,90,180,270 degree of rotation: info taken by dcraw from exif diff --git a/rtengine/rawimagesource.cc b/rtengine/rawimagesource.cc index 502da8073..c917ac179 100644 --- a/rtengine/rawimagesource.cc +++ b/rtengine/rawimagesource.cc @@ -716,6 +716,11 @@ void RawImageSource::getImage (const ColorTemp &ctemp, int tran, Imagefloat* ima gm /= area; bm /= area; bool doHr = (hrp.hrenabled && hrp.method != "Color"); + const float expcomp = std::pow(2, ri->getBaselineExposure()); + rm *= expcomp; + gm *= expcomp; + bm *= expcomp; + #ifdef _OPENMP #pragma omp parallel if(!d1x) // omp disabled for D1x to avoid race conditions (see Issue 1088 http://code.google.com/p/rawtherapee/issues/detail?id=1088) { diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index afd8836a1..dd8ca4a99 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -567,6 +567,7 @@ Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocati tpp->camwbBlue = tpp->blueMultiplier / pre_mul[2]; //ri->get_pre_mul(2); //tpp->defGain = 1.0 / min(ri->get_pre_mul(0), ri->get_pre_mul(1), ri->get_pre_mul(2)); tpp->defGain = max (scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]) / min (scale_mul[0], scale_mul[1], scale_mul[2], scale_mul[3]); + tpp->defGain *= std::pow(2, ri->getBaselineExposure()); tpp->gammaCorrected = true;