Theocacao
Leopard
Design Element
Comment on "Convert an NSImage to CIImage"
by George — Nov 14
Two thoughts:
If you know your NSImage contains an NSBitmapImageRep you can eliminate the TIFFRepresentation line with something like:
bitmap = [myImage bestRepresentationForDevice:nil];
or
bitmap = [[myImage representations] objectAtIndex:0];

Yes less general and I have no idea if TIFFRepresentation adds significant overhead.

Secondly, if you're not applying any other CIFilters, is there any reason to convert an NSImage to CIImage? I first assumed it was just the simplicity of your example, but now I'm wondering if there is some other reason you'd need a CIImage over an NSImage....
Back to "Convert an NSImage to CIImage"
Design Element

Copyright © Scott Stevenson 2004-2015