Re: [Lcms-user] Getting the profile whitepoint

2012-11-23 Thread Richard Hughes
On 22 November 2012 22:38, Marti Maria marti.ma...@littlecms.com wrote:
 - use cmsSetAdaptationState(0) prior transform. This is very important in
 order to get the white point from CHAD

Ahh, this is the bit I didn't know about.

 Hope that works to you

Using cmsCreateExtendedTransform allows me to do this without setting
the global state. Thanks!

As an aside, I did wonder about the documentation for
cmsCreateExtendedTransform.

cmsCreateExtendedTransform(cmsContext ContextID,
   cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[],
   cmsBool  BPC[],
   cmsUInt32Number Intents[],
   cmsFloat64Number AdaptationStates[],
   cmsHPROFILE hGamutProfile,
   cmsUInt32Number nGamutPCSposition,
   cmsUInt32Number InputFormat,
   cmsUInt32Number OutputFormat,
   cmsUInt32Number dwFlags);

What I expected was nProfiles = 2, hProfiles[2], BPC[2], Intents[1],
AdaptationStates[2], i.e. you set (nProfiles-1) worth of transform
data. If you do this it doesn't work, and so I have to do something
odd like:

cmsUInt32Number intents[2] = { INTENT_ABSOLUTE_COLORIMETRIC,
   INTENT_ABSOLUTE_COLORIMETRIC };

Also I don't think BPC makes sense for absolute-colorimetric, and I
kinda expected to be able to pass NULL there. If you do that it blows
up :)

Richard

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-23 Thread marti . maria

Hi,

 As an aside, I did wonder about the documentation for
 cmsCreateExtendedTransform.

 cmsCreateExtendedTransform(cmsContext ContextID,
cmsUInt32Number nProfiles, cmsHPROFILE hProfiles[],
cmsBool  BPC[],
cmsUInt32Number Intents[],
cmsFloat64Number AdaptationStates[],
cmsHPROFILE hGamutProfile,
cmsUInt32Number nGamutPCSposition,
cmsUInt32Number InputFormat,
cmsUInt32Number OutputFormat,
cmsUInt32Number dwFlags);

 What I expected was nProfiles = 2, hProfiles[2], BPC[2], Intents[1],
 AdaptationStates[2], i.e. you set (nProfiles-1) worth of transform
 data. If you do this it doesn't work, and so I have to do something
 odd like:

 cmsUInt32Number intents[2] = { INTENT_ABSOLUTE_COLORIMETRIC,
INTENT_ABSOLUTE_COLORIMETRIC };


Ok, this function allows you to specify intents *per profile*, that means
you can use relative colorimetric when going from RGB to PCS in the first
profile and perceptual when going PCS to second profile. Mixing intents
is generally a bad idea, but there are situations where it can be
useful. So here is the functionality.


 Also I don't think BPC makes sense for absolute-colorimetric, and I
 kinda expected to be able to pass NULL there. If you do that it blows
 up :)


Right. I will try to fix that in next release (maybe NULL would mean
no BPC?)

Regards
Marti



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-23 Thread Richard Hughes
On 23 November 2012 10:32,  marti.ma...@littlecms.com wrote:
 cmsUInt32Number intents[2] = { INTENT_ABSOLUTE_COLORIMETRIC,
INTENT_ABSOLUTE_COLORIMETRIC };
 Ok, this function allows you to specify intents *per profile*, that means
 you can use relative colorimetric when going from RGB to PCS in the first
 profile and perceptual when going PCS to second profile. Mixing intents
 is generally a bad idea, but there are situations where it can be
 useful. So here is the functionality.

So I'm actually specifying RGB-PCS (absol-col) and PCS-XYZ
(absol-col) -- that's probably worth adding to the docs as it was a
little confusing.

 Also I don't think BPC makes sense for absolute-colorimetric, and I
 kinda expected to be able to pass NULL there. If you do that it blows
 up :)
 Right. I will try to fix that in next release (maybe NULL would mean
 no BPC?)

Well, I'd expect it to do something sane, i.e. we've got dwFlags and
so it's easy to set global BPC on or off.

Maybe it just needs documenting... :)

Richard.

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-23 Thread Kai-Uwe Behrmann
Am 23.11.2012 11:28, schrieb marti.ma...@littlecms.com:
 Kai-Uwe Behrmann k...@gmx.de escribió:

 However cmsSetAdaptationState() works only globally, which makes not so
 much sense for displaying multiple documents with different settings at
 the same time. A API for setting the adaption state per transform would
 be very appreciated.

 Check cmsCreateExtendedTransform()

Richard and Marti,

thanks for pointing out.

kind regards
Kai-Uwe


--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


[Lcms-user] Getting the profile whitepoint

2012-11-22 Thread Richard Hughes
gnome-color-manager displays the profile whitepoint as a temperature
in the profile viewer.

To do this is gets the MediaWhitePoint and uses cmsTempFromWhitePoint()

This fails for v4 profiles that use a chad adaption as everything is
D50. Is there an easy way of getting the profile whitepoint from lcms
without creating a transform?

Richard.

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-22 Thread Marti Maria

Hi Richard,

This is trivially done by using a transform from the RGB profile to XYZ, 
selecting adaptation state to 0 and then transforming (255, 255, 255) by 
the absolute colorimetric intent

Please note that this way you can safely ignore whatever the profile is 
V2 or V4, as it works in all cases.

Notes:
- use cmsSetAdaptationState(0) prior transform. This is very important 
in order to get the white point from CHAD
- use cmsFLAGS_NOOPTIMIZE as you only need one color. The transform 
overhead is minimal if done so.
- TYPE_RGB_DOUBLE and TYPE_XYZ_DOUBLE seems more adequate for data types.

Hope that works to you
Regards
Marti


El 22/11/2012 14:11, Richard Hughes escribió:
 gnome-color-manager displays the profile whitepoint as a temperature
 in the profile viewer.

 To do this is gets the MediaWhitePoint and uses cmsTempFromWhitePoint()

 This fails for v4 profiles that use a chad adaption as everything is
 D50. Is there an easy way of getting the profile whitepoint from lcms
 without creating a transform?

 Richard.

 --
 Monitor your physical, virtual and cloud infrastructure from a single
 web console. Get in-depth insight into apps, servers, databases, vmware,
 SAP, cloud infrastructure, etc. Download 30-day Free Trial.
 Pricing starts from $795 for 25 servers or applications!
 http://p.sf.net/sfu/zoho_dev2dev_nov
 ___
 Lcms-user mailing list
 Lcms-user@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/lcms-user



--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-22 Thread Graeme Gill
Richard Hughes wrote:
 I thought chad had to be invertable?

You can invert it in lcms, but typical CMM's
won't even try. So what's the point in figuring
out the devices real white point if you can
never access anything to do with it when you
use the profile ?

Graeme Gill.

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user


Re: [Lcms-user] Getting the profile whitepoint

2012-11-22 Thread Kai-Uwe Behrmann
Am 23.11.2012 01:33, schrieb Graeme Gill:
 Richard Hughes wrote:
 I thought chad had to be invertable?

 You can invert it in lcms, but typical CMM's
 won't even try. So what's the point in figuring
 out the devices real white point if you can
 never access anything to do with it when you
 use the profile ?

I modified several applications to use the real whitepoint and not D50 
for on screen proofing.

However cmsSetAdaptationState() works only globally, which makes not so 
much sense for displaying multiple documents with different settings at 
the same time. A API for setting the adaption state per transform would 
be very appreciated.

kind regards
Kai-Uwe

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user