IndexColorModel
class is a ColorModel
class that works with pixel values consisting of a single sample that is an index into a fixed colormap in the default sRGB color space. The colormap specifies red, green, blue, and optional alpha components corresponding to each index. All components are represented in the colormap as 8-bit unsigned integral values. Some constructors allow the caller to specify "holes" in the colormap by indicating which colormap entries are valid and which represent unusable colors via the bits set in a BigInteger
object. This color model is similar to an X11 PseudoColor visual. Some constructors provide a means to specify an alpha component for each pixel in the colormap, while others either provide no such means or, in some cases, a flag to indicate whether the colormap data contains alpha values. If no alpha is supplied to the constructor, an opaque alpha component (alpha = 1.0) is assumed for each entry. An optional transparent pixel value can be supplied that indicates a pixel to be made completely transparent, regardless of any alpha component supplied or assumed for that pixel value. Note that the color components in the colormap of an IndexColorModel
objects are never pre-multiplied with the alpha components.
If an IndexColorModel
object has a transparency value of Transparency.OPAQUE
, then the hasAlpha
and getNumComponents
methods (both inherited from ColorModel
) return false and 3, respectively. For any other transparency value, hasAlpha
returns true and getNumComponents
returns 4.
|
|
|
|
|
|