Re: [JAVA2D] Flip and draw an image by graphics.drawImage(..): Any issues known?

2009-02-23 Thread java2d
Jim, thanks for your reply. 

A 3D accelerated GPU can be assumed because [b]Java 3D[/b] is concerned. 
Drawing and flipping on the fly by graphics.drawImage(..) release Java 3D from 
copying its offscreen buffer in case of lightweight 3D rendering. This saves 
several ms per frame and allows to implement a kind of double offscreen buffer 
to avoid any visual artifacts with almost no extra cost.

Samples and source code how [b]Java 2D accelerates[/b] lightweight 3D rendering 
are continually updated on the following web pages:

Swing: http://interactivemesh.org/testspace/j3dmeetsswing.html
JavaFX: http://interactivemesh.org/testspace/j3dmeetsjfx.html

August
[Message sent by forum member 'interactivemesh' (interactivemesh)]

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

===
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
lists...@java.sun.com and include in the body of the message "help".


Re: [JAVA2D] Flip and draw an image by graphics.drawImage(..): Any issues known?

2009-02-18 Thread Jim Graham
If I understand your question correctly, you are saying that the 
performance meets your needs, so you are mainly asking if there are any 
hidden "gotchas" in that API?


If we are in a hw accelerated pipeline then I think the flipping is 
probably guaranteed to be free since image transformation is accelerated 
naturally and cheaply by most any GPU.


If we are in sw then the code will end up in the image transform 
pipelines which have slightly more overhead than the straight copy 
loops, but probably nothing noticeable when compared to manually 
flipping the image through any other means.


On the other hand, if you are dealing with the results of a 3D scene 
then I'm guessing you are only concerned about running on a 3D 
accelerated GPU and so the prior comment about "it's free on HW" is the 
more germane comment...


...jim

===
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
lists...@java.sun.com and include in the body of the message "help".


[JAVA2D] Flip and draw an image by graphics.drawImage(..): Any issues known?

2009-02-18 Thread java2d
Hi,

before I'm updating a public API I would like to know if there is any issue 
concerning the use of 'drawImage' including Y-flipping as in version 'A'? 

What about performance? It seems that both methods, 'A' and 'B', run at the 
same speed.

The JPanel and BufferedImage instances have the same size.

[code]
@Override
public void paintComponent(Graphics g) {

super.paintComponent(g); 

if (isYUp)
// A.
g.drawImage(bImage, 
// Destination rectangle
0, height, width, 0,
// Source rectangle
0, 0,  width, height, null); 
else
// B.
g.drawImage(bImage, 0, 0, null); 
}

[/code]
Are there any alternatives to flip an image during drawing?

My intention is to avoid image copying per 'System.arraycopy(..)' and to save 
up to 7 ms per frame during 3D rendering for an image of the size 1500x1100. 
Many thanks in advance.

August
[Message sent by forum member 'interactivemesh' (interactivemesh)]

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

===
To unsubscribe, send email to lists...@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
lists...@java.sun.com and include in the body of the message "help".