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

sRGB to XYZ conversion

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.3.0
    • 1.2.2
    • client-libs
    • 2d
    • kestrel
    • x86
    • windows_nt



      Name: rlT66838 Date: 08/30/99


      // Run the following Java app, I got
      // XYZ=(0.48406196, 0.5019608, 0.41397727)
      // which do not match the sRGB spec.
      // The correct XYZ should be (0.9505, 1, 1.089)

      /**
       */
      import java.awt.color.*;

      public class test
      {
         public static void main( String args[] )
         {
            try {
      float rgb[] = new float[3];
      ColorSpace srgb = ColorSpace.getInstance( ColorSpace.CS_sRGB );
      rgb[0] = 1.0F;
      rgb[1] = 1.0F;
      rgb[2] = 1.0F;
      float[] xyz = srgb.toCIEXYZ( rgb );
      System.out.println( "XYZ=(" + xyz[0] + ", " + xyz[1] + ", " + xyz[2] + ")" );
            }
            catch (Exception e) {
      System.err.println( "Error: " + e.toString() );
            }
         }
      }
      (Review ID: 94628)
      ======================================================================

            jrevans Jerald Evans (Inactive)
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: