Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-06 Thread Guy K. Kloss
On Mon, 07 Jul 2008 9:05:53 am Frédéric wrote: > Ok, I see. I definitly need to have a look at ctypes ;o) http://starship.python.net/crew/theller/ctypes/ The tutorial is quite good. Guy -- Guy K. Kloss Institute of Information and Mathematical Sciences Te Kura Putaiao o Mohiohio me Pangarau Ro

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-06 Thread Frédéric
On dimanche 06 juillet 2008, Guy K. Kloss wrote: > > popen-like module should be great! BTW, you still need swig/boost to > > automatically wrap and generate _lcms.py, don't you? > > Not really. The wrapping is done dynamically by ctypes, so no native > code and compile step as with SWIG/boost nec

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-06 Thread Guy K. Kloss
On Sun, 06 Jul 2008 8:14:31 pm Frédéric wrote: > popen-like module should be great! BTW, you still need swig/boost to > automatically wrap and generate _lcms.py, don't you? Not really. The wrapping is done dynamically by ctypes, so no native code and compile step as with SWIG/boost necessary. Bu

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-06 Thread Frédéric
On dimanche 06 juillet 2008, Guy K. Kloss wrote: > That depends on the way you implement it. You basically define the > binding (parameter type lists, rules on how to handle pointers, etc.) in > Python structures. The library itself is loaded dynamically, and through > the binding description Pyth

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-05 Thread Guy K. Kloss
On Sat, 05 Jul 2008 6:48:09 pm Frédéric wrote: > I think it should be a great solution. I'm not familiar with ctypes... Does > it allow to use numarray or other array-like objects to be passed to the > wrapper for conversions? That depends on the way you implement it. You basically define the bind

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-04 Thread Frédéric
On samedi 05 juillet 2008, Guy K. Kloss wrote: > Although, I'm not really very happy with that solution as it doesn't > really provide proper bindings for what's possible. I'm still very > tempted to create a ctypes based Python API. This would greatly ease the > process of wrapping as it stays in

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-04 Thread Guy K. Kloss
Hi Marti, On Fri, 04 Jul 2008 8:45:13 pm Marti.Maria wrote: > The currenty python bindings does not support floating point RGB, you > can convert values to 16 bits that > is what is lcms doing internally. You will obtain same precission. > > c = COLORW() > c[0] = int(R * 65535.0 + 0.5) > c[1] = in

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-04 Thread Marti.Maria
Hi, The currenty python bindings does not support floating point RGB, you can convert values to 16 bits that is what is lcms doing internally. You will obtain same precission. c = COLORW() c[0] = int(R * 65535.0 + 0.5) c[1] = int(G * 65535.0 + 0.5) c[2] = int(B * 65535.0 + 0.5) Regards Marti

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-02 Thread Guy K. Kloss
On Wed, 02 Jul 2008 7:06:30 pm Kai-Uwe Behrmann wrote: > lcms supports u8, u16 and f64. Your f32 has to be converted to one of > these. Beside not knowing much about python, not doing so could cause a > error. Good point. But ... ... as Python is agnostic towards the machine internal types (it kn

Re: [Lcms-user] floating point RGB values with the Python bindings

2008-07-01 Thread Kai-Uwe Behrmann
Hello Guy, lcms supports u8, u16 and f64. Your f32 has to be converted to one of these. Beside not knowing much about python, not doing so could cause a error. kind regards Kai-Uwe Behrmann -- developing for colour management www.behrmann.name + www.oyranos.org Am 02.07.08, 18:28 +1200 schr

[Lcms-user] floating point RGB values with the Python bindings

2008-07-01 Thread Guy K. Kloss
Hi, I'm having a bit trouble with the Python bindings of Lcms. I just can't figure out what type of object to create to pass as an argument 2 to the cmsDoTransform(...) function. I want to use floatint point values (0.0 to 1.0) for RGB tuples rather than byte values (0 to 255) to convert from s