Seeing Alpha after CIFilters Mark Coniglio Wed Feb 07 18:13:03 2007
Hi All,I am sourcing some CIFilters from a QuickTime movie, and seeing the black pixels on the edge of my image drawing as green in the final rendering.
I'm rendering it into an OpenGL context using code quite similar to that seen under contextWithCGLContext:pixelFormat:options: at
http://developer.apple.com/documentation/GraphicsImaging/Reference/QuartzCoreFramework/Classes/CIContext_Class/Reference/Reference.html Most importantly, I'm using the blend mode suggested there glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);I'm going from QT Movie -> CI Torus Lens Distortion -> CI Crop -> Open GL Draw. When the lens of the torus distortion goes past the edge of the image, I see the green pixels. I reckon this has something to do with the fact that YUV black is RGB green -- see an image at http://www.troikatronix.com/files/green-pix.png If you render the image on top of a checkerboard of gray/white squares, you'll see that the green portion is at least partially transparent. (See http://www.troikatronix.com/files/green-pix-bkg.png)
Now, if I switch the blend mode setting to GL_SRC_ALPHA instead of GL_ONE, the green pixels go away -- I'm sure this is because the alpha of the green areas is zero. But this causes other problems with layering when using GL_SRC_ALPHA.
Finally, if I put a CI Crop immediately after the QuickTime movie (before the torus) and limit the size of the frame to the same resolution as the QuickTime movie, the problem goes away, even when using glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA). I'm assuming those edge pixels get limited by the crop.
Is there a way to force those edge pixels to black/zero alpha without using the crop?
Best, Mark -- ======================================================================= Mark Coniglio | [EMAIL PROTECTED] TroikaTronix | http://www.troikatronix.com/ Isadora® | http://www.troikatronix.com/isadora.html | (interactive media processing environment) ======================================================================= _______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list ([EMAIL PROTECTED]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/alexiscircle%40gmail.com This email sent to [EMAIL PROTECTED]