Java Code Examples for sun.java2d.cmm.Profile

The following examples show how to use sun.java2d.cmm.Profile. These examples are extracted from open source projects. 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 Project: jdk1.8-source-analysis   Source File: ICC_Profile.java    License: Apache License 2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 2
Source Project: jdk8u-jdk   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 3
Source Project: dragonwell8_jdk   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 4
Source Project: openjdk-jdk9   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 5
Source Project: dragonwell8_jdk   Source File: LCMS.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void setTagData(Profile p, int tagSignature, byte[] data) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        profile.clearTagCache();

        // Now we are going to update the profile with new tag data
        // In some cases, we may change the pointer to the native
        // profile.
        //
        // If we fail to write tag data for any reason, the old pointer
        // should be used.
        setTagDataNative(profile.getLcmsPtr(),
                tagSignature, data);
    }
}
 
Example 6
Source Project: TencentKona-8   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 7
Source Project: Bytecoder   Source File: LCMS.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public synchronized void setTagData(Profile p, int tagSignature, byte[] data) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        profile.clearTagCache();

        // Now we are going to update the profile with new tag data
        // In some cases, we may change the pointer to the native
        // profile.
        //
        // If we fail to write tag data for any reason, the old pointer
        // should be used.
        setTagDataNative(profile.getLcmsPtr(),
                tagSignature, data);
    }
}
 
Example 8
Source Project: TencentKona-8   Source File: LCMS.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void setTagData(Profile p, int tagSignature, byte[] data) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        profile.clearTagCache();

        // Now we are going to update the profile with new tag data
        // In some cases, we may change the pointer to the native
        // profile.
        //
        // If we fail to write tag data for any reason, the old pointer
        // should be used.
        setTagDataNative(profile.getLcmsPtr(),
                tagSignature, data);
    }
}
 
Example 9
Source Project: jdk8u60   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 10
Source Project: JDKSourceCode1.8   Source File: ICC_Profile.java    License: MIT License 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 11
Source Project: openjdk-jdk8u   Source File: ICC_Profile.java    License: GNU General Public License v2.0 6 votes vote down vote up
static byte[] getData(Profile p, int tagSignature) {
int tagSize;
byte[] tagData;

    try {
        PCMM mdl = CMSManager.getModule();

        /* get the number of bytes needed for this tag */
        tagSize = mdl.getTagSize(p, tagSignature);

        tagData = new byte[tagSize]; /* get an array for the tag */

        /* get the tag's data */
        mdl.getTagData(p, tagSignature, tagData);
    } catch(CMMException c) {
        tagData = null;
    }

    return tagData;
}
 
Example 12
Source Project: jdk8u-jdk   Source File: LCMS.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void setTagData(Profile p, int tagSignature, byte[] data) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        profile.clearTagCache();

        // Now we are going to update the profile with new tag data
        // In some cases, we may change the pointer to the native
        // profile.
        //
        // If we fail to write tag data for any reason, the old pointer
        // should be used.
        setTagDataNative(profile.getLcmsPtr(),
                tagSignature, data);
    }
}
 
Example 13
Source Project: openjdk-jdk8u   Source File: LCMS.java    License: GNU General Public License v2.0 6 votes vote down vote up
@Override
public synchronized void setTagData(Profile p, int tagSignature, byte[] data) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        profile.clearTagCache();

        // Now we are going to update the profile with new tag data
        // In some cases, we may change the pointer to the native
        // profile.
        //
        // If we fail to write tag data for any reason, the old pointer
        // should be used.
        setTagDataNative(profile.getLcmsPtr(),
                tagSignature, data);
    }
}
 
Example 14
Source Project: jdk1.8-source-analysis   Source File: ICC_Profile.java    License: Apache License 2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 15
Source Project: Bytecoder   Source File: ICC_Profile.java    License: Apache License 2.0 5 votes vote down vote up
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;

    theHeader = getData(p, icSigHead);
    thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
    thePCS = iccCStoJCS(thePCSSig);
    return thePCS;
}
 
Example 16
Source Project: dragonwell8_jdk   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 17
Source Project: dragonwell8_jdk   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;

    theHeader = getData(p, icSigHead);
    thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
    thePCS = iccCStoJCS(thePCSSig);
    return thePCS;
}
 
Example 18
Source Project: jdk8u-jdk   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public int getTagSize(Profile p, int tagSignature) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        return t == null ? 0 : t.getSize();
    }
}
 
Example 19
Source Project: dragonwell8_jdk   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public Profile loadProfile(byte[] data) {
    final Object disposerRef = new Object();

    final long ptr = loadProfileNative(data, disposerRef);

    if (ptr != 0L) {
        return new LCMSProfile(ptr, disposerRef);
    }
    return null;
}
 
Example 20
Source Project: dragonwell8_jdk   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public int getTagSize(Profile p, int tagSignature) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        return t == null ? 0 : t.getSize();
    }
}
 
Example 21
Source Project: TencentKona-8   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 22
Source Project: TencentKona-8   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;

    theHeader = getData(p, icSigHead);
    thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
    thePCS = iccCStoJCS(thePCSSig);
    return thePCS;
}
 
Example 23
Source Project: Bytecoder   Source File: ICC_Profile.java    License: Apache License 2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 24
Source Project: openjdk-jdk9   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void getTagData(Profile p, int tagSignature, byte[] data)
{
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        if (t != null) {
            t.copyDataTo(data);
        }
    }
}
 
Example 25
Source Project: jdk8u-jdk   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 26
Source Project: TencentKona-8   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public int getTagSize(Profile p, int tagSignature) {
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        return t == null ? 0 : t.getSize();
    }
}
 
Example 27
Source Project: TencentKona-8   Source File: LCMS.java    License: GNU General Public License v2.0 5 votes vote down vote up
@Override
public void getTagData(Profile p, int tagSignature, byte[] data)
{
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        if (t != null) {
            t.copyDataTo(data);
        }
    }
}
 
Example 28
Source Project: jdk8u60   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;

    theHeader = getData(p, icSigHead);
    theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
    theColorSpace = iccCStoJCS (theColorSpaceSig);
    return theColorSpace;
}
 
Example 29
Source Project: openjdk-jdk9   Source File: ICC_Profile.java    License: GNU General Public License v2.0 5 votes vote down vote up
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;

    theHeader = getData(p, icSigHead);
    thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
    thePCS = iccCStoJCS(thePCSSig);
    return thePCS;
}
 
Example 30
Source Project: Bytecoder   Source File: LCMS.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void getTagData(Profile p, int tagSignature, byte[] data)
{
    final LCMSProfile profile = getLcmsProfile(p);

    synchronized (profile) {
        TagData t = profile.getTag(tagSignature);
        if (t != null) {
            t.copyDataTo(data);
        }
    }
}