I apparently am not setting the illuminant and observer. I thought I was
but, in the larger code I have routines that convert Lab to RGB and I
thought I was changing the observer and illuminant for this as well
(different profile). The cmsCreateLabProfile allows me to set the white
point,, the cmsCreateXYZProfile doen't have an argument for the white
point. Excuse my lack of experience here, but how do I set the illuminant
and observer.
-Bob
"Case, Isaac" <isaac.c...@xerox.com>
09/30/2009 10:30 AM
To
Robert V Canning/AE/dup...@dupont
cc
Subject
RE: [Lcms-user] XYZ to RGB Conversion
Where/how are you setting the illuminant and observer?
-Isaac
From: Robert V Canning [mailto:robert.v.cann...@usa.dupont.com]
Sent: Wednesday, September 30, 2009 10:23 AM
To: Case, Isaac
Subject: RE: [Lcms-user] XYZ to RGB Conversion
Thanks Isaac, that was the problem, I forgot the divide by 100. The
conversion seems to be in D50, I set the white point to D65 at 10 degrees
but the results always seem to be in D50 space 2 degree. I am comparing
it to Lindblooms calculator and I get the D50 answer not D65. Any clue?
Thanks again,
Bob
"Case, Isaac" <isaac.c...@xerox.com>
09/30/2009 09:50 AM
To
Robert V Canning/AE/dup...@dupont, <lcms-user@lists.sourceforge.net>
cc
Subject
RE: [Lcms-user] XYZ to RGB Conversion
What range of values are you passing in as XYZ. I just tried and got
X:0.5 Y:0.5 Z:0.5 -> R:190 G:185 B:207
However, if you are expecting a range of
X from 0 to 95.047
Y from 0 to 100.000
Z from 0 to 108.883
You’ll need to divide by 100 for everything.
-Isaac Case
From: Robert V Canning [mailto:robert.v.cann...@usa.dupont.com]
Sent: Wednesday, September 30, 2009 8:11 AM
To: lcms-user@lists.sourceforge.net
Subject: [Lcms-user] XYZ to RGB Conversion
Hi,
I want to be able to convert an XYZ value to RGB. I took the
following steps:
- created a XYZ profile used as input.
- created a sRGB profile used as output
- intent is set to perceptual
- created a transform
- loaded the XYZ values
- did the transform
The problem is no matter what the XYZ value I always get 255 for the RGB
values. What am I doing wrong?
Thanks for any help.
void XYZtoRGB(double X, double Y, double Z, unsigned char &red, unsigned
char &green, unsigned char &blue)
cmsCIEXYZ XYZ;
BYTE output[3];
XYZ.X = X;
XYZ.Y = Y;
XYZ.Z = Z;
cmsHTRANSFORM hXYZtoRGBTransform;
cmsHPROFILE hXYZProfile;
cmsHPROFILE hsRGBProfile;
hXYZProfile = cmsCreateXYZProfile();
hsRGBProfile = cmsCreate_sRGBProfile();
// Rendering intent is perceptual
hXYZtoRGBTransform = cmsCreateTransform(hXYZProfile, TYPE_XYZ_DBL,
hsRGBProfile, TYPE_RGB_8,
0,
cmsFLAGS_NOTPRECALC);
cmsDoTransform(hXYZtoRGBTransform, &XYZ, output, 1);
red = output[0];
green = output[1];
blue = output[2];
cmsDeleteTransform(hXYZtoRGBTransform);
cmsCloseProfile(hXYZProfile);
cmsCloseProfile(hsRGBProfile);
}
This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
This communication is for use by the intended recipient and contains
information that may be Privileged, confidential or copyrighted under
applicable law. If you are not the intended recipient, you are hereby
formally notified that any use, copying or distribution of this e-mail,
in whole or in part, is strictly prohibited. Please notify the sender by
return e-mail and delete this e-mail from your system. Unless explicitly
and conspicuously designated as "E-Contract Intended", this e-mail does
not constitute a contract offer, a contract amendment, or an acceptance
of a contract offer. This e-mail does not constitute a consent to the
use of sender's contact information for direct marketing purposes or for
transfers of data to third parties.
Francais Deutsch Italiano Espanol Portugues Japanese Chinese Korean
http://www.DuPont.com/corp/email_disclaimer.html
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user