Handle masked area black level with LibRaw
Copied from ART commit 9a24f2567a452f0ca788f51e88b92b479002b149.
This commit is contained in:
parent
021b7dfff0
commit
6da48b933a
@ -839,6 +839,13 @@ int RawImage::loadRaw(bool loadData, unsigned int imageNum, bool closeFile, Prog
|
||||
profile_data = new char[profile_length];
|
||||
memcpy(profile_data, libraw->imgdata.color.profile, profile_length);
|
||||
}
|
||||
|
||||
if (isBayer() && RT_blacklevel_from_constant == ThreeValBool::T && max(black, cblack[0], cblack[1], cblack[2], cblack[3]) == 0) {
|
||||
auto &black_stat = libraw->imgdata.color.black_stat;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
cblack[i] = black_stat[i] / (1+black_stat[i+4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!float_raw_image) { // apply baseline exposure only for float DNGs
|
||||
|
Loading…
x
Reference in New Issue
Block a user