本文整理汇总了Java中java.awt.color.ColorSpace.equals方法的典型用法代码示例。如果您正苦于以下问题:Java ColorSpace.equals方法的具体用法?Java ColorSpace.equals怎么用?Java ColorSpace.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.color.ColorSpace
的用法示例。
在下文中一共展示了ColorSpace.equals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isNonStandardICCColorSpace
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
* Returns <code>true</code> if the given <code>ColorSpace</code> object is
* an instance of <code>ICC_ColorSpace</code> but is not one of the standard
* <code>ColorSpace</code>s returned by <code>ColorSpace.getInstance()</code>.
*
* @param cs The <code>ColorSpace</code> to test.
*/
public static boolean isNonStandardICCColorSpace(ColorSpace cs) {
boolean retval = false;
try {
// Check the standard ColorSpaces in decreasing order of
// likelihood except check CS_PYCC last as in some JREs
// PYCC.pf used not to be installed.
retval =
(cs instanceof ICC_ColorSpace) &&
!(cs.isCS_sRGB() ||
cs.equals(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB)) ||
cs.equals(ColorSpace.getInstance(ColorSpace.CS_GRAY)) ||
cs.equals(ColorSpace.getInstance(ColorSpace.CS_CIEXYZ)) ||
cs.equals(ColorSpace.getInstance(ColorSpace.CS_PYCC)));
} catch(IllegalArgumentException e) {
// PYCC.pf not installed: ignore it - 'retval' is still 'false'.
}
return retval;
}
示例2: compareImages
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
protected void compareImages(BufferedImage src, BufferedImage dst) {
ColorSpace srcCS = src.getColorModel().getColorSpace();
ColorSpace dstCS = dst.getColorModel().getColorSpace();
if (!srcCS.equals(dstCS) && srcCS.getType() == ColorSpace.TYPE_GRAY) {
System.out.println("Workaround color difference with GRAY.");
BufferedImage tmp =
new BufferedImage(src.getWidth(), src.getHeight(),
BufferedImage.TYPE_INT_RGB);
Graphics g = tmp.createGraphics();
g.drawImage(src, 0, 0, null);
src = tmp;
}
int y = h / 2;
for (int i = 0; i < colors.length; i++) {
int x = dx * i + dx / 2;
int srcRgb = src.getRGB(x, y);
int dstRgb = dst.getRGB(x, y);
if (srcRgb != dstRgb) {
throw new RuntimeException("Test failed due to color difference: " +
"src_pixel=" + Integer.toHexString(srcRgb) +
"dst_pixel=" + Integer.toHexString(dstRgb));
}
}
}
示例3: isNonStandardICC
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
* Returns <code>true</code> if the given <code>ColorSpace</code>
* object is an instance of ICC_ColorSpace but is not one of the
* standard <code>ColorSpaces</code> returned by
* <code>ColorSpace.getInstance()</code>.
*/
static boolean isNonStandardICC(ColorSpace cs) {
boolean retval = false;
if ((cs instanceof ICC_ColorSpace)
&& (!cs.isCS_sRGB())
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_CIEXYZ)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_GRAY)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_PYCC)))
) {
retval = true;
}
return retval;
}
示例4: isNonStandardICC
import java.awt.color.ColorSpace; //导入方法依赖的package包/类
/**
* Returns {@code true} if the given {@code ColorSpace}
* object is an instance of ICC_ColorSpace but is not one of the
* standard {@code ColorSpaces} returned by
* {@code ColorSpace.getInstance()}.
*/
static boolean isNonStandardICC(ColorSpace cs) {
boolean retval = false;
if ((cs instanceof ICC_ColorSpace)
&& (!cs.isCS_sRGB())
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_CIEXYZ)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_GRAY)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_LINEAR_RGB)))
&& (!cs.equals(ColorSpace.getInstance(ColorSpace.CS_PYCC)))
) {
retval = true;
}
return retval;
}