[QCComposition compositionWithData:(NSData)Data]

Thomas Neugebauer's picture

Hello!

I have seen, that there are some threads on using

[QCComposition compositionWithData:(NSData)Data]

instead of initializing by "compositionWithFile".

cwright mentioned in an old thread, that it only works, if there are no "consumer patches" within the comp.

Can somebody explain me why that is? I haven't found anything about that restriction in the docs.

And is there any work-around? Except developing a custom-plugin, which renders everything into images and then being rendered into a billboard by a simple "wrapper comp"?

Thanks

dust's picture
Re: [QCComposition compositionWithData:(NSData)Data]

NSData basically converts what it is your assigning to binary primarily for the purposes of sending data over the network. you would want to publish your images as an output and then convert them separately to NSBitmaps before you NSData them. As it is much easier to turn the NSData back to an image from an NSBitmap format. do a google search and you will find a function that will convert NSData back to an image. A plugin would be perfect for this but you could just use published outputs if your in an application context.

cwright's picture
Re: [QCComposition compositionWithData:(NSData)Data]

Thomas Neugebauer wrote:
cwright mentioned in an old thread, that it only works, if there are no "consumer patches" within the comp.

citation needed? this has no such restriction that I'm aware of. did you try banging out a 10 line test program to see if it worked? If you did and it didn't work, I'd be quite interested to know.

vade's picture
Re: [QCComposition compositionWithData:(NSData)Data]

I'm so confused.

cwright's picture
Re: [QCComposition compositionWithData:(NSData)Data]

I guess the documentation has changed -- QCView and QCRenderer both accept QCCompositions, and they're pretty useless without consumers (QCRenderer can be useful without consumers, but it's only for processing scenarios -- the overwhelming majority of uses stick it on an on-screen GL context and render away).

Keep in mind that I wrote that back just around when Leopard (10.5) was new (the day after, iirc). that was so long ago, now that I think about it....