本文整理汇总了Java中java.awt.image.DirectColorModel.getNumComponents方法的典型用法代码示例。如果您正苦于以下问题:Java DirectColorModel.getNumComponents方法的具体用法?Java DirectColorModel.getNumComponents怎么用?Java DirectColorModel.getNumComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.image.DirectColorModel
的用法示例。
在下文中一共展示了DirectColorModel.getNumComponents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isRgbColorModel
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean isRgbColorModel(ColorModel cm) {
if (cm instanceof DirectColorModel &&
cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x00FF0000 &&
directCM.getGreenMask() == 0x0000FF00 &&
directCM.getBlueMask() == 0x000000FF &&
(directCM.getNumComponents() == 3 ||
directCM.getAlphaMask() == 0xFF000000);
}
return false;
}
示例2: isBgrColorModel
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean isBgrColorModel(ColorModel cm) {
if (cm instanceof DirectColorModel &&
cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x000000FF &&
directCM.getGreenMask() == 0x0000FF00 &&
directCM.getBlueMask() == 0x00FF0000 &&
(directCM.getNumComponents() == 3 ||
directCM.getAlphaMask() == 0xFF000000);
}
return false;
}
示例3: isRgbColorModel
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean isRgbColorModel(ColorModel cm) {
if (cm instanceof DirectColorModel &&
cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x00FF0000 &&
directCM.getGreenMask() == 0x0000FF00 &&
directCM.getBlueMask() == 0x000000FF &&
(directCM.getNumComponents() == 3 ||
directCM.getAlphaMask() == 0xFF000000);
}
return false;
}
示例4: isBgrColorModel
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean isBgrColorModel(ColorModel cm) {
if (cm instanceof DirectColorModel &&
cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x000000FF &&
directCM.getGreenMask() == 0x0000FF00 &&
directCM.getBlueMask() == 0x00FF0000 &&
(directCM.getNumComponents() == 3 ||
directCM.getAlphaMask() == 0xFF000000);
}
return false;
}
示例5: checkComponentsOrder
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean checkComponentsOrder(ColorModel cm) {
if (cm instanceof DirectColorModel &&
cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x00FF0000 &&
directCM.getGreenMask() == 0x0000FF00 &&
directCM.getBlueMask() == 0x000000FF &&
(directCM.getNumComponents() != 4 ||
directCM.getAlphaMask() == 0xFF000000);
}
return false;
}
示例6: checkComponentsOrder
import java.awt.image.DirectColorModel; //导入方法依赖的package包/类
private static boolean checkComponentsOrder(ColorModel cm) {
if (cm instanceof DirectColorModel
&& cm.getTransferType() == DataBuffer.TYPE_INT) {
DirectColorModel directCM = (DirectColorModel) cm;
return directCM.getRedMask() == 0x00FF0000
&& directCM.getGreenMask() == 0x0000FF00
&& directCM.getBlueMask() == 0x000000FF
&& (directCM.getNumComponents() != 4
|| directCM.getAlphaMask() == 0xFF000000);
}
return false;
}