DNG: honour the BaselineExposure tag

This commit is contained in:
Alberto Griggio 2018-10-28 17:32:15 +01:00
parent c63633a76d
commit 632c1362c8
5 changed files with 13 additions and 0 deletions

View File

@ -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);

View File

@ -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];

View File

@ -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

View File

@ -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)
{

View File

@ -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;