src/share/classes/sun/java2d/cmm/lcms/LCMSTransform.java

Print this page




 144             if (ID != 0L) {
 145                 // Disposer will destroy forgotten transform
 146                 disposerReferent = new Object();
 147             }
 148             inFormatter = in.pixelType;
 149             isInIntPacked = in.isIntPacked;
 150 
 151             outFormatter = out.pixelType;
 152             isOutIntPacked = out.isIntPacked;
 153 
 154             ID = LCMS.createNativeTransform(profileIDs, renderType,
 155                                             inFormatter, isInIntPacked,
 156                                             outFormatter, isOutIntPacked,
 157                                             disposerReferent);
 158         }
 159 
 160         LCMS.colorConvert(this, in, out);
 161     }
 162 
 163     public void colorConvert(BufferedImage src, BufferedImage dst) {
 164         if (LCMSImageLayout.isSupported(src) &&
 165             LCMSImageLayout.isSupported(dst))
 166         {
 167             doTransform(new LCMSImageLayout(src), new LCMSImageLayout(dst));




 168             return;
 169         }
 170         LCMSImageLayout srcIL, dstIL;

 171         Raster srcRas = src.getRaster();
 172         WritableRaster dstRas = dst.getRaster();
 173         ColorModel srcCM = src.getColorModel();
 174         ColorModel dstCM = dst.getColorModel();
 175         int w = src.getWidth();
 176         int h = src.getHeight();
 177         int srcNumComp = srcCM.getNumColorComponents();
 178         int dstNumComp = dstCM.getNumColorComponents();
 179         int precision = 8;
 180         float maxNum = 255.0f;
 181         for (int i = 0; i < srcNumComp; i++) {
 182             if (srcCM.getComponentSize(i) > 8) {
 183                  precision = 16;
 184                  maxNum = 65535.0f;
 185              }
 186         }
 187         for (int i = 0; i < dstNumComp; i++) {
 188             if (dstCM.getComponentSize(i) > 8) {
 189                  precision = 16;
 190                  maxNum = 65535.0f;




 144             if (ID != 0L) {
 145                 // Disposer will destroy forgotten transform
 146                 disposerReferent = new Object();
 147             }
 148             inFormatter = in.pixelType;
 149             isInIntPacked = in.isIntPacked;
 150 
 151             outFormatter = out.pixelType;
 152             isOutIntPacked = out.isIntPacked;
 153 
 154             ID = LCMS.createNativeTransform(profileIDs, renderType,
 155                                             inFormatter, isInIntPacked,
 156                                             outFormatter, isOutIntPacked,
 157                                             disposerReferent);
 158         }
 159 
 160         LCMS.colorConvert(this, in, out);
 161     }
 162 
 163     public void colorConvert(BufferedImage src, BufferedImage dst) {
 164         LCMSImageLayout srcIL, dstIL;
 165         
 166         dstIL = LCMSImageLayout.createImageLayout(dst);
 167         
 168         if (dstIL != null) {
 169             srcIL = LCMSImageLayout.createImageLayout(src);
 170             if (srcIL != null) {
 171                 doTransform(srcIL, dstIL);
 172                 return;
 173             }
 174         }
 175         
 176         Raster srcRas = src.getRaster();
 177         WritableRaster dstRas = dst.getRaster();
 178         ColorModel srcCM = src.getColorModel();
 179         ColorModel dstCM = dst.getColorModel();
 180         int w = src.getWidth();
 181         int h = src.getHeight();
 182         int srcNumComp = srcCM.getNumColorComponents();
 183         int dstNumComp = dstCM.getNumColorComponents();
 184         int precision = 8;
 185         float maxNum = 255.0f;
 186         for (int i = 0; i < srcNumComp; i++) {
 187             if (srcCM.getComponentSize(i) > 8) {
 188                  precision = 16;
 189                  maxNum = 65535.0f;
 190              }
 191         }
 192         for (int i = 0; i < dstNumComp; i++) {
 193             if (dstCM.getComponentSize(i) > 8) {
 194                  precision = 16;
 195                  maxNum = 65535.0f;