sun.java2d.cmm.Profile Java Examples

The following examples show how to use sun.java2d.cmm.Profile. 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: LCMS.java    From dragonwell8_jdk with 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 #2
Source File: ICC_Profile.java    From TencentKona-8 with 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 File: LCMS.java    From Bytecoder with 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 #4
Source File: ICC_Profile.java    From JDKSourceCode1.8 with 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 #5
Source File: ICC_Profile.java    From openjdk-jdk8u with 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 #6
Source File: ICC_Profile.java    From openjdk-jdk9 with 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 File: LCMS.java    From jdk8u-jdk with 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 #8
Source File: ICC_Profile.java    From dragonwell8_jdk with 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 #9
Source File: LCMS.java    From openjdk-jdk8u with 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 #10
Source File: ICC_Profile.java    From jdk8u60 with 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 #11
Source File: ICC_Profile.java    From jdk8u-jdk with 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 File: ICC_Profile.java    From jdk1.8-source-analysis with 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 #13
Source File: LCMS.java    From TencentKona-8 with 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 File: LCMS.java    From openjdk-jdk8u with 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 #15
Source File: LCMS.java    From jdk8u-jdk with 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 #16
Source File: ICC_Profile.java    From openjdk-jdk8u-backup with 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 #17
Source File: LCMS.java    From openjdk-jdk8u-backup with 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 #18
Source File: ICC_Profile.java    From openjdk-jdk8u-backup with 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 #19
Source File: ICC_Profile.java    From jdk1.8-source-analysis with 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 #20
Source File: LCMS.java    From openjdk-jdk9 with 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 File: ICC_Profile.java    From jdk8u-jdk with 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 #22
Source File: ICC_Profile.java    From JDKSourceCode1.8 with MIT License 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 #23
Source File: LCMS.java    From openjdk-jdk8u with 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 #24
Source File: LCMS.java    From jdk8u60 with 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 File: LCMS.java    From jdk8u60 with 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 #26
Source File: LCMS.java    From openjdk-jdk9 with 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 #27
Source File: LCMS.java    From Bytecoder with 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);
        }
    }
}
 
Example #28
Source File: ICC_Profile.java    From openjdk-jdk9 with 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 #29
Source File: ICC_Profile.java    From jdk8u60 with 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 #30
Source File: LCMS.java    From TencentKona-8 with 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);
        }
    }
}