On 25 Aug 2008, at 16:58, Tim Andersson wrote:


24 aug 2008 kl. 23.20 skrev Jonathan Dann:


On 24 Aug 2008, at 17:45, Tim Andersson wrote:

YMMV but I'd start with a window as shown in this sample code

http://developer.apple.com/samplecode/RoundTransparentWindow/index.html

and then replace the view with a custom view, and apply a CI filter as shown here

http://www.kickingbear.com/blog/?m=200803

Hope this helps, let me know how you get on if that's ok?

Jonathan

http://espresso-served-here.com

I'm not getting on very well.. I don't understand how I'm supposed to apply the CIFilter to my custom view. What is the "concept" of applying the filter? For example, the concept of applying a CIFilter to a CIImage is roughly: Create a CIContext which will draw the image, create an CIImage, "apply" the CIFilter and draw the image using the CIContext.

Many thanks,
Tim Andersson


That sounds right to me.

It seems that you will have to make a transparent custom view and a transparent window. From there you make the view the content view of your transparent window. When it comes to drawing your transparent view you need to draw into CGLayers. As demonstrated in the sample code on http://www.kickingbear.com/blog/?m=200803 draw your view first into a GCLayer, see -lockFocusOnViewLayer. Then lock focus on your own custom view's "mask" layer and fill the bounds of your view with [NSColor whiteColor]. Then you have the job of post processing what you just filled (the mask image).

The steps in the application of a CIIFilter to an image are described here:

http://developer.apple.com/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_tasks/chapter_3_section_5.html#/ /apple_ref/doc/uid/TP30001185-CH203-BAJDDCEE

which I won't re-hash 'cos I'm not confident enough with CoreImage not to butcher it. But have a look at the sample code on the kickingbear blog, the application is carried out in the -[KBPostProcessedTableView applyPostProcess] methods. Which creates a CIFilter with CIBlendWithMask, and draws the output image into a CIContext.

Hope that's a little clearer.

Jonathan

http://espresso-served-here.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to