All you have to do is something like:
[v001MixerRenderer renderAtTime:time arguments:nil];
mixerResult = [v001MixerRenderer valueForOutputKey:@"EffectOutput1"
ofType:@"QCImage"];
[v001DestinationRenderer setValue:mixerResult
forInputKey:@"DestinationInput1"];
so - here we have 2 QCrenderers, named v001MixerRenderer and
v001DestinationRenderer.
v001MixerRenderer has a published output called EffectOutput1 of Image
type.
v001DestinationRenderer has a published Input called DestinationInput1
of image type (which then goes to a billboard :) )
all this is doing is calling renderAtTime for the mixer (this renders
the QCComposition and actually MAKES the output image), passes its
image output to a variable called mixerResult, and binding setting it
to the destination renderer.
Note mixerResult is a variable type id (a non typed pointer, (no need
for * ), not a CIImage or CGIimage or NSImage, since QC uses opaque
types for rendering, since it takes various different types of image
inputs, it has its own image handler type called QCImage, which is a
wrapper for all the image formats. You cant make a QCImage from
scratch, since it is 'opaque'. (I fell into this trap at first) Dont
ask, i dont know, but use ofType:QCImage for speed to avoid any
unknown background conversion of image types. I typically pass in
CIImages if I make stuff outside of QC and it seems perfectly fast
enough.
Also note since the QCRenderers are different comps they do NOT have
to be bound to the same output or window. I may re-use 'mixerResult'
and send it to various other places, to do image routing , etc.
So youd just make two windows, make two QCRenderers and pass the keys
like above.
On Apr 20, 2008, at 3:19 PM, Michael Diehr wrote:
Sample code? Specifically, I want to have composition A playing in
a window on the main screen, and composition B playing (in a NSView
or QCrenderer, I don't care) on the 2nd screen. I want to forward
an output image port from comp. A to an input port on comp. B. If
anyone has a code snippet for such port-forwarding, I'd be very
grateful! thx!
-mike
On Mar 20, 2008, at 11:12 AM, Troy Koelling wrote:
No, it shouldn't be hard, but hardness is usually gauged by
experience and I don't know how much you have.
You might want to subclass the QCView and override
renderAtTime:arguments: for the quickest to implement (but least
elegant) way to transfer the values from one composition to the
other. There may be a performance hit, so this would be best if the
values can be signal type events that only call setValue:
forInputKey: when the value has actually changed. This would mean
video paths and play/pause events rather than continuous alpha
values.
The cleaner solution is to use a Patch Controller object, add an
observer to the output keypath and change the values of the second
composition only when they change on the first. Whenever I
introduce bindings into one of my projects it always takes longer
than I hoped so only venture here if you have experience with
bindings.
Have you also considered the Network Broadcaster/Receiver patches
to communicate?
On Mar 20, 2008, at 12:28 AM, neb wrote:
I've built two compositions, one a clip selection and interface
tool, and the other a video rendering mixer. The rendering mixer
needs to use full-screen on a second monitor, with the control
interface windowed or maximized on the main screen.
Will I be able to get these to run at the same time and "speak" to
each other through published inputs/outputs without much (any)
hard programming, or will I need to combine them into one patch to
split across the two screens? I've tried using quartz composer
visualizer, and found out too late that the interface composition
doesn't count as a "dedicated processing composition".
I hate to say this but it's fairly imperative I figure out how to
do this tomorrow morning, I've got a deadline that's about to hit
me in the forehead. If they have to be merged into a single
composition, it's doable but messy as I don't know what the
resolution or video mode support of the projector is.
Thanks a million in advance for any help!
-Neb
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected]
)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/tkoelling%40apple.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected]
)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/md03%40xochi.com
This email sent to [EMAIL PROTECTED]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]