Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to Swap Red and Blue in RGB.

13084882-9342-401b-82fc-023ad2e7d236Sep 15 2014 — edited Sep 15 2014

I am running a Java application (JRE 1.8.0_20) on a x86 system (Linux Kernel 3.13.0-35-generic) that has as main display an USB LCD that has a framebuffer driver. It stores the pixel data in BGR (565) order (according to the LCD manufacturer). All applications seems to display the colors right but those that runs on JVM, that are swapping red and blue colors (see images below).

2014-09-15 15.36.19.jpg2014-09-15 15.38.13.jpg

At the left there is a simple Java app showing a jpg. If the same image openned from Firefox, it shows the right colors. Note also that the Java cup is rendered with the proper colors.

So I modified the driver source code to swap red and blue, hoping that this way, Java apps were shown ok. Oddly enough, Java apps still shown as if no change was made on the dirvers (all other apps did reflect the color swap).

2014-09-15 17.10.42.jpg

After swapping red and blue at a driver level, all aplications reflect a change, but but not the Java apps.

So at this point I need some help from the community:

  • Can I "tell" the JVM the color order it should use to draw its UI to the Framebuffer?
  • Is there another walk around. I am afraid that if I have to manipulate all the images in the Java app to correct this problem, it would have a negative impact on the performance.

Thanks ofr reading and best regards.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 13 2014
Added on Sep 15 2014
0 comments
1,032 views