Re: Getting bitmap data out of an CIImageRep
Re: Getting bitmap data out of an CIImageRep
- Subject: Re: Getting bitmap data out of an CIImageRep
- From: Troy Stephens <email@hidden>
- Date: Mon, 27 Jun 2005 11:14:37 -0700
On Jun 27, 2005, at 10:58 AM, Robert Brown wrote:
I have an image generated by Core Image... now I'd like to get the
raw bitmap data out of the CIImage object. How?
I can create an CIImageRep, but it does not have any methods for
getting the data, like NSBitmapImageRep does.
Thanks,
Robb
A CIImage is essentially a "recipe" for generating the result image
on demand. To "get its [pixel] data", you must composite it into a
bitmapped destination context whose pixels you can then retrieve.
The "Reducer" code sample from WWDC includes an example of doing this:
http://developer.apple.com/samplecode/Reducer/Reducer.html
Specifically, see the -outputBitmapImageRep method in ImageReducer.m
(which is complicated slightly by the addition of border and shadow-
drawing support, but you can easily ignore those parts):
http://developer.apple.com/samplecode/Reducer/listing16.html
Alternatively, if you've created an NSCIImageRep that references the
CIImage, you can add it to an NSImage and then composite the NSImage
into a bitmapped graphics context.
--
Troy Stephens
Cocoa Frameworks
Apple Computer, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden