Examples of ICC_Transform


Examples of org.apache.harmony.awt.gl.color.ICC_Transform

          dst = createCompatibleDestRaster(src);
        }
       
        if (isICC) {
            // Create transform
            ICC_Transform t = tCreator.getTransform(srcPf, dstPf,
                    (ICC_Profile[])conversionSequence);
            cc.translateColor(t, src, dst);        
        } else {
            Object[] sequence = tCreator.getSequence(null, null);
           
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

        }
       
        boolean isFullICC = isICC && srcPf != null && dstPf != null;
       
        if (isFullICC) {
            ICC_Transform t =
                    tCreator.getTransform(srcPf, dstPf, (ICC_Profile[]) conversionSequence);
            cc.translateColor(t, src, res);
        } else { // Perform non-ICC transform
            Object sequence[] = tCreator.getSequence(
                    srcPf == null ? (Object) srcCS : srcPf,
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

       
        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...
        if (sequence[sequence.length-1] instanceof ICC_Transform) { // ICC
            ICC_Transform t = (ICC_Transform)sequence[sequence.length-1];
            cc.translateColor(t, tmpData, xyzCS, dstCS, numPixels);
        } else { // non ICC
            for (int k=0; k<numPixels; k++) {
                tmpData[k] = dstCS.fromCIEXYZ(tmpData[k]);
            }
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

                if (dstFlg != 0) {
                    profiles[pos++] = dst;
                }
            }
           
            return transform = new ICC_Transform(profiles);
        }
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

                    }
                   
                    // If only one profile left we skip the transform -
                    // it can be only CIEXYZ
                    if (profiles.size() > 1) {
                        sequence.add(new ICC_Transform(profiles.toArray(new ICC_Profile[0])));

                        // Add non-ICC color space to the sequence
                        sequence.add(conversionSequence[i]);
                    }
                   
                    profiles.clear();
                    profiles.add(xyzProfile);
                    iccSequenceStarted = false; // Sequence of ICC profiles is processed
                } else { // Add non-ICC color space to the sequence
                    sequence.add(conversionSequence[i]);
                }              
            }
           
            if (dst != conversionLast && dst != null) { // Add last profile if needed
                if (dst instanceof ICC_Profile) {
                    profiles.add(dst);
                    iccSequenceStarted = true;
                } else if (iccSequenceStarted) {
                    profiles.add(xyzProfile);
                } else {
                    sequence.add(dst); // Add last non-ICC color space to the sequence
                }
            }
           
            if (iccSequenceStarted) { // Make last transform if needed
                sequence.add(new ICC_Transform(profiles.toArray(new ICC_Profile[0])));
                if (dst != null && !(dst instanceof ICC_Profile)) {
                    sequence.add(dst); // Add last non-ICC color space to the
                                        // sequence
                }
            }

            // Calculate max number of components
            // This number will be used for memory allocation
            maxComponents = 0;
            Object o;          
            for (int i=0, size = sequence.size(); i<size; i++) {
                o = sequence.get(i);
                if (o instanceof ICC_Transform) {
                    ICC_Transform t = (ICC_Transform) o;
                    maxComponents =
                        (maxComponents > t.getNumInputChannels() + 1) ?
                            maxComponents :
                            t.getNumInputChannels() + 1;
                    maxComponents =
                        (maxComponents > t.getNumOutputChannels() + 1) ?
                            maxComponents :
                            t.getNumOutputChannels() + 1;
                } else {
                    ColorSpace cs = (ColorSpace) o;
                    maxComponents =
                        (maxComponents > cs.getNumComponents() + 1) ?
                            maxComponents :
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

    public float[] toRGB(float[] colorvalue) {
        if (toRGBTransform == null) {
            ICC_Profile sRGBProfile =
                ((ICC_ColorSpace) ColorSpace.getInstance(CS_sRGB)).getProfile();
            ICC_Profile[] profiles = {getProfile(), sRGBProfile};
            toRGBTransform = new ICC_Transform(profiles);
            if (!scalingDataLoaded) {
                scaler.loadScalingData(this);
                scalingDataLoaded = true;
            }
        }
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

            ICC_Profile[] profiles = {getProfile(), xyzProfile};
            try {
                int[] intents = {
                        ICC_Profile.icRelativeColorimetric,
                        ICC_Profile.icPerceptual};
                toXYZTransform = new ICC_Transform(profiles, intents);
            } catch (CMMException e) { // No such tag, use what we can
                toXYZTransform = new ICC_Transform(profiles);
            }

            if (!scalingDataLoaded) {
                scaler.loadScalingData(this);
                scalingDataLoaded = true;
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

    public float[] fromRGB(float[] rgbvalue) {
        if (fromRGBTransform == null) {
            ICC_Profile sRGBProfile =
                ((ICC_ColorSpace) ColorSpace.getInstance(CS_sRGB)).getProfile();
            ICC_Profile[] profiles = {sRGBProfile, getProfile()};
            fromRGBTransform = new ICC_Transform(profiles);
            if (!scalingDataLoaded) {
                scaler.loadScalingData(this);
                scalingDataLoaded = true;
            }
        }
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

            ICC_Profile[] profiles = {xyzProfile, getProfile()};
            try {
                int[] intents = {
                        ICC_Profile.icPerceptual,
                        ICC_Profile.icRelativeColorimetric};
                fromXYZTransform = new ICC_Transform(profiles, intents);
            } catch (CMMException e) { // No such tag, use what we can
                fromXYZTransform = new ICC_Transform(profiles);
            }

            if (!scalingDataLoaded) {
                scaler.loadScalingData(this);
                scalingDataLoaded = true;
View Full Code Here

Examples of org.apache.harmony.awt.gl.color.ICC_Transform

          dst = createCompatibleDestRaster(src);
        }
       
        if (isICC) {
            // Create transform
            ICC_Transform t = tCreator.getTransform(srcPf, dstPf,
                    (ICC_Profile[])conversionSequence);
            cc.translateColor(t, src, dst);        
        } else {
            Object[] sequence = tCreator.getSequence(null, null);
           
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.