java命名空间java.awt.image类colormodel的类成员方法:
getdataelements定义及介绍
本文导语:
getdataelements
public object getdataelements(int rgb,
object pixel)
在默认 rgb 颜色模型中给定整数像素的表示形式的情况下,返回此 colormodel 中像素的数据元素数组的表示形式。然后将此数组传递到 writableraster 对象...
getdataelements
public object getdataelements(int rgb,
object pixel)
- 在默认 rgb 颜色模型中给定整数像素的表示形式的情况下,返回此
colormodel 中像素的数据元素数组的表示形式。然后将此数组传递到 writableraster 对象的 writableraster.setdataelements(int, int, java.lang.object) 方法。如果像素变量为 null,则分配一个新数组。如果 pixel 不为 null,则它必须是类型 transfertype 的基本数组;否则将抛出 classcastexception。如果 pixel 不是特别大,不能存储此 colormodel 的像素值,则抛出 arrayindexoutofboundsexception。返回该像素数组。如果此 transfertype 不受支持,则抛出 unsupportedoperationexception。因为 colormodel 为抽象类,所以任何实例都是子类的实例。子类必须重写此方法,因为此抽象类中的实现抛出了 unsupportedoperationexception。
- 参数:
rgb - 默认 rgb 颜色模式中的整数像素表示形式pixel - 指定像素
- 返回:
- 此
colormodel 中指定像素的数组表示形式。
- 抛出:
classcastexception - 如果 pixel 不为类型 transfertype 的基本数组
arrayindexoutofboundsexception - 如果 pixel 不是特别大,不能存储此 colormodel 的像素值
unsupportedoperationexception - 如果此方法不受此 colormodel 支持- 另请参见:
writableraster.setdataelements(int, int, java.lang.object),
samplemodel.setdataelements(int, int, java.lang.object, java.awt.image.databuffer)