Introducting soft-proofing and Black Point Compensation, simplify the
CMM at the end of the pipeline + sparse code refactoring A new BPC checkbutton has been created in 'Preferences/Color Management' and in the ICM tool. Better hanbling of widget sensitivity of the output profile / gamma part of the ICM tool.
This commit is contained in:
@@ -326,17 +326,16 @@ Image16::tofloat()
|
||||
}
|
||||
|
||||
// Parallized transformation; create transform with cmsFLAGS_NOCACHE!
|
||||
void Image16::ExecCMSTransform(cmsHTRANSFORM hTransform)
|
||||
void Image16::ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage)
|
||||
{
|
||||
//cmsDoTransform(hTransform, data, data, planestride);
|
||||
|
||||
// LittleCMS cannot parallelize planar setups -- Hombre: LCMS2.4 can! But it we use this new feature, memory allocation have to be modified too
|
||||
// LittleCMS cannot parallelize planar Lab float images
|
||||
// so build temporary buffers to allow multi processor execution
|
||||
#ifdef _OPENMP
|
||||
#pragma omp parallel
|
||||
#endif
|
||||
{
|
||||
AlignedBuffer<unsigned short> buffer(width * 3);
|
||||
AlignedBuffer<float> bufferLab(width * 3);
|
||||
AlignedBuffer<unsigned short> bufferRGB(width * 3);
|
||||
|
||||
#ifdef _OPENMP
|
||||
#pragma omp for schedule(static)
|
||||
@@ -344,25 +343,31 @@ void Image16::ExecCMSTransform(cmsHTRANSFORM hTransform)
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
unsigned short *p = buffer.data, *pR = r(y), *pG = g(y), *pB = b(y);
|
||||
unsigned short *pRGB, *pR, *pG, *pB;
|
||||
float *pLab, *pL, *pa, *pb;
|
||||
|
||||
pLab= bufferLab.data;
|
||||
pL = labImage.L[y];
|
||||
pa = labImage.a[y];
|
||||
pb = labImage.b[y];
|
||||
|
||||
for (int x = 0; x < width; x++) {
|
||||
*(p++) = *(pR++);
|
||||
*(p++) = *(pG++);
|
||||
*(p++) = *(pB++);
|
||||
*(pLab++) = *(pL++) / 327.68f;
|
||||
*(pLab++) = *(pa++) / 327.68f;
|
||||
*(pLab++) = *(pb++) / 327.68f;
|
||||
}
|
||||
|
||||
cmsDoTransform (hTransform, buffer.data, buffer.data, width);
|
||||
cmsDoTransform (hTransform, bufferLab.data, bufferRGB.data, width);
|
||||
|
||||
p = buffer.data;
|
||||
pRGB = bufferRGB.data;
|
||||
pR = r(y);
|
||||
pG = g(y);
|
||||
pB = b(y);
|
||||
|
||||
for (int x = 0; x < width; x++) {
|
||||
*(pR++) = *(p++);
|
||||
*(pG++) = *(p++);
|
||||
*(pB++) = *(p++);
|
||||
*(pR++) = *(pRGB++);
|
||||
*(pG++) = *(pRGB++);
|
||||
*(pB++) = *(pRGB++);
|
||||
}
|
||||
} // End of parallelization
|
||||
}
|
||||
|
Reference in New Issue
Block a user