System:
Microsoft Windows 2000
5.00.2195
Service Pack 4
Computer:
AMD Athlon XP 2100+
512 MB Ram
Club3D ATI Radeon 9600 Non-pro 256 MB (Driver-version: 6.14.10.6599)
Little Test Case:
import javax.media.opengl.GLAutoDrawable;
import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLDrawableFactory;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLPbuffer;
import com.sun.opengl.util.Screenshot;
public class AlphaSlowTestCase implements GLEventListener{
private static final long serialVersionUID = 1L;
private int width, height;
public AlphaSlowTestCase(){
GLCapabilities glcaps = new GLCapabilities();
for(height = 48 ; height <= 1536 ; height *= 2){
width = (int)((double)height / 0.75);
GLPbuffer pBuffer = GLDrawableFactory.getFactory().createGLPbuffer(glcaps,
null, width, height, null);
pBuffer.addGLEventListener(this);
pBuffer.display();
try {Thread.sleep(2000);} catch (InterruptedException e) {}
}
}
public static void main(String[] args) {
new AlphaSlowTestCase();
}
public void display(GLAutoDrawable arg0) {
long timestamp1, timestamp2, differenceAlpha, differenceNoAlpha;
timestamp1 = System.nanoTime();
Screenshot.readToBufferedImage(width, height, false);
timestamp2 = System.nanoTime();
differenceNoAlpha = (timestamp2 - timestamp1) / 1000000;
timestamp1 = System.nanoTime();
Screenshot.readToBufferedImage(width, height, true);
timestamp2 = System.nanoTime();
differenceAlpha = (timestamp2 - timestamp1) / 1000000;
System.out.println("Screenshot with resolution " + width + "x" + height + "\n");
System.out.println("Without Alphachannel\tWith Alphachannel");
System.out.println(differenceNoAlpha + "ms\t\t\t" + differenceAlpha + "ms\n");
}
public void displayChanged(GLAutoDrawable arg0, boolean arg1, boolean arg2) {}
public void init(GLAutoDrawable arg0) {}
public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {}
}
Test results:
[i]Screenshot with resolution 64x48
Without Alphachannel With Alphachannel
57ms 6ms
Screenshot with resolution 128x96
Without Alphachannel With Alphachannel
7ms 24ms
Screenshot with resolution 256x192
Without Alphachannel With Alphachannel
12ms 90ms
Screenshot with resolution 512x384
Without Alphachannel With Alphachannel
30ms 369ms
Screenshot with resolution 1024x768
Without Alphachannel With Alphachannel
118ms 1566ms
Screenshot with resolution 2048x1536
Without Alphachannel With Alphachannel
582ms 5916ms[/i]
I think 10 times slower isn’t normal at all ???