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

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


        public Object[] getSequence(Object src, Object dst) {
            ArrayList<Object> profiles = new ArrayList<Object>(10);
            ArrayList<Object> sequence = new ArrayList<Object>(10);        

            // We need this profile anyway
            ICC_Profile xyzProfile = ICC_Profile.getInstance(ColorSpace.CS_CIEXYZ);

            Object conversionFirst = null, conversionLast = null;
            int conversionLength = conversionSequence.length;
            if (conversionLength > 0) {
                conversionFirst = conversionSequence[0];
View Full Code Here


        if (fiStream == null) {
            // awt.161=Unable to open file {0}
            throw new IOException(Messages.getString("awt.161", fileName)); //$NON-NLS-1$
        }

        ICC_Profile pf = getInstance(fiStream);
        fiStream.close();
        return pf;
    }
View Full Code Here

        return getInstance(profileData);
    }

    public static ICC_Profile getInstance(byte[] data) {
        ICC_Profile res = null;

        try {
            res = new ICC_Profile(data);
        } catch (CMMException e) {
            // awt.162=Invalid ICC Profile Data
            throw new IllegalArgumentException(Messages.getString("awt.162")); //$NON-NLS-1$
        }

      if (System.getProperty("os.name").toLowerCase().indexOf("windows") >= 0) { //$NON-NLS-1$ //$NON-NLS-2$
        try {
            if ( res.getColorSpaceType () == ColorSpace.TYPE_RGB &&
                 res.getDataSize(icSigMediaWhitePointTag) > 0 &&
                 res.getDataSize(icSigRedColorantTag) > 0 &&
                 res.getDataSize(icSigGreenColorantTag) > 0 &&
                 res.getDataSize(icSigBlueColorantTag) > 0 &&
                 res.getDataSize(icSigRedTRCTag) > 0 &&
                 res.getDataSize(icSigGreenTRCTag) > 0 &&
                 res.getDataSize(icSigBlueTRCTag) > 0
                ) {
                res = new ICC_ProfileRGB(res.getProfileHandle());
            } else if ( res.getColorSpaceType () == ColorSpace.TYPE_GRAY &&
                        res.getDataSize(icSigMediaWhitePointTag) > 0 &&
                        res.getDataSize(icSigGrayTRCTag) > 0
                ) {
                res = new ICC_ProfileGray (res.getProfileHandle());
            }

        } catch (CMMException e) { /* return res in this case */ }
      }

View Full Code Here

    }

    @Override
    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);
View Full Code Here

    }

    @Override
    public float[] toCIEXYZ(float[] colorvalue) {
        if (toXYZTransform == null) {
            ICC_Profile xyzProfile =
                ((ICC_ColorSpace) ColorSpace.getInstance(CS_CIEXYZ)).getProfile();
            ICC_Profile[] profiles = {getProfile(), xyzProfile};
            try {
                int[] intents = {
                        ICC_Profile.icRelativeColorimetric,
View Full Code Here

    }

    @Override
    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);
View Full Code Here

    }

    @Override
    public float[] fromCIEXYZ(float[] xyzvalue) {
        if (fromXYZTransform == null) {
            ICC_Profile xyzProfile =
                ((ICC_ColorSpace) ColorSpace.getInstance(CS_CIEXYZ)).getProfile();
            ICC_Profile[] profiles = {xyzProfile, getProfile()};
            try {
                int[] intents = {
                        ICC_Profile.icPerceptual,
View Full Code Here

TOP

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

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.