public class IndexColorModel extends ColorModel
IndexColorModel类是一个ColorModel类,适用于由单个样本组成的像素值,该样本是默认sRGB颜色空间中固定色彩映射的索引。 
       颜色映射指定对应于每个索引的红色,绿色,蓝色和可选的alpha组件。 
       所有组件在色彩映射中表示为8位无符号积分值。 
       一些构造函数允许调用者通过指定哪些色彩映射条目有效并通过BigInteger对象中设置的位来表示不可用的颜色来指定色彩映射中的“空洞”。 
       此颜色模型与X11 PseudoColor视觉相似。 
        一些构造函数提供了指定色彩映射中每个像素的alpha分量的方法,而其他构造函数不提供这样的方法,或者在某些情况下提供一个标志来指示色彩映射数据是否包含alpha值。 如果没有向构造函数提供alpha,则会为每个条目假定为不透明的alpha组件(alpha = 1.0)。 可以提供可选的透明像素值,其指示要完全透明的像素,而不管为该像素值提供或假设的任何α分量。 请注意, IndexColorModel对象的颜色映射中的颜色IndexColorModel决不会与alpha分量预先乘以。 
 如果一个IndexColorModel对象的透明度值为Transparency.OPAQUE ,则hasAlpha和getNumComponents方法(都继承自ColorModel )分别返回false和3。 对于任何其他透明度值, hasAlpha返回true, getNumComponents返回4。 
 对于使用transferType类型的原始数组像素表示的transferType ,数组长度总是为1。 支持的传输类型是DataBuffer.TYPE_BYTE和DataBuffer.TYPE_USHORT 。 单个int像素表示对于此类的所有对象是有效的,因为总是可以在单个int中表示与该类一起使用的像素值。 因此,由于无效的像素值,使用此表示的方法不会抛出IllegalArgumentException 。 
这个类中的很多方法都是最终的。 原因是底层本机图形代码对这个类的布局和操作做出假设,这些假设反映在这里标记为final的方法的实现中。 您可以通过其他原因对此类进行子类化,但不能覆盖或修改这些方法的行为。
ColorModel , ColorSpace , DataBuffer 
       pixel_bits, transferTypeBITMASK, OPAQUE, TRANSLUCENT| Constructor and Description | 
|---|
| IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b)
              构造一个 
              IndexColorModel从红色,绿色和蓝色分量指定数组。 | 
| IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b, byte[] a)
              构造一个 
              IndexColorModel从红色,绿色,蓝色和alpha分量给定的阵列。 | 
| IndexColorModel(int bits, int size, byte[] r, byte[] g, byte[] b, int trans)
              构造一个 
              IndexColorModel从红色,绿色和蓝色分量给定的阵列。 | 
| IndexColorModel(int bits, int size, byte[] cmap, int start, boolean hasalpha)
              构造一个 
              IndexColorModel从交织红色,绿色,蓝色和可选alpha分量的单个阵列。 | 
| IndexColorModel(int bits, int size, byte[] cmap, int start, boolean hasalpha, int trans)
              构造一个 
              IndexColorModel从交织红色,绿色,蓝色和可选alpha分量的单个阵列。 | 
| IndexColorModel(int bits, int size, int[] cmap, int start, boolean hasalpha, int trans, int transferType)
              从int数组构造一个 
              IndexColorModel,其中每个int由默认RGB颜色模型格式的红色,绿色,蓝色和可选alpha组件组成。 | 
| IndexColorModel(int bits, int size, int[] cmap, int start, int transferType, BigInteger validBits)
              从 
              int数组构造一个IndexColorModel,其中每个int由默认RGB颜色模型格式的红色,绿色,蓝色和Alpha组件组成。 | 
| Modifier and Type | Method and Description | 
|---|---|
| BufferedImage | convertToIntDiscrete(Raster raster, boolean forceARGB)
              返回一个新的 
              BufferedImageTYPE_INT_ARGB或TYPE_INT_RGB的具有Raster通过展开源的索引来计算的与像素数据Raster使用此的颜色/ alpha分量数组ColorModel。 | 
| SampleModel | createCompatibleSampleModel(int w, int h)
              创建 
              SampleModel具有指定的宽度和高度,具有与此兼容的数据布局ColorModel。 | 
| WritableRaster | createCompatibleWritableRaster(int w, int h)
              创建 
              WritableRaster具有指定的宽度和高度,其具有的数据布局(SampleModel)与此兼容ColorModel。 | 
| void | finalize()
              一旦这个 
              ColorModel不再被引用,则处理与此ColorModel的系统资源。 | 
| int | getAlpha(int pixel)
              返回指定像素的alpha分量,从0到255。 
             | 
| void | getAlphas(byte[] a)
              将Alpha透明组件数组复制到指定的数组中。 
             | 
| int | getBlue(int pixel)
              返回指定像素的蓝色分量,在默认RGB ColorSpace(sRGB)中从0到255。 
             | 
| void | getBlues(byte[] b)
              将蓝色组件数组复制到指定的数组中。 
             | 
| int[] | getComponents(int pixel, int[] components, int offset)
              返回此 
              ColorModel指定像素的非标准化颜色/ alpha分量ColorModel。 | 
| int[] | getComponents(Object pixel, int[] components, int offset)
              返回此 
              ColorModel指定像素的非标准化颜色/ alpha分量ColorModel。 | 
| int[] | getComponentSize()
              返回每个颜色/ alpha分量的位数的数组。 
             | 
| int | getDataElement(int[] components, int offset)
              返回表示为在此一个int的像素值 
              ColorModel给定非标准化颜色/ alpha分量的阵列。 | 
| Object | getDataElements(int[] components, int offset, Object pixel)
              返回此的像素的数据元素数组表示 
              ColorModel给定非标准化颜色/ alpha分量的阵列。 | 
| Object | getDataElements(int rgb, Object pixel)
              返回此ColorModel中的像素的数据元素数组表示,给出了默认RGB颜色模型中的整数像素表示。 
             | 
| int | getGreen(int pixel)
              返回指定像素的绿色分量,在默认RGB ColorSpace sRGB中从0到255。 
             | 
| void | getGreens(byte[] g)
              将绿色组件数组复制到指定的数组中。 
             | 
| int | getMapSize()
              返回此 
              IndexColorModel颜色/ alpha组件数组的IndexColorModel。 | 
| int | getRed(int pixel)
              返回指定像素的红色分量,在默认RGB ColorSpace sRGB中从0到255。 
             | 
| void | getReds(byte[] r)
              将红色组件数组复制到指定的数组中。 
             | 
| int | getRGB(int pixel)
              以默认RGB颜色模型格式返回像素的颜色/ alpha分量。 
             | 
| void | getRGBs(int[] rgb)
              将每个索引的数据从颜色和alpha组件数组转换为默认RGB ColorModel格式的int,并将生成的32位ARGB值复制到指定的数组中。 
             | 
| int | getTransparency()
              返回透明度。 
             | 
| int | getTransparentPixel()
              如果没有Alpha值为0的像素,则返回此 
              IndexColorModel中的透明像素的索引或-1。 | 
| BigInteger | getValidPixels()
              返回一个 
              BigInteger,表示色彩映射中有效/无效的像素。 | 
| boolean | isCompatibleRaster(Raster raster)
              返回 
              true如果raster与此兼容ColorModel或false如果不是与此兼容ColorModel。 | 
| boolean | isCompatibleSampleModel(SampleModel sm)
              检查指定的 
              SampleModel与此兼容ColorModel。 | 
| boolean | isValid()
              返回所有像素是否有效。 
             | 
| boolean | isValid(int pixel)
              返回像素是否有效。 
             | 
| String | toString()
              返回 
              String这个内容表示ColorModel对象。 | 
coerceData, equals, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponentSize, getDataElement, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getUnnormalizedComponents, hasAlpha, hashCode, isAlphaPremultipliedpublic IndexColorModel(int bits,
                       int size,
                       byte[] r,
                       byte[] g,
                       byte[] b) 
          IndexColorModel从红色,绿色和蓝色分量指定数组。 
           由此颜色模型描述的像素都具有255的非标准化(1.0归一化)的α分量,这意味着它们是完全不透明的。 
           指定颜色分量的所有数组必须至少具有指定数量的条目。 
           ColorSpace是默认的sRGB空间。 
           由于此构造函数的任何参数中没有alpha信息,透明度值始终为Transparency.OPAQUE 。 
           传输类型是可以容纳单个像素的DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT中最小的。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           r - 红色组件阵列 
           g - 绿色组件阵列 
           b - 蓝色组件阵列 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           public IndexColorModel(int bits,
                       int size,
                       byte[] r,
                       byte[] g,
                       byte[] b,
                       int trans) 
          IndexColorModel从红色,绿色和蓝色分量给定的阵列。 
           由该颜色模型描述的像素都具有255的非标准化(1.0归一化)的α分量,这意味着它们是完全不透明的,除了指示的像素被制成透明。 
           指定颜色分量的所有数组必须至少具有指定数量的条目。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是Transparency.OPAQUE或Transparency.BITMASK ,这取决于参数,如上面的class description所规定。 
           传输类型是可以容纳单个像素的DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT中的最小值。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           r - 红色组件阵列 
           g - 绿色组件阵列 
           b - 蓝色组件阵列 
           trans - 透明像素的索引 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           public IndexColorModel(int bits,
                       int size,
                       byte[] r,
                       byte[] g,
                       byte[] b,
                       byte[] a) 
          IndexColorModel从红色,绿色,蓝色和alpha分量给定的阵列。 
           指定组件的所有数组必须至少具有指定数量的条目。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是任何的Transparency.OPAQUE , Transparency.BITMASK ,或Transparency.TRANSLUCENT取决于参数,如在指定class description上方。 
           传输类型是可以容纳单个像素的DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT中的最小值。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           r - 红色组件阵列 
           g - 绿色组件阵列 
           b - 蓝色组件阵列 
           a - alpha值组件数组 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           public IndexColorModel(int bits,
                       int size,
                       byte[] cmap,
                       int start,
                       boolean hasalpha) 
          IndexColorModel从交织红色,绿色,蓝色和可选alpha分量的单个阵列。 
           数组必须有足够的值来填充指定大小的所有需要的组件数组。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是任何的Transparency.OPAQUE , Transparency.BITMASK ,或Transparency.TRANSLUCENT取决于参数,如在指定class description上方。 
           传输类型是可以容纳单个像素的DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT中的最小值。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           cmap - 颜色分量数组 
           start - 第一个颜色分量的起始偏移量 
           hasalpha - 表示alpha值是否包含在 
            cmap数组中 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           public IndexColorModel(int bits,
                       int size,
                       byte[] cmap,
                       int start,
                       boolean hasalpha,
                       int trans) 
          IndexColorModel从交织红色,绿色,蓝色和可选alpha分量的单个阵列。 
           指定的透明索引表示完全透明的像素,无论为其指定了任何alpha值。 
           数组必须有足够的值来填充指定大小的所有需要的组件数组。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是Transparency.BITMASK或Transparency.TRANSLUCENT任何Transparency.OPAQUE , Transparency.BITMASK参数,如上面的class description中所指定的。 
           传输类型是可以容纳单个像素的DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT中的最小值。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           cmap - 颜色分量阵列 
           start - 第一个颜色分量的起始偏移量 
           hasalpha - 表示alpha值是否包含在 
            cmap数组中 
           trans - 完全透明像素的索引 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           public IndexColorModel(int bits,
                       int size,
                       int[] cmap,
                       int start,
                       boolean hasalpha,
                       int trans,
                       int transferType) 
          IndexColorModel ,其中每个int由默认RGB颜色模型格式的红色,绿色,蓝色和可选alpha组件组成。 
           指定的透明索引表示完全透明的像素,无论为其指定了任何alpha值。 
           数组必须有足够的值来填充指定大小的所有需要的组件数组。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是任何的Transparency.OPAQUE , Transparency.BITMASK ,或Transparency.TRANSLUCENT取决于参数,如在指定class description上方。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           cmap - 颜色分量阵列 
           start - 第一个颜色分量的起始偏移量 
           hasalpha - 表示alpha值是否包含在 
            cmap数组中 
           trans - 完全透明像素的索引 
           transferType - 用于表示像素值的数组的数据类型。 
            数据类型必须是DataBuffer.TYPE_BYTE或DataBuffer.TYPE_USHORT 。 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           IllegalArgumentException - 如果 
            transferType不是 
            DataBuffer.TYPE_BYTE或 
            DataBuffer.TYPE_USHORT 
           public IndexColorModel(int bits,
                       int size,
                       int[] cmap,
                       int start,
                       int transferType,
                       BigInteger validBits) 
          IndexColorModel从int阵列,其中每个int包括在默认RGB颜色模型格式的红色,绿色,蓝色,和alpha分量。 
           数组必须有足够的值来填充指定大小的所有需要的组件数组。 
           ColorSpace是默认的sRGB空间。 
           透明度值可以是Transparency.BITMASK或Transparency.TRANSLUCENT任何Transparency.OPAQUE , Transparency.BITMASK参数,如上面的class description中所指定的。 
           转移类型必须是DataBuffer.TYPE_BYTE DataBuffer.TYPE_USHORT 。 
           BigInteger对象指定cmap数组中的有效/无效像素。 
           如果设置了该索引的值为BigInteger则像素有效,如果该索引处的BigInteger位未设置,则该BigInteger无效。 
          bits - 每个像素占用的位数 
           size - 颜色组件数组的大小 
           cmap - 颜色分量阵列 
           start - 第一个颜色分量的起始偏移量 
           transferType - 指定的数据类型 
           validBits - 一个BigInteger对象。 
            如果在BigInteger中设置了一个位,该索引处的像素是有效的。 
            如果未设置位,该索引处的像素被认为是无效的。 
            如果为空,则所有像素均为有效。 
            只考虑从0到地图大小的位。 
           IllegalArgumentException - 如果 
            bits小于1或大于16 
           IllegalArgumentException - 如果 
            size小于1 
           IllegalArgumentException - 如果 
            transferType不是 
            DataBuffer.TYPE_BYTE或 
            DataBuffer.TYPE_USHORT 
           public int getTransparency()
getTransparency在界面 
            Transparency 
           getTransparency在类别 
            ColorModel 
           IndexColorModel 
           Transparency.OPAQUE , 
            Transparency.BITMASK , 
            Transparency.TRANSLUCENT 
           public int[] getComponentSize()
getComponentSize在 
            ColorModel 
           IndexColorModel 
           public final int getMapSize()
IndexColorModel颜色/ alpha组件数组的 
           IndexColorModel 。 
          public final int getTransparentPixel()
IndexColorModel中的透明像素的索引或-1。如果透明像素在其中一个构造函数中由其索引显式指定,则该索引将是首选,否则,可能会返回恰好完全透明的任何像素的索引。 
          IndexColorModel对象中的透明像素的索引,如果没有这样的像素则为-1 
           public final void getReds(byte[] r)
getMapSize指定的数组的初始条目。 
          r - 复制红色组件数组元素的指定数组 
           public final void getGreens(byte[] g)
getMapSize的数组的初始条目。 
          g - 复制绿色组件数组元素的指定数组 
           public final void getBlues(byte[] b)
getMapSize的数组的初始条目。 
          b - 复制了蓝色组件数组元素的指定数组 
           public final void getAlphas(byte[] a)
getMapSize的数组的初始条目。 
          a - 复制alpha组件数组元素的指定数组 
           public final void getRGBs(int[] rgb)
getMapSize的数组的初始条目。 
          rgb - 从该数组的颜色和alpha组件复制转换的ARGB值的指定数组。 
           public final int getRed(int pixel)
getRed在 
            ColorModel 
           pixel - 指定像素 
           public final int getGreen(int pixel)
getGreen在类别 
            ColorModel 
           pixel - 指定的像素 
           public final int getBlue(int pixel)
getBlue在类别 
            ColorModel 
           pixel - 指定的像素 
           public final int getAlpha(int pixel)
getAlpha在 
            ColorModel 
           pixel - 指定的像素 
           public final int getRGB(int pixel)
getRGB在类别 
            ColorModel 
           pixel - 指定像素 
           ColorModel.getRGBdefault() 
           public Object getDataElements(int rgb, Object pixel)
setDataElements方法。 
           如果像素变量为null ,则会null一个新数组。 
           如果pixel不是null ,它必须是类型的基本数组transferType ; 
           否则,抛出一个ClassCastException 。 
           一个ArrayIndexOutOfBoundsException如果抛出pixel是不是大到足以容纳这个像素值ColorModel 。 
           返回像素数组。 
            由于IndexColorModel可以被子类化,子类继承了该方法的实现,如果它们不覆盖它,那么如果它们使用不支持的transferType,它们将抛出transferType 。 
getDataElements在 
            ColorModel 
           rgb - 默认RGB颜色模型中的整数像素表示 
           pixel - 指定的像素 
           IndexColorModel 。 
           ClassCastException -如果 
            pixel不是类型的基本数组 
            transferType 
           ArrayIndexOutOfBoundsException - 如果 
            pixel不够大,不能持有这个 
            ColorModel的像素值 
           UnsupportedOperationException - 如果 
            transferType无效 
           WritableRaster.setDataElements(int, int, java.lang.Object) , 
            SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) 
           public int[] getComponents(int pixel,
                           int[] components,
                           int offset) 
          ColorModel指定像素的非标准化颜色/ alpha分量ColorModel 。 
           像素值被指定为int。 
           如果components数组为null ,则会分配一个包含offset + getNumComponents()元素的新数组。 
           返回components数组,只有hasAlpha返回true,才包含alpha组件。 
           颜色/ alpha分量存储中components阵列在起动offset即使阵列由这种方法分配的。 
           ArrayIndexOutOfBoundsException如果components阵列不是null ,并且不够大,不能保持从offset开始的所有颜色和alpha offset 。 
          getComponents在类别 
            ColorModel 
           pixel - 指定的像素 
           components - 接收指定像素的颜色和alpha分量的数组 
           offset - 偏移到 
            components阵列,开始存储颜色和alpha组件 
           ColorModel.hasAlpha() , 
            ColorModel.getNumComponents() 
           public int[] getComponents(Object pixel, int[] components, int offset)
ColorModel指定像素的非标准化颜色/ alpha分量ColorModel 。 
           像素值由作为对象引用传递的类型为transferType的数据元素的数组指定。 
           如果pixel不是类型的基本数组transferType ,一个ClassCastException被抛出。 
           一个ArrayIndexOutOfBoundsException如果抛出pixel是不是大到足以容纳这个像素值ColorModel 。 
           如果components数组为null ,则会分配一个包含offset + getNumComponents()元素的新数组。 
           components数组将返回,只有hasAlpha返回true时,才会包含alpha组件。 
           颜色/ alpha分量存储中components阵列在起动offset即使阵列由这种方法分配的。 
           ArrayIndexOutOfBoundsException也被抛出,如果components数组不是null ,并且不够大,不能容纳从offset开始的所有颜色和alpha offset 。 
            由于IndexColorModel可以被子类化,子类继承了该方法的实现,如果它们不覆盖它,那么如果它们使用不支持的transferType,它们将抛出transferType 。 
getComponents在 
            ColorModel 
           pixel - 指定的像素 
           components - 接收指定像素的颜色和alpha分量的数组 
           offset - 在开始存储指定像素的颜色和alpha分量的 
            components数组中的索引 
           ArrayIndexOutOfBoundsException - 如果 
            pixel不够大,不足以持有该 
            ColorModel的像素值,或者 
            components阵列不是 
            null ,并且不够大,不能保持从offset开始的所有颜色和alpha 
            offset 
           ClassCastException -如果 
            pixel不是类型的基本数组 
            transferType 
           UnsupportedOperationException - 如果 
            transferType不是支持的传输类型之一 
           ColorModel.hasAlpha() , 
            ColorModel.getNumComponents() 
           public int getDataElement(int[] components,
                          int offset) 
          ColorModel给定非标准化颜色/ alpha分量的阵列。 
           ArrayIndexOutOfBoundsException如果components数组不够大,不能保持从offset开始的所有颜色和alpha组件,则offset 。 
           由于ColorModel可以被子类化,子类继承了该方法的实现,如果它们不覆盖它们,那么如果它们使用不受支持的transferType,它们将抛出异常。 
          getDataElement在类别 
            ColorModel 
           components - 非规范化颜色和alpha组件的数组 
           offset - 索引到 
            components ,开始检索颜色和alpha组件 
           int像素值在这个 
            ColorModel对应的指定组件。 
           ArrayIndexOutOfBoundsException - 如果 
            components数组不够大,不能保持从offset开始的所有颜色和alpha 
            offset 
           UnsupportedOperationException - 如果 
            transferType无效 
           public Object getDataElements(int[] components, int offset, Object pixel)
ColorModel给定非标准化颜色/ alpha分量的阵列。 
           然后可以将该数组传递给WritableRaster对象的setDataElements方法。 
           ArrayIndexOutOfBoundsException如果components数组不够大,不能容纳所有的颜色和alpha组件,从offset开始就offset 。 
           如果像素变量为null ,则会null一个新数组。 
           如果pixel不是null ,它必须是类型的基本数组transferType ; 
           否则,抛出一个ClassCastException 。 
           一个ArrayIndexOutOfBoundsException如果pixel不是特别大,不能保存此像素值抛出ColorModel 。 
            由于IndexColorModel可以被子类化,子类继承了该方法的实现,如果它们不覆盖它,那么如果他们使用不支持的transferType 
getDataElements在 
            ColorModel 
           components - 非规范化颜色和alpha组件的数组 
           offset - 索引到 
            components开始检索颜色和alpha组件 
           pixel -所述 
            Object表示颜色和alpha分量的数组 
           Object表示一个颜色和alpha组件的数组。 
           ClassCastException -如果 
            pixel不是类型的基本数组 
            transferType 
           ArrayIndexOutOfBoundsException -如果 
            pixel是不足够大以保存此像素值 
            ColorModel或 
            components阵列是没有大到足以容纳所有的颜色和alpha分量开始于 
            offset 
           UnsupportedOperationException - 如果 
            transferType不是支持的传输类型之一 
           WritableRaster.setDataElements(int, int, java.lang.Object) , 
            SampleModel.setDataElements(int, int, java.lang.Object, java.awt.image.DataBuffer) 
           public WritableRaster createCompatibleWritableRaster(int w, int h)
WritableRaster具有指定的宽度和高度,其具有的数据布局( SampleModel )与此兼容ColorModel 。 
           此方法仅适用于每像素16位或更少位的色彩模型。 
            由于IndexColorModel可以被子类化,所以支持每像素大于16位的任何子类必须覆盖此方法。 
createCompatibleWritableRaster在 
            ColorModel 
           w - 宽度适用于新的 
            WritableRaster 
           h - 适用于新的 
            WritableRaster的高度 
           WritableRaster对象。 
           UnsupportedOperationException - 如果像素中的位数大于16 
           WritableRaster , SampleModel 
           public boolean isCompatibleRaster(Raster raster)
true如果 
           raster与此兼容 
           ColorModel或 
           false如果不是与此兼容 
           ColorModel 。 
          isCompatibleRaster在类别 
            ColorModel 
           raster - 要测试兼容性的Raster对象 
           true如果raster是兼容这个ColorModel ; 
            false否则。 
           public SampleModel createCompatibleSampleModel(int w, int h)
SampleModel具有指定的宽度和高度,具有与此兼容的数据布局 
           ColorModel 。 
          createCompatibleSampleModel在类别 
            ColorModel 
           w - 要应用于新的 
            SampleModel的宽度 
           h - 适用于新的 
            SampleModel的高度 
           SampleModel对象。 
           IllegalArgumentException - 如果 
            w或 
            h不大于0 
           SampleModel 
           public boolean isCompatibleSampleModel(SampleModel sm)
SampleModel与此兼容ColorModel 。 
           如果sm是null ,此方法返回false 。 
          isCompatibleSampleModel在类别 
            ColorModel 
           sm - 指定的 
            SampleModel或 
            null 
           true如果SampleModel的SampleModel与此ColorModel ; 
            false否则。 
           SampleModel 
           public BufferedImage convertToIntDiscrete(Raster raster, boolean forceARGB)
BufferedImage TYPE_INT_ARGB或TYPE_INT_RGB的具有Raster通过展开源的索引来计算的与像素数据Raster使用此的颜色/ alpha分量数组ColorModel 。 
           源Raster中每个索引值的较低n位(如上面的class description中所指定)用于计算返回图像中的颜色/ alpha值。 
           如果forceARGB为true ,则返回TYPE_INT_ARGB图像,无论此ColorModel是否具有Alpha组件阵列或透明像素。 
          raster - 指定的 
            Raster 
           forceARGB - 如果true ,返回的BufferedImage是TYPE_INT_ARGB; 
            否则为TYPE_INT_RGB 
           BufferedImage创建与指定的 
            Raster 
           IllegalArgumentException - 如果栅格参数与此IndexColorModel不兼容 
           public boolean isValid(int pixel)
pixel - 指定的像素值 
           true如果pixel有效; 
            false否则。 
           public boolean isValid()
true如果所有像素都有效; 
            false否则。 
           public BigInteger getValidPixels()
BigInteger ,表示色彩映射中有效/无效的像素。 
           如果该索引处的BigInteger值被设置,则该位有效,如果该索引处的BigInteger值未设置,则该BigInteger无效。 
           在BigInteger中查询的唯一有效范围是0和地图大小之间。 
          BigInteger有效/无效像素的BigInteger。 
           public void finalize()
ColorModel不再被 
           ColorModel就处理与这个 
           ColorModel的系统资源。 
          finalize在 
            ColorModel 
           WeakReference , PhantomReference 
           public String toString()
String这个内容表示 
           ColorModel对象。 
          toString在类别 
            ColorModel 
           String代表这个 
            ColorModel对象的内容。 
            Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.