On Thu, 16 Oct 2008 9:34:48 am Frédéric wrote:
> Ok, I see. Is there any gain (speed ?) to do in-place transform, instead of
> doing :
>
> rgbColours = myTransform.doTransform(rgbColours)

Well, of course. Don't know how big it is, but it is present.

Generally the doTransform() method calls internally the lcms cmsDoTransform() 
function, which *requires* an input and an output buffer, however both may be 
the same (for an in-place transform).

The doTransform() method is implemented in a way that it allocates a buffer of 
adequate size, shape and type (using a numpy array) to hold the 
transformation results if you do not pass in an outputBuffer. So you will 
definitely have the overhead of the object creation (numpy.zeros() is 
called).

If you do not want to perform an in-place transformation, but still don't want 
it to slow down, you can also create a suitable buffer yourself and use that 
one. To modify the in-place example to use a self created buffer just go as 
this:

destinationColours = numpy.zeros(rgbColours.shape,
                                 dtype=numpy.uint8)
myTransform.doTransform(rgbColours, destinationBuffer=destinationColours)

This way they should be equally fast (without verification, but I doubt that 
cmsDoTransform() differs between two buffer and in-place transformations).

Maybe I should package my stuff for others to give it a try.

Guy

-- 
Guy K. Kloss
Institute of Information and Mathematical Sciences
Te Kura Pūtaiao o Mōhiohio me Pāngarau
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://www.massey.ac.nz/~gkloss/

Attachment: signature.asc
Description: This is a digitally signed message part.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to