1

I know that most screens are RGB, but is there a way in Java to detect if a display is physically using RGB or BGR order?

(note that I'm definitely not talking about the way images are stored in software nor in the video card's memory but about the physical property of the display(s) the Java app is running on)

SyntaxT3rr0r
  • 27,745
  • 21
  • 87
  • 120
  • I see at least one super hacky way to determine this (that would at least work in some case) but it's such an amazing hack that I'd rather not use it. – SyntaxT3rr0r Oct 25 '10 at 15:04
  • 3
    Display the first color full screen and instruct the user to show it to a bull. If the bull destroys the device, you know it was red ;-) – Péter Török Oct 25 '10 at 15:14
  • @Péter Török: +1 funny but it wouldn't work: you either say "send red" and then a pixel with a red component appears, no matter if the screen is physically in RGB or BGR order. Same if you say "send green": it shall be green no matter the order. And you can't tell "send first color", there's no such thing available to us mere programmers :) *Red is red, no matter the BGR/RGB order* (now that's a tagline :) – SyntaxT3rr0r Oct 25 '10 at 15:18
  • 2
    @Péter Török: even worse, bulls are color blind http://en.wikipedia.org/wiki/Cattle#Anatomy :-) – Sean Patrick Floyd Oct 25 '10 at 15:26
  • 2
    @seanizer, oh shucks. A hardware problem :-) – Péter Török Oct 25 '10 at 16:10

1 Answers1

2

There's no feedback from the screen that will identify it as one type or the other. The only method I know is to present the user with two choices and have them select the one that looks best.

Mark Ransom
  • 299,747
  • 42
  • 398
  • 622
  • wait, you mean there's no feedback at all or only no feedback accessible from pure Java? – SyntaxT3rr0r Oct 25 '10 at 15:15
  • hmmm now I seem to remember Microsoft's ClearType (their renamed version of sub-pixel AA / "rgb decimation") allows the user to pick between RGB/BGR, which kinda makes sense if there's no way for the OS to get this info from the monitor. – SyntaxT3rr0r Oct 25 '10 at 15:23
  • @Webinator, yes that's what I was basing my answer on - if Microsoft couldn't do it, what chance do us mere mortals have? – Mark Ransom Oct 25 '10 at 15:33