Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Keeping images on the video card



I took my video layering thing from before and added masked each frame with a CI Kernel taking in some random mask (currently a circle) and outputting that, I also had to change the depth buffering to not have the rectangle clip.

First of all, is the CI Kernel the fastest way to do this? or should I be using Blend With Mask?

General rule is that, if there's already a Core Image filter that does what you need, you should use it as it has been written by us and will be optimal - that does not say you cannot write efficient kernels, but it's less work :)

Secondly, I noticed it was getting a bit slow with many layers, so I tried to pull the masking out of the loop, and only do it once per frame. I saw no way to do this in the current composition so I made a new one that takes an image as input, masks it with the CI kernel, and outputs an image. I instantiated a QCRenderer with this composition, then in the renderAtTime: method when I get a frame from the quicktime player, I apply the mask using the new composition, and then add that image into the array and then feed it into the old composition. I've found the performance from this to be terrible, even compared to the CI kernel working on each frame every time the main composition is rendered, which seems silly.

That's because -valueForOutputKey will always output a NSImage for Image ports and that kills performance when chaining compositions this way.

This probably sounds overcomplicated, but basically I think it comes down to the fact that extracting an Image from a QCRenderer hinders performance if you want to use that image in another QCRenderer because it can only be an NSImage, and I want to get around this. If you want a copy of the project I'll put it up somewhere.

Your analysis is correct, and unfortunately given the current API lacks a way to specify how you would like to retrieve the images produced by a composition, there's no way to do that.


________________________________________________________

Pierre-Olivier Latour                            email@hidden

Quartz Composer Architect                Graphic & Imaging Team


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/email@hidden

This email sent to email@hidden

References: 
 >Keeping images on the video card (From: Tom Birch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.