Remove Imagefloat::ExecCMSTransform2, #5025
This commit is contained in:
parent
20577ccab6
commit
c9817e369c
@ -474,59 +474,6 @@ void Imagefloat::calcCroppedHistogram(const ProcParams ¶ms, float scale, LUT
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parallelized transformation; create transform with cmsFLAGS_NOCACHE!
|
|
||||||
void Imagefloat::ExecCMSTransform2(cmsHTRANSFORM hTransform, bool normalizeIn)
|
|
||||||
{
|
|
||||||
|
|
||||||
// LittleCMS cannot parallelize planar setups -- Hombre: LCMS2.4 can! But it we use this new feature, memory allocation
|
|
||||||
// have to be modified too to build temporary buffers that allow multi processor execution
|
|
||||||
#ifdef _OPENMP
|
|
||||||
#pragma omp parallel
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
AlignedBuffer<float> pBuf(width * 3);
|
|
||||||
|
|
||||||
#ifdef _OPENMP
|
|
||||||
#pragma omp for schedule(dynamic, 16)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (int y = 0; y < height; y++)
|
|
||||||
{
|
|
||||||
float *p = pBuf.data, *pR = r(y), *pG = g(y), *pB = b(y);
|
|
||||||
|
|
||||||
if (normalizeIn) {
|
|
||||||
for (int x = 0; x < width; x++) {
|
|
||||||
*(p++) = *(pR++)/ 65535.f;
|
|
||||||
*(p++) = *(pG++)/ 65535.f;
|
|
||||||
*(p++) = *(pB++)/ 65535.f;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for (int x = 0; x < width; x++) {
|
|
||||||
*(p++) = *(pR++);
|
|
||||||
*(p++) = *(pG++);
|
|
||||||
*(p++) = *(pB++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cmsDoTransform (hTransform, pBuf.data, pBuf.data, width);
|
|
||||||
|
|
||||||
p = pBuf.data;
|
|
||||||
pR = r(y);
|
|
||||||
pG = g(y);
|
|
||||||
pB = b(y);
|
|
||||||
|
|
||||||
for (int x = 0; x < width; x++) {
|
|
||||||
*(pR++) = *(p++);
|
|
||||||
*(pG++) = *(p++);
|
|
||||||
*(pB++) = *(p++);
|
|
||||||
}
|
|
||||||
} // End of parallelization
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Parallelized transformation; create transform with cmsFLAGS_NOCACHE!
|
// Parallelized transformation; create transform with cmsFLAGS_NOCACHE!
|
||||||
void Imagefloat::ExecCMSTransform(cmsHTRANSFORM hTransform)
|
void Imagefloat::ExecCMSTransform(cmsHTRANSFORM hTransform)
|
||||||
{
|
{
|
||||||
@ -540,7 +487,7 @@ void Imagefloat::ExecCMSTransform(cmsHTRANSFORM hTransform)
|
|||||||
AlignedBuffer<float> pBuf(width * 3);
|
AlignedBuffer<float> pBuf(width * 3);
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
#pragma omp for schedule(static)
|
#pragma omp for schedule(dynamic, 16)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int y = 0; y < height; y++)
|
for (int y = 0; y < height; y++)
|
||||||
|
@ -222,8 +222,6 @@ public:
|
|||||||
void normalizeFloatTo1();
|
void normalizeFloatTo1();
|
||||||
void normalizeFloatTo65535();
|
void normalizeFloatTo65535();
|
||||||
void calcCroppedHistogram(const ProcParams ¶ms, float scale, LUTu & hist);
|
void calcCroppedHistogram(const ProcParams ¶ms, float scale, LUTu & hist);
|
||||||
void ExecCMSTransform2(cmsHTRANSFORM hTransform, bool normalizeIn = true);
|
|
||||||
|
|
||||||
void ExecCMSTransform(cmsHTRANSFORM hTransform);
|
void ExecCMSTransform(cmsHTRANSFORM hTransform);
|
||||||
void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy);
|
void ExecCMSTransform(cmsHTRANSFORM hTransform, const LabImage &labImage, int cx, int cy);
|
||||||
};
|
};
|
||||||
|
@ -644,7 +644,7 @@ void ImProcFunctions::workingtrc(Imagefloat* src, Imagefloat* dst, int cw, int c
|
|||||||
cmsHTRANSFORM hTransform = cmsCreateTransform(iprof, TYPE_RGB_FLT, oprofdef, TYPE_RGB_FLT, params->icm.outputIntent, flags);
|
cmsHTRANSFORM hTransform = cmsCreateTransform(iprof, TYPE_RGB_FLT, oprofdef, TYPE_RGB_FLT, params->icm.outputIntent, flags);
|
||||||
lcmsMutex->unlock();
|
lcmsMutex->unlock();
|
||||||
|
|
||||||
dst->ExecCMSTransform2(hTransform, false);
|
dst->ExecCMSTransform(hTransform);
|
||||||
|
|
||||||
cmsDeleteTransform(hTransform);
|
cmsDeleteTransform(hTransform);
|
||||||
if (normalizeOut) {
|
if (normalizeOut) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user