Fast RGBA <-> ARGB conversion ?

[quote]can you make an example, an how-to that shows how to do RGBA-ARGB with OpenGL ?
[/quote]
You don’t need to do an RGBA-ARGB conversion. First of all, you should be using TYPE_4BYTE_ABGR for your BufferedImages. This makes it straightforward:


glReadPixels(0, 0, w, h, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, buffer);

byte[] pixels = new byte[IMAGE_SIZE];
buffer.get(pixels);

BufferedImage image = new BufferedImage(w, h, BufferedImage.TYPE_4BYTE_ABGR);
image.getRaster().setDataElements(0, 0, w, h, pixels);

Make sure you cache the temp byte[] and BufferedImage if you do this often.

Nice suggestions, thanks.

One thing for CAS:

ahem…how to use extensions in LWJGL ?
I couldn’t find the define for GL_EXT_bgra.

For spasi:

Yes, Java2D is so flexible.
My video-out framebuffer is not! It will never understand other than ARGB…

–ADDENDUM–

Found it: EXTBgra.GL_BGRA_EXT
Result: it works at hardware speed (FX5700)!
Finally: many thanks CAS, Spasi.