Package com.google.code.appengine.awt.color

Examples of com.google.code.appengine.awt.color.ColorSpace


            throw new IllegalArgumentException(Messages.getString("awt.261")); //$NON-NLS-1$
        }
       
        // Get destination color space
        Object destination = conversionSequence[nSpaces-1];
        ColorSpace dstCS =
            (destination instanceof ColorSpace) ?
                    (ColorSpace) destination :
                    new ICC_ColorSpace((ICC_Profile) destination);
       
        ColorModel srcCM = src.getColorModel();    
View Full Code Here


        ColorModel srcCM = src.getColorModel();
        // First handle index color model
        if (srcCM instanceof IndexColorModel) {           
            src = ((IndexColorModel) srcCM).convertToIntDiscrete(src.getRaster(), false);
        }
        ColorSpace srcCS = srcCM.getColorSpace();       
               
        BufferedImage res;
        boolean isDstIndex = false;
        if (dst != null) {
         
          if (src.getWidth() != dst.getWidth() ||
             src.getHeight() != dst.getHeight()) {
              throw new IllegalArgumentException(Messages.getString("awt.263")); //$NON-NLS-1$
          }

            if (dst.getColorModel() instanceof IndexColorModel) {
                isDstIndex = true;
                res = createCompatibleDestImage(src, null);
            } else {               
                res = dst;
            }          
        } else {
            res = createCompatibleDestImage(src, null);
        }
        ColorModel dstCM = res.getColorModel();
        ColorSpace dstCS = dstCM.getColorSpace();
       
        ICC_Profile srcPf = null, dstPf = null;
        if (srcCS instanceof ICC_ColorSpace) {
            srcPf = ((ICC_ColorSpace)srcCS).getProfile();
        }
View Full Code Here

            Object sequence[],
            float tmpData[][],
            ColorSpace srcCS,
            ColorSpace dstCS
            ) {
        ColorSpace xyzCS = ColorSpace.getInstance(ColorSpace.CS_CIEXYZ);
       
        int numPixels = tmpData.length;
       
        // First transform...
        if (sequence[0] instanceof ICC_Transform) { // ICC
            ICC_Transform t = (ICC_Transform)sequence[0];
            cc.translateColor(t, tmpData, srcCS, xyzCS, numPixels);
        } else { // non ICC
            for (int k=0; k<numPixels; k++) {
                tmpData[k] = srcCS.toCIEXYZ(tmpData[k]);
            }
            cc.loadScalingData(xyzCS); // prepare for scaling XYZ
        }
       
        for (Object element : sequence) {
            if (element instanceof ICC_Transform) {
                ICC_Transform t = (ICC_Transform)element;
                cc.translateColor(t, tmpData, null, null, numPixels);
            } else {
                ColorSpace cs = (ColorSpace) element;
                for (int k=0; k<numPixels; k++) {
                    tmpData[k] = cs.fromCIEXYZ(tmpData[k]);
                    tmpData[k] = cs.toCIEXYZ(tmpData[k]);
                }
            }
        }
       
        // Last transform...
View Full Code Here

                    maxComponents =
                        (maxComponents > t.getNumOutputChannels() + 1) ?
                            maxComponents :
                            t.getNumOutputChannels() + 1;
                } else {
                    ColorSpace cs = (ColorSpace) o;
                    maxComponents =
                        (maxComponents > cs.getNumComponents() + 1) ?
                            maxComponents :
                            cs.getNumComponents() + 1;
                }              
            }
           
            return sequence.toArray();
        }
View Full Code Here

TOP

Related Classes of com.google.code.appengine.awt.color.ColorSpace

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.