Hi Michael,

All BufferedImage types should be equally "manageable" as we make a copy in VRAM in whatever format is necessary for display regardless of the source image type. If the graphics card wants PRE images then the accelerated copy will be PRE, or not as the case may be.

Working on premultiplied data is usually considered a win for the blending operations since it avoids the need to have to multiply the color components by the alpha. Unfortunately, the picture isn't that simple since, while it avoids the "need" to do the multiply, the various other math operations that the blending requires can sometimes absorb the alpha multiplier into other operations and the effect ends up being minimal in practice. It would be better to benchmark the specific operations you are doing to see if there is any performance advantage.

The most straightforward way to turn an ARGB image into an ARGB_PRE image would be to render it into a different image. You might be able to use the constructor that takes a ColorModel and a Raster to do the job for you, but keep in mind that the Raster for the original image would be altered forever. It may save you the allocation of a new buffer, but I'm not sure that the implicit coercion of data that happens in that constructor (which uses coerceData in an arguably appropriate way) is as fast as rendering from one image to the other. Benchmark to see if it makes a difference one way or the other...

                        ...jim

[EMAIL PROTECTED] wrote:
Jim, thanks very much for your reply.

I'm swimming through these issues right now, trying to avoid instances of 
coerceData and figure out where to be using ARGB vs ARGB_PRE, and have the 
following concerns.  Any thoughts on these, or on further resources to look at, 
would be most appreciated.

Is there a preferred way to get premultiplied data from an ARGB image (I'm 
currently thinking create a new ARGB_PRE and call drawImage())?

What effect does using the different BufferedImage type have on graphics 
performance, e.g. managed vs. unmanaged images?  Any reason a PRE image can't 
be accelerated?  Any reason to prefer one to the other for drawing to the 
screen?

Again, thanks,
michael
[Message sent by forum member 'kazoobrewer' (kazoobrewer)]

http://forums.java.net/jive/thread.jspa?messageID=294014

===========================================================================
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".

===========================================================================
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