Java Code Examples for sun.java2d.cmm.ColorTransform#Simulation

The following examples show how to use sun.java2d.cmm.ColorTransform#Simulation . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColorConvertOp.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 2
Source File: ColorConvertOp.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 3
Source File: ColorConvertOp.java    From jdk-1.7-annotated with Apache License 2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 4
Source File: ColorConvertOp.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 5
Source File: ColorConvertOp.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 6
Source File: ColorConvertOp.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 7
Source File: ColorConvertOp.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 8
Source File: ColorConvertOp.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 9
Source File: ColorConvertOp.java    From Java8CN with Apache License 2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 10
Source File: ColorConvertOp.java    From jdk1.8-source-analysis with Apache License 2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 11
Source File: ColorConvertOp.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 12
Source File: ColorConvertOp.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 13
Source File: ColorConvertOp.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 14
Source File: ColorConvertOp.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 15
Source File: ColorConvertOp.java    From JDKSourceCode1.8 with MIT License 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 16
Source File: ColorConvertOp.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 17
Source File: ColorConvertOp.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}
 
Example 18
Source File: ColorConvertOp.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
private void updateBITransform(ICC_Profile srcProfile,
                               ICC_Profile destProfile) {
    ICC_Profile[]    theProfiles;
    int              i1, nProfiles, nTransforms, whichTrans, renderState;
    ColorTransform[]  theTransforms;
    boolean          useSrc = false, useDest = false;

    nProfiles = profileList.length;
    nTransforms = nProfiles;
    if ((nProfiles == 0) || (srcProfile != profileList[0])) {
        nTransforms += 1;
        useSrc = true;
    }
    if ((nProfiles == 0) || (destProfile != profileList[nProfiles - 1]) ||
        (nTransforms < 2)) {
        nTransforms += 1;
        useDest = true;
    }

    /* make the profile list */
    theProfiles = new ICC_Profile[nTransforms]; /* the list of profiles
                                                   for this Op */

    int idx = 0;
    if (useSrc) {
        /* insert source as first profile */
        theProfiles[idx++] = srcProfile;
    }

    for (i1 = 0; i1 < nProfiles; i1++) {
                               /* insert profiles defined in this Op */
        theProfiles[idx++] = profileList [i1];
    }

    if (useDest) {
        /* insert dest as last profile */
        theProfiles[idx] = destProfile;
    }

    /* make the transform list */
    theTransforms = new ColorTransform [nTransforms];

    /* initialize transform get loop */
    if (theProfiles[0].getProfileClass() == ICC_Profile.CLASS_OUTPUT) {
                                    /* if first profile is a printer
                                       render as colorimetric */
        renderState = ICC_Profile.icRelativeColorimetric;
    }
    else {
        renderState = ICC_Profile.icPerceptual; /* render any other
                                                   class perceptually */
    }

    whichTrans = ColorTransform.In;

    PCMM mdl = CMSManager.getModule();

    /* get the transforms from each profile */
    for (i1 = 0; i1 < nTransforms; i1++) {
        if (i1 == nTransforms -1) {         /* last profile? */
            whichTrans = ColorTransform.Out; /* get output transform */
        }
        else {      /* check for abstract profile */
            if ((whichTrans == ColorTransform.Simulation) &&
                (theProfiles[i1].getProfileClass () ==
                 ICC_Profile.CLASS_ABSTRACT)) {
            renderState = ICC_Profile.icPerceptual;
                whichTrans = ColorTransform.In;
            }
        }

        theTransforms[i1] = mdl.createTransform (
            theProfiles[i1], renderState, whichTrans);

        /* get this profile's rendering intent to select transform
           from next profile */
        renderState = getRenderingIntent(theProfiles[i1]);

        /* "middle" profiles use simulation transform */
        whichTrans = ColorTransform.Simulation;
    }

    /* make the net transform */
    thisTransform = mdl.createTransform(theTransforms);

    /* update corresponding source and dest profiles */
    thisSrcProfile = srcProfile;
    thisDestProfile = destProfile;
}