Hi,
<<inline: round_rect.png>>
I have a plug-in (processor) plugin that does some quartz drawing and outputs it to an image port. This works fine.
I wish (as an exercise) to turn that plug-in into a consumer and render the quartz drawing to a texture on a quad.
For the processor plugin:I have a CGContextRef, create a CGBitmapContext - draw in it. Then I create a provider (using outputImageProviderFromBufferWithPixelFormat) that is assigned to self.outputImage.
The consumer plugin code examples all create a texture and bind it using an inputImage source:
What is the easiest / correct way to create a texture from either my quartz drawing or from the provider? I'm aware that passing data around and converting between image types may be unnecessary and expensive for performance.
e.g. Searching revealed this: // Source: http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/OpenGLProg_MacOSX.pdf // gl_Texture from a quartz image source glPixelStorei(GL_UNPACK_ROW_LENGTH, overallWidth); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glGenTextures(1, &textureName); glBindTexture(GL_TEXTURE_RECTANGLE_ARB, textureName);glTexParameteri(GL_TEXTURE_RECTANGLE_ARB,GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexImage2D(GL_TEXTURE_RECTANGLE_ARB, 0, GL_RGBA8, overallWidth, overallHeight, 0, GL_BGRA_EXT, GL_UNSIGNED_INT_8_8_8_8_REV, imageData);
How does this work in a quartz composer context? Doesn't bindTextureRepresentationToCGLContext do most of this work? I guess I will need to match the pixel format? And a related question:How do I create an image usable by quartz drawing routines (for an image mask or fill for example) from an QCPlugInInputImageSource?
Any help would be gratefully received! The source code (up to this point) is here:
link: <http://ellington.tvu.ac.uk/downloads/QCRoundRectx.zip> Regards, Ian ******************************* Ian Grant Senior Lecturer in Digital Art Faculty of the Arts Thames Valley University Ealing, UK W5 5DX <[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]

