下面列出了java.awt.color.CMMException#sun.java2d.cmm.Profile 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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;
}
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;
}
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;
}
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;
}
@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);
}
}
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;
}
@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);
}
}
@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);
}
}
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;
}
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;
}
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;
}
@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);
}
}
@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);
}
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;
theHeader = getData(p, icSigHead);
thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
thePCS = iccCStoJCS(thePCSSig);
return thePCS;
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;
theHeader = getData(p, icSigHead);
thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
thePCS = iccCStoJCS(thePCSSig);
return thePCS;
}
@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();
}
}
@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;
}
@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();
}
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;
theHeader = getData(p, icSigHead);
thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
thePCS = iccCStoJCS(thePCSSig);
return thePCS;
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
@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);
}
}
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
@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();
}
}
@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);
}
}
}
static int getColorSpaceType(Profile p) {
byte[] theHeader;
int theColorSpaceSig, theColorSpace;
theHeader = getData(p, icSigHead);
theColorSpaceSig = intFromBigEndian(theHeader, icHdrColorSpace);
theColorSpace = iccCStoJCS (theColorSpaceSig);
return theColorSpace;
}
static int getPCSType(Profile p) {
byte[] theHeader;
int thePCSSig, thePCS;
theHeader = getData(p, icSigHead);
thePCSSig = intFromBigEndian(theHeader, icHdrPcs);
thePCS = iccCStoJCS(thePCSSig);
return thePCS;
}