jdk/test/sun/java2d/cmm/ColorConvertOp/ColConvDCMTest.java
changeset 18114 8b16a9643b24
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
18113:acd987685b67 18114:8b16a9643b24
    60     final static int [] cSpaces = {
    60     final static int [] cSpaces = {
    61         ColorSpace.CS_sRGB,
    61         ColorSpace.CS_sRGB,
    62         ColorSpace.CS_LINEAR_RGB,
    62         ColorSpace.CS_LINEAR_RGB,
    63     };
    63     };
    64 
    64 
    65     final static double ACCURACY = 2.5;
    65     final static double [] ACCURACY = {
       
    66         // Accuracy for color conversions
       
    67         2.5, // sRGB
       
    68         (isOpenProfile() ? 45.0 : 2.5), // LINEAR_RGB
       
    69     };
    66 
    70 
    67     final static String [] gldImgNames = {
    71     final static String [] gldImgNames = {
    68         "SRGB.png", "SRGB555.png", "SRGB565.png", "LRGB.png", "LRGB555.png",
    72         "SRGB.png", "SRGB555.png", "SRGB565.png", "LRGB.png", "LRGB555.png",
    69         "LRGB565.png"
    73         "LRGB565.png"
    70     };
    74     };
   140         for (int i = 0; i < imgTypes.length; i++) {
   144         for (int i = 0; i < imgTypes.length; i++) {
   141             BufferedImage gldImage = gldImages[imgTypes[i][5]];
   145             BufferedImage gldImage = gldImages[imgTypes[i][5]];
   142 
   146 
   143             if (!testImage(imgTypes[i][0], imgTypes[i][1], imgTypes[i][2],
   147             if (!testImage(imgTypes[i][0], imgTypes[i][1], imgTypes[i][2],
   144                            imgTypes[i][3], cSpaces[imgTypes[i][4]], gldImage,
   148                            imgTypes[i][3], cSpaces[imgTypes[i][4]], gldImage,
   145                            ACCURACY))
   149                            ACCURACY[imgTypes[i][4]]))
   146             {
   150             {
   147                 throw new RuntimeException(
   151                 throw new RuntimeException(
   148                     "Invalid result of the ColorConvertOp for " +
   152                     "Invalid result of the ColorConvertOp for " +
   149                     "ColorSpace:" + getCSName(cSpaces[imgTypes[i][4]]) +
   153                     "ColorSpace:" + getCSName(cSpaces[imgTypes[i][4]]) +
   150                     " Image type:" +
   154                     " Image type:" +
   152                     gldImgNames[imgTypes[i][5]]);
   156                     gldImgNames[imgTypes[i][5]]);
   153             }
   157             }
   154 
   158 
   155             if (!testSubImage(SI_X, SI_Y, SI_W, SI_H, imgTypes[i][0],
   159             if (!testSubImage(SI_X, SI_Y, SI_W, SI_H, imgTypes[i][0],
   156                               imgTypes[i][1], imgTypes[i][2], imgTypes[i][3],
   160                               imgTypes[i][1], imgTypes[i][2], imgTypes[i][3],
   157                               cSpaces[imgTypes[i][4]], gldImage, ACCURACY))
   161                               cSpaces[imgTypes[i][4]], gldImage,
       
   162                               ACCURACY[imgTypes[i][4]]))
   158             {
   163             {
   159                 throw new RuntimeException(
   164                 throw new RuntimeException(
   160                     "Invalid result of the ColorConvertOp for " +
   165                     "Invalid result of the ColorConvertOp for " +
   161                      "ColorSpace:" + getCSName(cSpaces[imgTypes[i][4]]) +
   166                      "ColorSpace:" + getCSName(cSpaces[imgTypes[i][4]]) +
   162                      " Image type:" +
   167                      " Image type:" +