java命名空间java.awt.image类componentcolormodel的类成员方法:
componentcolormodel定义及介绍
本文导语:
componentcolormodel
public componentcolormodel(colorspace colorspace,
int[] bits,
boolean hasalpha,
boolean isalphapremultiplied,
int transparency...
componentcolormodel
public componentcolormodel(colorspace colorspace,
int[] bits,
boolean hasalpha,
boolean isalphapremultiplied,
int transparency,
int transfertype)
- 根据指定参数构造
componentcolormodel。颜色分量将在指定的 colorspace 中。受支持的传输类型为 databuffer.type_byte、databuffer.type_ushort、databuffer.type_int、databuffer.type_short、databuffer.type_float 和 databuffer.type_double。如果不为 null,则 bits 数组指定每个颜色和 alpha 分量的有效位数,并且如果像素值中不存在 alpha 信息,则其长度至少应该是 colorspace 中分量数,如果存在 alpha 信息,则其长度大于此数。当 transfertype 为 databuffer.type_short、databuffer.type_float 或 databuffer.type_double 时,忽略 bits 数组参数。hasalpha 指示是否存在 alpha 信息。如果 hasalpha 为 true,则布尔值 isalphapremultiplied 指定如何解释像素值中的颜色和 alpha 样本。如果布尔值为 true,则假定颜色样本已与 alpha 样本相乘。transparency 指定可以由此颜色模型表示的 alpha 值。可以接受的 transparency 值为 opaque、bitmask 或 translucent。transfertype 是用于表示像素值的基本数组的类型。
- 参数:
colorspace - 与此颜色模型关联的 colorspace。bits - 每个分量的有效位数。可以为 null,在这种情况下,所有分量样本的所有位都将有效。如果 transfertype 为 databuffer.type_short、databuffer.type_float 或 databuffer.type_double 之一,则忽略,在这种情况下,所有分量样本的所有位都将有效。hasalpha - 如果为 true,则此颜色模型支持 alpha。isalphapremultiplied - 如果为 true,则 alpha 预乘的。transparency - 指定可以由此颜色模型表示的 alpha 值。transfertype - 指定用于表示像素值的基本数组的类型。
- 抛出:
illegalargumentexception - 如果 bits 数组参数不为 null,则其长度小于颜色和 alpha 分量数,且 transfertype 为 databuffer.type_byte、databuffer.type_ushort 或 databuffer.type_int 之一。
illegalargumentexception - 如果 transfertype 不为 databuffer.type_byte、databuffer.type_ushort、databuffer.type_int、databuffer.type_short、databuffer.type_float 或 databuffer.type_double 之一。- 另请参见:
colorspace,
transparency