Hi Christopher, I think you've got it bang on the head (as usual :P )
I couldn't log the class of the incoming images from my plugin - because I
couldn't figure out how to get it :S
But I think you're right anyway. When I hover my mouse over the output port
of a Structure Key Member for key 'imageYes', it says QCImage. So I must be
constructing my struct correctly (in JavaScript).
The single image, is also a QCImage, but it appears in my plugin as a
QCPlugInImageInputSource - whereas the one I pull from the struct is
clearly still a QCImage judging by the error I get ([QCImage imageBounds]:
unrecognized selector sent to instance). So yea, either a bug in the API,
or you're just not supposed to send in an array of images. But either way -
I'm still stuck... so how would I go about creating an openGL texture from
a QCImage?
I was using the following code to bind:
if(imageFront && [imageFront
lockTextureRepresentationWithColorSpace:([imageFront shouldColorMatch] ?
[qcContext colorSpace] : [imageFront imageColorSpace])
forBounds:[imageFront imageBounds]]) {
[imageFront bindTextureRepresentationToCGLContext:cgl_ctx
textureUnit:GL_TEXTURE0 normalizeCoordinates:YES];
bTexture = YES;
}
and this to unbind:
if(bTexture) {
[imageFront unbindTextureRepresentationFromCGLContext:cgl_ctx
textureUnit:GL_TEXTURE0];
[imageFront unlockTextureRepresentation];
}
P.S. How on earth did you figure out all the undocumented stuff!?
On Thu, 5 Jun 2008 07:52:08 -0400, Christopher Wright <[EMAIL PROTECTED]>
wrote:
>> Hi Christopher, I'm not sure I understand what you mean. How do I do
>> what you say? I tried changing the 'imageBounds' to 'bounds' but now
>> it won't compile.
>
> Ahh, good point -- I guess that's a difference between the Official
> and Unofficial API... my mistake.
>
>> The QCPlugInImageInputSource protocol has 'imageBounds' method - and
>> the code works when I send an image in directly, its just when I try
>> to read it from the struct that it doesn't.
>>
>> i.e. at the end of the this line
>> id<QCPlugInInputImageSource> imageFront = [data.images
>> objectForKey:@"imageYes"];
>> imageFront appears not to be a QCPlugInInputImageSource I think! :S
>>
>> I thought maybe I'm creating and reading my structure wrong, and
>> actually the image is deeper or something, so I tried in QC to add a
>> Structure Key Member to the same struct I'm sending my patch, and
>> use imageYes as the key, the output port is virtual of type QCImage,
>> and when I connect to the image port of a billboard it renders fine.
>> So the structure is correct. Am i doing something wrong in
>> dereferecing the image?
>
>
> First, how are you generating the structure of images? Can you put an
> NSLog in the image version, and see what kind of class you're
> getting? Like you, I also think this is a class-confusion problem
> (QCImage is QC's internal image class, I guess official-api devs
> aren't allowed to use it or something?). To get the class do [object
> className] or something to that effect.
>
> Since it's the internal class, that's why it works on billboards
> (internal/unofficial-api patches _expect_ QCImages).
>
> This may be an official-api bug -- images are abstracted away through
> input image ports, but that abstraction is lost when you use a
> structure? Yay for unnecessary complexity ;)
>
> [in fact, looking at the class heirarchy, QCPlugInInputImageSource has
> a QCImage member variable, so this is very likely a bug: you're
> getting the raw data instead of a plugin-cooked class...]
>
> --
> [ christopher wright ]
> [EMAIL PROTECTED]
> http://kineme.net/
--
----------------------------
Mehmet S. Akten
[EMAIL PROTECTED]
www.memo.tv
+44 7958 783 832
+44 20 8123 9986
29 Ironworks
Dace Rd.
London E3 2NX
UK
_______________________________________________
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]