Re: CoreImage display
Re: CoreImage display
- Subject: Re: CoreImage display
- From: Sean Murphy <email@hidden>
- Date: Sat, 2 Sep 2006 13:03:41 -0400
On Sep 1, 2006, at 10:05 AM, Yorh wrote:
I'm trying to use CoreImage API for a small test app.
I read the image from hd using CIImage imageWithData: method, after
it I have to insert another image in a certain position of the
first one and then show the result on the screen.
I know that I can use Core Image in order to paste one image on
another one, but after it how can I display the result on NSImageView?
I think I have to convert CIImage to NSImage and than use the
normal method setImage: to display it, but I really don't know how.
I read already the doc on the web but there isn't any sample about
it and the example codes in dev tools does too much for my needs.
Anyone has some idea?
The good news is that, even though you've been unable to discover any
examples, there are many ways to bridge a CIImage and an NSImage.
The Application Kit provides additions onto the CIImage class which
allow for compositing. See <http://developer.apple.com/documentation/
Cocoa/Reference/ApplicationKit/Classes/CIImage_AppKitAdditions/
index.html#//apple_ref/doc/uid/TP40003998>. A CIImage can thus be
drawn directly onto the screen, or into an NSImage object. Read the
Cocoa Drawing Guide for more a general overview of this: <http://
developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/
Images/chapter_7_section_1.html>
CIImages can also be converted to NSImages, and vice versa, by use of
their underlying image representations. Dan Wood has written a great
blog entry about this, and instead of explaining it again here, just
check out "Core Image: Practical Uses, Part 1" at <http://
gigliwood.com/weblog/Cocoa/Core_Image__Practic.html>.
Additionally, NSImage already provides all of the functionality your
app requires, which means using Core Image isn't a necessity.
Despite CI allowing for much greater control, power, and perhaps
increased performance, NSImage abstracts and simplifies much of the
creation/drawing process, making your task extremely hassle-free.
NSImages can be created from a file, composited together, and
displayed on screen very easily.
If you're writing this test app to learn Core Image, however, I'd
suggest checking out the Core Image Programming Guide: <http://
developer.apple.com/documentation/GraphicsImaging/Conceptual/
CoreImaging/ci_intro/chapter_1_section_1.html>.
Example Code to learn from:
-On your HD: /Developer/Examples/Quartz/Core Image/
-Reducer (see AnimatingTabView.{h,m})
http://developer.apple.com/samplecode/Reducer/index.html
-The excellent reference book Cocoa Programming contains a detailed
overview of Graphics and Media in Cocoa. (No Core Image, however, as
it was written during the 10.2 era)
http://www.cocoaprogramming.net/
Hopefully this helps.
-Sean
_______________________________________________
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