> I would suggest to reduce the number of operations
> you do to BufferedImages. If you use some temp. buffered
> images for rendering, consider changing them to
> translucent volatile images (assuming you don't need access to
> pixels).
> This will not affect performance when these are not
> accelerated but will help when they are.
Dmitri,
I did not see any change (on unaccelerated pipeline) between these two ways to
create an offscreen image:
[code]
BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics = (Graphics2D) image.getGraphics().create();
graphics.setColor(new Color(0, 0, 0, 0));
graphics.setComposite(AlphaComposite.Src);
graphics.fillRect(0, 0, width, height);
graphics.dispose();
return image;
[/code]
and
[code]
GraphicsEnvironment e = GraphicsEnvironment
.getLocalGraphicsEnvironment();
GraphicsDevice d = e.getDefaultScreenDevice();
GraphicsConfiguration c = d.getDefaultConfiguration();
BufferedImage compatibleImage = c.createCompatibleImage(width, height,
Transparency.TRANSLUCENT);
return compatibleImage;
[/code]
Substance uses image caches to speed up the painting. So the two code samples
above play a very central role in the Substance painting pipeline. Release 4.3
uses the first approach. Should i use the second one, and if not, what is the
correct way to create translucent volatile images that can be cached and
rendered multiple times?
Thanks for looking into this.
Kirill
[Message sent by forum member 'kirillcool' (kirillcool)]
http://forums.java.net/jive/thread.jspa?messageID=270836
===========================================================================
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".