148 BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
149 return FALSE;
150 }
151
152 // Convert black to Lab
153 cmsDoTransform(xform, Black, &Lab, 1);
154
155 // Force it to be neutral, clip to max. L* of 50
156 Lab.a = Lab.b = 0;
157 if (Lab.L > 50) Lab.L = 50;
158
159 // Free the resources
160 cmsDeleteTransform(xform);
161
162 // Convert from Lab (which is now clipped) to XYZ.
163 cmsLab2XYZ(NULL, &BlackXYZ, &Lab);
164
165 if (BlackPoint != NULL)
166 *BlackPoint = BlackXYZ;
167
168 return TRUE;
169
170 cmsUNUSED_PARAMETER(dwFlags);
171 }
172
173 // Get a black point of output CMYK profile, discounting any ink-limiting embedded
174 // in the profile. For doing that, we use perceptual intent in input direction:
175 // Lab (0, 0, 0) -> [Perceptual] Profile -> CMYK -> [Rel. colorimetric] Profile -> Lab
176 static
177 cmsBool BlackPointUsingPerceptualBlack(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile)
178 {
179 cmsHTRANSFORM hRoundTrip;
180 cmsCIELab LabIn, LabOut;
181 cmsCIEXYZ BlackXYZ;
182
183 // Is the intent supported by the profile?
184 if (!cmsIsIntentSupported(hProfile, INTENT_PERCEPTUAL, LCMS_USED_AS_INPUT)) {
185
186 BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
187 return TRUE;
188 }
189
190 hRoundTrip = CreateRoundtripXForm(hProfile, INTENT_PERCEPTUAL);
|
148 BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
149 return FALSE;
150 }
151
152 // Convert black to Lab
153 cmsDoTransform(xform, Black, &Lab, 1);
154
155 // Force it to be neutral, clip to max. L* of 50
156 Lab.a = Lab.b = 0;
157 if (Lab.L > 50) Lab.L = 50;
158
159 // Free the resources
160 cmsDeleteTransform(xform);
161
162 // Convert from Lab (which is now clipped) to XYZ.
163 cmsLab2XYZ(NULL, &BlackXYZ, &Lab);
164
165 if (BlackPoint != NULL)
166 *BlackPoint = BlackXYZ;
167
168 cmsUNUSED_PARAMETER(dwFlags);
169
170 return TRUE;
171
172 }
173
174 // Get a black point of output CMYK profile, discounting any ink-limiting embedded
175 // in the profile. For doing that, we use perceptual intent in input direction:
176 // Lab (0, 0, 0) -> [Perceptual] Profile -> CMYK -> [Rel. colorimetric] Profile -> Lab
177 static
178 cmsBool BlackPointUsingPerceptualBlack(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfile)
179 {
180 cmsHTRANSFORM hRoundTrip;
181 cmsCIELab LabIn, LabOut;
182 cmsCIEXYZ BlackXYZ;
183
184 // Is the intent supported by the profile?
185 if (!cmsIsIntentSupported(hProfile, INTENT_PERCEPTUAL, LCMS_USED_AS_INPUT)) {
186
187 BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
188 return TRUE;
189 }
190
191 hRoundTrip = CreateRoundtripXForm(hProfile, INTENT_PERCEPTUAL);
|