本文整理汇总了Java中sun.java2d.cmm.PCMM类的典型用法代码示例。如果您正苦于以下问题:Java PCMM类的具体用法?Java PCMM怎么用?Java PCMM使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PCMM类属于sun.java2d.cmm包,在下文中一共展示了PCMM类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getData
import sun.java2d.cmm.PCMM; //导入依赖的package包/类
/**
* 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;
}
示例2: getModule
import sun.java2d.cmm.PCMM; //导入依赖的package包/类
static synchronized PCMM getModule() {
if (theLcms != null) {
return theLcms;
}
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
/* We need to load awt here because of usage trace and
* disposer frameworks
*/
System.loadLibrary("awt");
System.loadLibrary("lcms");
return null;
}
});
initLCMS(LCMSTransform.class, LCMSImageLayout.class, ICC_Profile.class);
theLcms = new LCMS();
return theLcms;
}
示例3: getModule
import sun.java2d.cmm.PCMM; //导入依赖的package包/类
static synchronized PCMM getModule() {
if (theLcms != null) {
return theLcms;
}
java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<Object>() {
public Object run() {
/* We need to load awt here because of usage trace and
* disposer frameworks
*/
System.loadLibrary("awt");
System.loadLibrary("lcms");
return null;
}
});
initLCMS(LCMSTransform.class, LCMSImageLayout.class, ICC_Profile.class);
theLcms = new LCMS();
return theLcms;
}
示例4: getData
import sun.java2d.cmm.PCMM; //导入依赖的package包/类
/**
* 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;
}
示例5: toRGB
import sun.java2d.cmm.PCMM; //导入依赖的package包/类
/**
* Transforms a color value assumed to be in this ColorSpace
* into a value in the default CS_sRGB color space.
* <p>
* This method transforms color values using algorithms designed
* to produce the best perceptual match between input and output
* colors. In order to do colorimetric conversion of color values,
* you should use the <code>toCIEXYZ</code>
* method of this color space to first convert from the input
* color space to the CS_CIEXYZ color space, and then use the
* <code>fromCIEXYZ</code> method of the CS_sRGB color space to
* convert from CS_CIEXYZ to the output color space.
* See {@link #toCIEXYZ(float[]) toCIEXYZ} and
* {@link #fromCIEXYZ(float[]) fromCIEXYZ} for further information.
* <p>
* @param colorvalue a float array with length of at least the number
* of components in this ColorSpace.
* @return a float array of length 3.
* @throws ArrayIndexOutOfBoundsException if array length is not
* at least the number of components in this ColorSpace.
*/
public float[] toRGB (float[] colorvalue) {
if (this2srgb == null) {
ColorTransform[] transformList = new ColorTransform [2];
ICC_ColorSpace srgbCS =
(ICC_ColorSpace) ColorSpace.getInstance (CS_sRGB);
PCMM mdl = CMSManager.getModule();
transformList[0] = mdl.createTransform(
thisProfile, ColorTransform.Any, ColorTransform.In);
transformList[1] = mdl.createTransform(
srgbCS.getProfile(), ColorTransform.Any, ColorTransform.Out);
this2srgb = mdl.createTransform(transformList);
if (needScaleInit) {
setComponentScaling();
}
}
int nc = this.getNumComponents();
short tmp[] = new short[nc];
for (int i = 0; i < nc; i++) {
tmp[i] = (short)
((colorvalue[i] - minVal[i]) * invDiffMinMax[i] + 0.5f);
}
tmp = this2srgb.colorConvert(tmp, null);
float[] result = new float [3];
for (int i = 0; i < 3; i++) {
result[i] = ((float) (tmp[i] & 0xffff)) / 65535.0f;
}
return result;
}