merge with dev

This commit is contained in:
U-PC-BUREAU\jacques
2018-08-05 09:05:47 +02:00
146 changed files with 6196 additions and 2570 deletions

View File

@@ -912,17 +912,17 @@ DCPProfile *RawImageSource::getDCP(const ColorManagementParams &cmp, DCPProfile:
{
DCPProfile *dcpProf = nullptr;
cmsHPROFILE dummy;
findInputProfile(cmp.input, nullptr, (static_cast<const FramesData*>(getMetaData()))->getCamera(), &dcpProf, dummy);
findInputProfile(cmp.inputProfile, nullptr, (static_cast<const FramesData*>(getMetaData()))->getCamera(), &dcpProf, dummy);
if (dcpProf == nullptr) {
if (settings->verbose) {
printf("Can't load DCP profile '%s'!\n", cmp.input.c_str());
printf("Can't load DCP profile '%s'!\n", cmp.inputProfile.c_str());
}
return nullptr;
}
dcpProf->setStep2ApplyState(cmp.working, cmp.toneCurve, cmp.applyLookTable, cmp.applyBaselineExposureOffset, as);
dcpProf->setStep2ApplyState(cmp.workingProfile, cmp.toneCurve, cmp.applyLookTable, cmp.applyBaselineExposureOffset, as);
return dcpProf;
}
@@ -2194,7 +2194,7 @@ void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, con
int mode = 0;
Color::calcGamma(pwr, ts, mode, g_a); // call to calcGamma with selected gamma and slope
// printf("g_a0=%f g_a1=%f g_a2=%f g_a3=%f g_a4=%f\n", g_a0,g_a1,g_a2,g_a3,g_a4);
// printf("g_a0=%f g_a1=%f g_a2=%f g_a3=%f g_a4=%f\n", g_a0,g_a1,g_a2,g_a3,g_a4);
double start;
double add;
@@ -2356,7 +2356,7 @@ void RawImageSource::retinexPrepareBuffers(const ColorManagementParams& cmp, con
}
} else {
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix(cmp.working);
TMatrix wprof = ICCStore::getInstance()->workingSpaceMatrix (cmp.workingProfile);
const float wp[3][3] = {
{static_cast<float>(wprof[0][0]), static_cast<float>(wprof[0][1]), static_cast<float>(wprof[0][2])},
{static_cast<float>(wprof[1][0]), static_cast<float>(wprof[1][1]), static_cast<float>(wprof[1][2])},
@@ -2632,7 +2632,7 @@ void RawImageSource::retinex(const ColorManagementParams& cmp, const RetinexPara
}
} else {
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.working);
TMatrix wiprof = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile);
double wip[3][3] = {
{wiprof[0][0], wiprof[0][1], wiprof[0][2]},
@@ -3988,7 +3988,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
cmsHPROFILE in;
DCPProfile *dcpProf;
if (!findInputProfile(cmp.input, embedded, camName, &dcpProf, in)) {
if (!findInputProfile(cmp.inputProfile, embedded, camName, &dcpProf, in)) {
return;
}
@@ -4005,7 +4005,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
{camMatrix[2][0], camMatrix[2][1], camMatrix[2][2]}
}
};
dcpProf->apply(im, cmp.dcpIlluminant, cmp.working, wb, pre_mul_row, cam_matrix, cmp.applyHueSatMap);
dcpProf->apply(im, cmp.dcpIlluminant, cmp.workingProfile, wb, pre_mul_row, cam_matrix, cmp.applyHueSatMap);
return;
}
@@ -4014,7 +4014,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
// in this case we avoid using the slllllooooooowwww lcms
// Calculate matrix for direct conversion raw>working space
TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.working);
TMatrix work = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile);
double mat[3][3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}};
for (int i = 0; i < 3; i++)
@@ -4040,7 +4040,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
}
} else {
bool working_space_is_prophoto = (cmp.working == "ProPhoto");
bool working_space_is_prophoto = (cmp.workingProfile == "ProPhoto");
// use supplied input profile
@@ -4112,7 +4112,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
// check if the working space is fully contained in prophoto
if (!working_space_is_prophoto && camera_icc_type == CAMERA_ICC_TYPE_GENERIC) {
TMatrix toxyz = ICCStore::getInstance()->workingSpaceMatrix(cmp.working);
TMatrix toxyz = ICCStore::getInstance()->workingSpaceMatrix(cmp.workingProfile);
TMatrix torgb = ICCStore::getInstance()->workingSpaceInverseMatrix("ProPhoto");
float rgb[3] = {0.f, 0.f, 0.f};
for (int i = 0; i < 2 && !working_space_is_prophoto; ++i) {
@@ -4125,9 +4125,9 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
for (int j = 0; j < 2; ++j) {
if (rgb[j] < 0.f || rgb[j] > 1.f) {
working_space_is_prophoto = true;
prophoto = ICCStore::getInstance()->workingSpace(cmp.working);
prophoto = ICCStore::getInstance()->workingSpace(cmp.workingProfile);
if (settings->verbose) {
std::cout << "colorSpaceConversion_: converting directly to " << cmp.working << " instead of passing through ProPhoto" << std::endl;
std::cout << "colorSpaceConversion_: converting directly to " << cmp.workingProfile << " instead of passing through ProPhoto" << std::endl;
}
break;
}
@@ -4180,7 +4180,7 @@ void RawImageSource::colorSpaceConversion_(Imagefloat* im, const ColorManagement
if (!working_space_is_prophoto) {
toxyz = ICCStore::getInstance()->workingSpaceMatrix("ProPhoto");
torgb = ICCStore::getInstance()->workingSpaceInverseMatrix(cmp.working); //sRGB .. Adobe...Wide...
torgb = ICCStore::getInstance()->workingSpaceInverseMatrix (cmp.workingProfile); //sRGB .. Adobe...Wide...
}
#ifdef _OPENMP
@@ -4614,7 +4614,7 @@ void RawImageSource::HLRecovery_CIELab(float* rin, float* gin, float* bin, float
float bo = min(b, maxval);
float yy = xyz_cam[1][0] * r + xyz_cam[1][1] * g + xyz_cam[1][2] * b;
float fy = (yy < 65535.0 ? Color::cachef[yy] / 327.68 : std::cbrt(yy / MAXVALD));
// compute LCH decompostion of the clipped pixel (only color information, thus C and H will be used)
// compute LCH decomposition of the clipped pixel (only color information, thus C and H will be used)
float x = xyz_cam[0][0] * ro + xyz_cam[0][1] * go + xyz_cam[0][2] * bo;
float y = xyz_cam[1][0] * ro + xyz_cam[1][1] * go + xyz_cam[1][2] * bo;
float z = xyz_cam[2][0] * ro + xyz_cam[2][1] * go + xyz_cam[2][2] * bo;