本文整理匯總了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;
}