Hello
I have an odd problem. I am porting part of an app to a QC plugin. The
app draws to a CAOpenGLLayer, and uses some basic texture uploading to
a quad.
To provide an output image via the QCPluginOutputImageProvider
protocol, I use the convenience method
outputImageProviderFromTextureWithPixelFormat.
The plugin backend gets images from various different 'engines', and
with the CAOpenGLLayer, the following texture upload works properly
and displays the image with the proper gamma:
glEnable( GL_TEXTURE_RECTANGLE_EXT );
GLuint texName = 1;
glGenTextures(1, &texName);
[gameBuffer updateBuffer];
glBindTexture( GL_TEXTURE_RECTANGLE_EXT, texName);
glTexImage2D( GL_TEXTURE_RECTANGLE_EXT, 0, [gameBuffer internalForm],
[gameBuffer width], [gameBuffer height], 0, [gameBuffer pixelForm],
[gameBuffer pixelType], [gameBuffer buffer]);
glBegin(GL_QUADS); // Draw A Quad
{
glTexCoord2f(0.0f, 0.0f);
glVertex2f(0.0f, 0.0f);
glTexCoord2f([gameBuffer width], 0.0f );
glVertex2f( [self bounds].size.width, 0.0f);
glTexCoord2f([gameBuffer width], [gameBuffer height]);
glVertex2f([self bounds].size.width,[self bounds].size.height);
glTexCoord2f(0.0f, [gameBuffer height]);
glVertex2f(0.0f,[self bounds].size.height);
}
glEnd(); // Done Drawing The Quad
CGLFlushDrawable(glContext);
glDeleteTextures(1,&texName);
}
Simple enough.
Now, I use the same texture upload and pass it to the
outputImageProviderFromTextureWithPixelFormat method. If I use
kCGColorSpaceGenericRGB, all but one engine outputs a proper image. If
I switch to kCGColorSpaceGenericRGBLinear, every backend engine
outputs correctly. Why would a gamma shift be responsible for an image
to not output at all via the
outputImageProviderFromTextureWithPixelFormat? Does
outputImageProviderFromTextureWithPixelFormat only work with
kCGColorSpaceGenericRGBLinear properly?
Anyone have any clues? Id rather not wash out our images, and figure
out why kCGColorSpaceGenericRGBLinear works by kCGColorSpaceGenericRGB
does not.
Thank you!
_______________________________________________
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]