Theocacao
Leopard
Design Element
Comment on "Convert an NSImage to CIImage"
by Alex Keresztes — Nov 14
I had to do this in the past and I did this by adding new categories to NSImage:
- (NSBitmapImageRep *)bitmap;
{
NSSize imgSize = [self size];
NSBitmapImageRep* bitmap = [NSBitmapImageRep alloc];

[self lockFocus];
[bitmap initWithFocusedViewRect:NSMakeRect(0.0, 0.0, imgSize.width, imgSize.height)];
[self unlockFocus];

return bitmap;
}

- (CIImage *)CIImage;
{
return [[CIImage alloc] initWithBitmapImageRep:[self bitmap]];
}

Seems like this is probably the solution that Dan Wood was referring to?
Back to "Convert an NSImage to CIImage"
Design Element

Copyright © Scott Stevenson 2004-2015