Java Code Examples for sun.java2d.cmm.ProfileDeferralMgr#deferring()

The following examples show how to use sun.java2d.cmm.ProfileDeferralMgr#deferring() . 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: ICC_Profile.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a byte array corresponding to the data of this ICC_Profile.
 * @return A byte array that contains the profile data.
 * @see #setData(int, byte[])
 */
public byte[] getData() {
int profileSize;
byte[] profileData;

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    PCMM mdl = CMSManager.getModule();

    /* get the number of bytes needed for this profile */
    profileSize = mdl.getProfileSize(cmmProfile);

    profileData = new byte [profileSize];

    /* get the data for the profile */
    mdl.getProfileData(cmmProfile, profileData);

    return profileData;
}
 
Example 2
Source File: ICC_Profile.java    From jdk-1.7-annotated with Apache License 2.0 6 votes vote down vote up
/**
 * Returns a byte array corresponding to the data of this ICC_Profile.
 * @return A byte array that contains the profile data.
 * @see #setData(int, byte[])
 */
public byte[] getData() {
int profileSize;
byte[] profileData;

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    PCMM mdl = CMSManager.getModule();

    /* get the number of bytes needed for this profile */
    profileSize = mdl.getProfileSize(ID);

    profileData = new byte [profileSize];

    /* get the data for the profile */
    mdl.getProfileData(ID, profileData);

    return profileData;
}
 
Example 3
Source File: ICC_Profile.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a byte array corresponding to the data of this ICC_Profile.
 * @return A byte array that contains the profile data.
 * @see #setData(int, byte[])
 */
public byte[] getData() {
int profileSize;
byte[] profileData;

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    PCMM mdl = CMSManager.getModule();

    /* get the number of bytes needed for this profile */
    profileSize = mdl.getProfileSize(cmmProfile);

    profileData = new byte [profileSize];

    /* get the data for the profile */
    mdl.getProfileData(cmmProfile, profileData);

    return profileData;
}
 
Example 4
Source File: ICC_Profile.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a byte array corresponding to the data of this ICC_Profile.
 * @return A byte array that contains the profile data.
 * @see #setData(int, byte[])
 */
public byte[] getData() {
int profileSize;
byte[] profileData;

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    PCMM mdl = CMSManager.getModule();

    /* get the number of bytes needed for this profile */
    profileSize = mdl.getProfileSize(cmmProfile);

    profileData = new byte [profileSize];

    /* get the data for the profile */
    mdl.getProfileData(cmmProfile, profileData);

    return profileData;
}
 
Example 5
Source File: ICC_Profile.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns a byte array corresponding to the data of this ICC_Profile.
 * @return A byte array that contains the profile data.
 * @see #setData(int, byte[])
 */
public byte[] getData() {
int profileSize;
byte[] profileData;

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    PCMM mdl = CMSManager.getModule();

    /* get the number of bytes needed for this profile */
    profileSize = mdl.getProfileSize(cmmProfile);

    profileData = new byte [profileSize];

    /* get the data for the profile */
    mdl.getProfileData(cmmProfile, profileData);

    return profileData;
}
 
Example 6
Source File: ICC_Profile.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an ICC_Profile for which the actual loading of the
 * profile data from a file and the initialization of the CMM should
 * be deferred as long as possible.
 * Deferral is only used for standard profiles.
 * If deferring is disabled, then getStandardProfile() ensures
 * that all of the appropriate access privileges are granted
 * when loading this profile.
 * If deferring is enabled, then the deferred activation
 * code will take care of access privileges.
 * @see activateDeferredProfile()
 */
static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
    if (!ProfileDeferralMgr.deferring) {
        return getStandardProfile(pdi.filename);
    }
    if (pdi.colorSpaceType == ColorSpace.TYPE_RGB) {
        return new ICC_ProfileRGB(pdi);
    } else if (pdi.colorSpaceType == ColorSpace.TYPE_GRAY) {
        return new ICC_ProfileGray(pdi);
    } else {
        return new ICC_Profile(pdi);
    }
}
 
Example 7
Source File: ICC_Profile.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an ICC_Profile for which the actual loading of the
 * profile data from a file and the initialization of the CMM should
 * be deferred as long as possible.
 * Deferral is only used for standard profiles.
 * If deferring is disabled, then getStandardProfile() ensures
 * that all of the appropriate access privileges are granted
 * when loading this profile.
 * If deferring is enabled, then the deferred activation
 * code will take care of access privileges.
 * @see activateDeferredProfile()
 */
static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
    if (!ProfileDeferralMgr.deferring) {
        return getStandardProfile(pdi.filename);
    }
    if (pdi.colorSpaceType == ColorSpace.TYPE_RGB) {
        return new ICC_ProfileRGB(pdi);
    } else if (pdi.colorSpaceType == ColorSpace.TYPE_GRAY) {
        return new ICC_ProfileGray(pdi);
    } else {
        return new ICC_Profile(pdi);
    }
}
 
Example 8
Source File: ICC_Profile.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an ICC_Profile for which the actual loading of the
 * profile data from a file and the initialization of the CMM should
 * be deferred as long as possible.
 * Deferral is only used for standard profiles.
 * If deferring is disabled, then getStandardProfile() ensures
 * that all of the appropriate access privileges are granted
 * when loading this profile.
 * If deferring is enabled, then the deferred activation
 * code will take care of access privileges.
 * @see activateDeferredProfile()
 */
static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
    if (!ProfileDeferralMgr.deferring) {
        return getStandardProfile(pdi.filename);
    }
    if (pdi.colorSpaceType == ColorSpace.TYPE_RGB) {
        return new ICC_ProfileRGB(pdi);
    } else if (pdi.colorSpaceType == ColorSpace.TYPE_GRAY) {
        return new ICC_ProfileGray(pdi);
    } else {
        return new ICC_Profile(pdi);
    }
}
 
Example 9
Source File: ICC_Profile.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Constructs an ICC_Profile for which the actual loading of the
 * profile data from a file and the initialization of the CMM should
 * be deferred as long as possible.
 * Deferral is only used for standard profiles.
 * If deferring is disabled, then getStandardProfile() ensures
 * that all of the appropriate access privileges are granted
 * when loading this profile.
 * If deferring is enabled, then the deferred activation
 * code will take care of access privileges.
 * @see activateDeferredProfile()
 */
static ICC_Profile getDeferredInstance(ProfileDeferralInfo pdi) {
    if (!ProfileDeferralMgr.deferring) {
        return getStandardProfile(pdi.filename);
    }
    if (pdi.colorSpaceType == ColorSpace.TYPE_RGB) {
        return new ICC_ProfileRGB(pdi);
    } else if (pdi.colorSpaceType == ColorSpace.TYPE_GRAY) {
        return new ICC_ProfileGray(pdi);
    } else {
        return new ICC_Profile(pdi);
    }
}
 
Example 10
Source File: ICC_Profile.java    From jdk8u_jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a particular tagged data element from the profile as
 * a byte array.  Elements are identified by signatures
 * as defined in the ICC specification.  The signature
 * icSigHead can be used to get the header.  This method is useful
 * for advanced applets or applications which need to access
 * profile data directly.
 *
 * @param tagSignature The ICC tag signature for the data element you
 * want to get.
 *
 * @return A byte array that contains the tagged data element. Returns
 * <code>null</code> if the specified tag doesn't exist.
 * @see #setData(int, byte[])
 */
public byte[] getData(int tagSignature) {

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    return getData(cmmProfile, tagSignature);
}
 
Example 11
Source File: ICC_Profile.java    From jdk8u-jdk with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the
 * ColorSpace class.  This is the "output" color space of the
 * profile.  For an input, display, or output profile useful
 * for tagging colors or images, this will be either TYPE_XYZ or
 * TYPE_Lab and should be interpreted as the corresponding specific
 * color space defined in the ICC specification.  For a device
 * link profile, this could be any of the color space type constants.
 * @return One of the color space type constants defined in the
 * <CODE>ColorSpace</CODE> class.
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}
 
Example 12
Source File: ICC_Profile.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Returns a particular tagged data element from the profile as
 * a byte array.  Elements are identified by signatures
 * as defined in the ICC specification.  The signature
 * icSigHead can be used to get the header.  This method is useful
 * for advanced applets or applications which need to access
 * profile data directly.
 *
 * @param tagSignature The ICC tag signature for the data element you
 * want to get.
 *
 * @return A byte array that contains the tagged data element. Returns
 * <code>null</code> if the specified tag doesn't exist.
 * @see #setData(int, byte[])
 */
public byte[] getData(int tagSignature) {

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    return getData(cmmProfile, tagSignature);
}
 
Example 13
Source File: ICC_Profile.java    From Java8CN with Apache License 2.0 3 votes vote down vote up
/**
 * Sets a particular tagged data element in the profile from
 * a byte array. The array should contain data in a format, corresponded
 * to the {@code tagSignature} as defined in the ICC specification, section 10.
 * This method is useful for advanced applets or applications which need to
 * access profile data directly.
 *
 * @param tagSignature The ICC tag signature for the data element
 * you want to set.
 * @param tagData the data to set for the specified tag signature
 * @throws IllegalArgumentException if {@code tagSignature} is not a signature
 *         as defined in the ICC specification.
 * @throws IllegalArgumentException if a content of the {@code tagData}
 *         array can not be interpreted as valid tag data, corresponding
 *         to the {@code tagSignature}.
 * @see #getData
 */
public void setData(int tagSignature, byte[] tagData) {

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    CMSManager.getModule().setTagData(cmmProfile, tagSignature, tagData);
}
 
Example 14
Source File: ICC_Profile.java    From openjdk-jdk8u with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a particular tagged data element from the profile as
 * a byte array.  Elements are identified by signatures
 * as defined in the ICC specification.  The signature
 * icSigHead can be used to get the header.  This method is useful
 * for advanced applets or applications which need to access
 * profile data directly.
 *
 * @param tagSignature The ICC tag signature for the data element you
 * want to get.
 *
 * @return A byte array that contains the tagged data element. Returns
 * <code>null</code> if the specified tag doesn't exist.
 * @see #setData(int, byte[])
 */
public byte[] getData(int tagSignature) {

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    return getData(cmmProfile, tagSignature);
}
 
Example 15
Source File: ICC_Profile.java    From Bytecoder with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the ColorSpace
 * class. This is the "output" color space of the profile. For an input,
 * display, or output profile useful for tagging colors or images, this will
 * be either {@code TYPE_XYZ} or {@code TYPE_Lab} and should be interpreted
 * as the corresponding specific color space defined in the ICC
 * specification. For a device link profile, this could be any of the color
 * space type constants.
 *
 * @return one of the color space type constants defined in the
 *         {@code ColorSpace} class
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}
 
Example 16
Source File: ICC_Profile.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the
 * ColorSpace class.  This is the "output" color space of the
 * profile.  For an input, display, or output profile useful
 * for tagging colors or images, this will be either TYPE_XYZ or
 * TYPE_Lab and should be interpreted as the corresponding specific
 * color space defined in the ICC specification.  For a device
 * link profile, this could be any of the color space type constants.
 * @return One of the color space type constants defined in the
 * <CODE>ColorSpace</CODE> class.
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}
 
Example 17
Source File: ICC_Profile.java    From openjdk-8-source with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns a particular tagged data element from the profile as
 * a byte array.  Elements are identified by signatures
 * as defined in the ICC specification.  The signature
 * icSigHead can be used to get the header.  This method is useful
 * for advanced applets or applications which need to access
 * profile data directly.
 *
 * @param tagSignature The ICC tag signature for the data element you
 * want to get.
 *
 * @return A byte array that contains the tagged data element. Returns
 * <code>null</code> if the specified tag doesn't exist.
 * @see #setData(int, byte[])
 */
public byte[] getData(int tagSignature) {

    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }

    return getData(cmmProfile, tagSignature);
}
 
Example 18
Source File: ICC_Profile.java    From openjdk-8 with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the
 * ColorSpace class.  This is the "output" color space of the
 * profile.  For an input, display, or output profile useful
 * for tagging colors or images, this will be either TYPE_XYZ or
 * TYPE_Lab and should be interpreted as the corresponding specific
 * color space defined in the ICC specification.  For a device
 * link profile, this could be any of the color space type constants.
 * @return One of the color space type constants defined in the
 * <CODE>ColorSpace</CODE> class.
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}
 
Example 19
Source File: ICC_Profile.java    From hottub with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the
 * ColorSpace class.  This is the "output" color space of the
 * profile.  For an input, display, or output profile useful
 * for tagging colors or images, this will be either TYPE_XYZ or
 * TYPE_Lab and should be interpreted as the corresponding specific
 * color space defined in the ICC specification.  For a device
 * link profile, this could be any of the color space type constants.
 * @return One of the color space type constants defined in the
 * <CODE>ColorSpace</CODE> class.
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}
 
Example 20
Source File: ICC_Profile.java    From jdk1.8-source-analysis with Apache License 2.0 3 votes vote down vote up
/**
 * Returns the color space type of the Profile Connection Space (PCS).
 * Returns one of the color space type constants defined by the
 * ColorSpace class.  This is the "output" color space of the
 * profile.  For an input, display, or output profile useful
 * for tagging colors or images, this will be either TYPE_XYZ or
 * TYPE_Lab and should be interpreted as the corresponding specific
 * color space defined in the ICC specification.  For a device
 * link profile, this could be any of the color space type constants.
 * @return One of the color space type constants defined in the
 * <CODE>ColorSpace</CODE> class.
 */
public int getPCSType() {
    if (ProfileDeferralMgr.deferring) {
        ProfileDeferralMgr.activateProfiles();
    }
    return getPCSType(cmmProfile);
}