74#define IsSpacePCS(x) ((x)==icSigXYZData || (x)==icSigLabData)
98 switch (pProfile->m_Header.pcs)
117 switch (pProfile->m_Header.pcs)
140 for (i=0; i<n; i++) {
145 for (i=0; i<n; i++) {
150 for (i=0; i<n; i++) {
176 denom = (
icFloatNumber)(s00*s20*s40 - s10*s10*s40 - s00*s30*s30 + 2.0*s10*s20*s30 - s20*s20*s20);
177 if (fabs(denom)>0.0) {
183 icFloatNumber t = (s01*s10*s30 - s11*s00*s30 - s01*s20*s20 + s11*s10*s20 + s21*s00*s20 - s21*s10*s10)/denom;
185 icFloatNumber u = (s11*s00*s40 - s01*s10*s40 + s01*s20*s30 - s21*s00*s30 - s11*s20*s20 + s21*s10*s20)/denom;
187 icFloatNumber c = (s01*s20*s40 - s11*s10*s40 - s01*s30*s30 + s11*s20*s30 + s21*s10*s30 - s21*s20*s20)/denom;
190 vert = (
icFloatNumber)((-1.0 * u + sqrt(u*u - 4*t*c)) / (2.0 * t));
215 if (!pProfile || !pXform)
222 switch (pProfile->m_Header.deviceClass)
241 if (pXform->IsInput()) {
271 if (pXform->IsInput()) {
296 XYZb[0] = XYZb[1] = XYZb[2] = 0.0;
307 switch (pProfile->m_Header.colorSpace) {
348 if (!
pixelXfm(XYZb, Pixel, pProfile->m_Header.colorSpace, pXform->GetIntent(), pProfile)) {
357 XYZb[1] = XYZb[2] = 0.0;
401 pcsPixel[1] = iniLab[1];
402 pcsPixel[2] = iniLab[2];
413 pcsPixel[1] = iniLab[1];
414 pcsPixel[2] = iniLab[2];
424 bool bStraightMidRange =
false;
440 bStraightMidRange =
true;
444 pcsPixel[1] = iniLab[1];
445 pcsPixel[2] = iniLab[2];
452 roundtripL = Pixel[0];
454 if (roundtripL>(MinL + 0.2 * (MaxL - MinL))) {
455 if (fabs(roundtripL - lcnt)>4.0) {
456 bStraightMidRange =
false;
466 if (bStraightMidRange) {
486 for (i=0; i<101; i++) {
489 pcsPixel[1] = iniLab[1];
490 pcsPixel[2] = iniLab[2];
497 y[i] = (Pixel[0] - MinL)/(MaxL - MinL);
502 for (i=0; i<101; i++) {
503 if (y[i]>=lo && y[i]<hi) {
549 CIccProfile* pICC =
new CIccProfile(*pProfile);
550 if (!pICC)
return false;
583 CIccCmm* pCmm =
new CIccCmm(pProfile->m_Header.pcs,
icSigUnknownData,
false);
584 if (!pCmm)
return NULL;
587 CIccProfile* pICC1 =
new CIccProfile(*pProfile);
601 CIccProfile* pICC2 =
new CIccProfile(*pProfile);
#define icPerceptualRefWhiteX
#define icPerceptualRefBlackY
#define icPerceptualRefWhiteZ
#define icPerceptualRefWhiteY
float icFloatNumber
All floating point operations/variables in IccProfLib use the icFloatNumber data type.
void icXyzToPcs(icFloatNumber *XYZ)
void icXyzFromPcs(icFloatNumber *XYZ)
Floating point encoding of XYZ in PCS is in range 0.0 to 1.0 (Note: X=1.0 is encoded as about 0....
icUInt32Number icGetSpaceSamples(icColorSpaceSignature sig)
void icLabFromPcs(icFloatNumber *Lab)
Floating point encoding of Lab in PCS is in range 0.0 to 1.0.
void icLabToPcs(icFloatNumber *Lab)
void icLabtoXYZ(icFloatNumber *XYZ, const icFloatNumber *Lab, const icFloatNumber *WhiteXYZ)
void icXYZtoLab(icFloatNumber *Lab, const icFloatNumber *XYZ, const icFloatNumber *WhiteXYZ)
unsigned int icUInt32Number
virtual IIccAdjustPCSXform * GetNewAdjustPCSXform() const
Name: CIccApplyBPCHint::GetNewAdjustPCSXform.
bool calcSrcBlackPoint(const CIccProfile *pProfile, const CIccXform *pXform, icFloatNumber *XYZb) const
Name: CIccApplyBPC::calcSrcBlackPoint.
bool calcDstBlackPoint(const CIccProfile *pProfile, const CIccXform *pXform, icFloatNumber *XYZb) const
Name: CIccApplyBPC::calcDstBlackPoint.
bool pixelXfm(icFloatNumber *DstPixel, icFloatNumber *SrcPixel, icColorSpaceSignature SrcSpace, icRenderingIntent nIntent, const CIccProfile *pProfile) const
Name: CIccApplyBPC::pixelXfm.
void pcs2lab(icFloatNumber *pixel, const CIccProfile *pProfile) const
CIccCmm * getBlackXfm(icRenderingIntent nIntent, const CIccProfile *pProfile) const
Name: CIccApplyBPC::blackXfm.
bool calcBlackPoint(const CIccProfile *pProfile, const CIccXform *pXform, icFloatNumber *XYZb) const
Name: CIccApplyBPC::calcBlackPoint.
virtual bool CalcFactors(const CIccProfile *pProfile, const CIccXform *pXfm, icFloatNumber *Scale, icFloatNumber *Offset) const
Name: CIccApplyBPC::CalculateFactors.
icFloatNumber calcsum(icFloatNumber *x, icFloatNumber *y, int n, int j, int k) const
void lab2pcs(icFloatNumber *pixel, const CIccProfile *pProfile) const
icFloatNumber calcQuadraticVertex(icFloatNumber *x, icFloatNumber *y, int n) const