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 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 Python knows how to map from Python types to the C/native types.
You can also define code that converts from e. g. arbitrary array types to
the native types, performs checks, etc.
I would envision the procedure like this:
1. create (preferably auto-generate) a basic wrapper to the library:
--> _lcms.py module or something like that
2. create an lcms.py module that imports all of _lcms and adds/overrides
stuff to make the calling API more pythonic
3. create an OO API to handle lcms nicely for convenience in applications
The idea behind it is to work in a way like e. g. popen. There are the popen
functions, and then there's the Popen class that gives more elegant access to
the functionality. The _lcms module, as auto-generated would of course NOT be
edited directly, so that it can easily be updated through the generator on
any code changes to the lcms code base (lcms.h). But that shouldn't provide
any problems, as Python is so nice and dynamic in its way that it all can
easily be overridden, modified, appended, decorated, ...
Guy
--
Guy K. Kloss
Institute of Information and Mathematical Sciences
Te Kura Putaiao o Mohiohio me Pangarau
Room 2.63, Quad Block A Building
Massey University, Auckland, Albany
Private Bag 102 904, North Shore Mail Centre
voice: +64 9 414-0800 ext. 9585 fax: +64 9 441-8181
eMail: [EMAIL PROTECTED] http://iims.massey.ac.nz
signature.asc
Description: This is a digitally signed message part.
------------------------------------------------------------------------- Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW! Studies have shown that voting for your favorite open source project, along with a healthy diet, reduces your potential for chronic lameness and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________ Lcms-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/lcms-user
