>        I have forwarded your mail to my colleague responsible for the OpenGL
>program, and I intend to fix my Java program as soon as possible. From
>what I could gather of your very informative explanation, I have to draw
>my output first to a buffered image created explicity with an alpha
>channel and using premultiplied alpha. Then the contents of this image
>should be drawn on the screen using the (default) SrcOver rule.
>        The OpenGL guy will have to work a bit harder, but I guess we are on
>track now. Thanks a lot.

Yes, you're right about the way to do alpha compositing in the general case
using Java 2D, since the screen will usually (always in Sun's reference
implementation) not have an alpha channel.

After I wrote the OpenGL program, I thought of a potentially better way to
it.  You could draw each instance of the gray grid and circles to its
proper place in the frame buffer (start with the frame buffer cleared
to 0, 0, 0, 0), then fill the entire window with an opaque white rectangle
using the OpenGL equivalent of the Dst Over Src rule.  This would avoid
all the calls to glReadPixels and glDrawPixels, which seem to be very
slow on the OpenGL implementation I was using.  I haven't tested this,
but it should work.

Jerry

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to