Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4006792

Incorrect grayscale color on 8 bit graphics devices

    XMLWordPrintable

Details

    • 1.0.k
    • other
    • solaris_2.5
    • Not verified

    Backports

      Description

        There are certain cases in Java in which the setColor command
        does not yield a grayscale color when a grayscale color has been
        requested. The error only occurs on 8 bit graphics devices and
        is particularly prevalent on the Java terminal (Mr Coffee). The
        requested color is correct on 24 bit devices. Examination under
        the debugger shows the requested color information to be correct.

        Although on 8 bit devices, Java returns the "closest match" for
        the requested color, my understanding is that when r,g,b all have
        the same value, Java guarantees that it will return one of it's grayscale
        values. This doesn't seem to be the case in the Java applet below.
        The following applet displays a shaded disk that will have an incorrect
        color (usually either a red or yellow) for one of the shades of gray when
        run on a 8 bit graphics device. And like I said, the r, g, b values are
        all the same (according to getRed, getGreen, getBlue).

        The applet can be executed as:

             http://deadbolt.east/color_bug/Viewer.html

        Note that mouse drag operations will rotate the image.

        The source code is at:

            /net/deadbolt.east/usr2/color_bug/Viewer.html
                                              Viewer.java
                                              Model.java
                                              Matrix.java
                                              cube.wrl
                                              disk.wrl
                                              hughes.wrl
                                              sub.wrl
                                              klingon.wrl
                                              

        The setColor command is in the Model.java file in a method called render().
        The color array is defined in the Model method "set_fg_color".

        Attachments

          Issue Links

            Activity

              People

                jeff Jeff Dinkins
                duke J. Duke
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: