Packages This Package Prev Next Index
public  class  java.awt.image.IndexColorModel
    extends  java.awt.image.ColorModel  (II-§2.1)
{
        // Constructors
    public IndexColorModel(int  bits, int  size,	§2.6.1
                         byte  r[], byte  g[], byte  b[]);
    public IndexColorModel(int  bits, int  size,	§2.6.2
                         byte  r[], byte  g[], 
                            byte  b[], byte  a[]);
    public IndexColorModel(int  bits, int  size,	§2.6.3
                       byte  r[], byte  g[],
                        byte  b[], int  trans);
    public IndexColorModel(int  bits, int  size,	§2.6.4
                      byte  cmap[], int  start,
                        boolean  hasalpha);
    public IndexColorModel(int  bits, int  size,	§2.6.5
                        byte  cmap[], int  start,
                        boolean  hasalpha,  int  trans);
        // Methods
    public final int getAlpha(int  pixel);	§2.6.6
    public final void getAlphas(byte  a[]);	§2.6.7
    public final int getBlue(int  pixel);	§2.6.8
    public final void getBlues(byte  b[]);	§2.6.9
    public final int getGreen(int  pixel);	§2.6.10
    public final void getGreens(byte  g[]);	§2.6.11
    public final int getMapSize();	§2.6.12
    public final int getRed(int  pixel);	§2.6.13
    public final void getReds(byte  r[]);	§2.6.14
    public final int getRGB(int  pixel);	§2.6.15
    public final int getTransparentPixel();	§2.6.16
}
The index color model class specifies a color model (II-§2.1) in a which a pixel value is 
converted into alpha, red, green, and blue component by using the pixel value as an index 
into a color map. Each entry in the color map gives the alpha, red, green, and blue component for the corresponding pixel.
The maximum size of the color map is 256 entries.
This color model is similar to an X11 PseudoColor visual.
public IndexColorModel(int  bits, int  size, byte  r[],
                                              byte  g[], byte  b[])
. These first size elements of the arrays are the red, 
green, and blue values for pixels in the range 
. Pixels in the 
range 
 have red, green, and blue values of 0.
bits
- The number of bits in a pixel
size
- The size of the color component arrays
r
- an array of red color components
g
- an array of green color components
b
- an array of blue color components
public IndexColorModel(int  bits, int  size, byte  r[],
                                              byte  g[], byte  b[], byte  a[])
. These first size elements of the arrays are the red, 
green, and blue values for pixels in the range 
. Pixels in the 
range 
 have red, green, and blue, and alpha values of 0. 
bits
- The number of bits in a pixel
size
- a lower bound on the size of each of the arrays
r
- an array of red color components
g
- an array of green color components
b
- an array of blue color components
a
- an array of alpha value components
public
IndexColorModel(int  bits, int  size, byte  r[],
                                byte  g[], byte  b[], int  trans)
. These first size elements of the arrays are the red, 
green, and blue values for pixels in the range 
. Pixels in the 
range 
 have red, green, and blue values of 0.
bits
- The number of bits in a pixel
size
- The size of the color component arrays
r
- an array of red color components
g
- an array of green color components
b
- an array of blue color components
trans
- the index of the transparent pixel
public
IndexColorModel(int  bits, int  size, byte  cmap[],
                                int  start, boolean  hasalpha)
. The red, green, and blue components for a 
pixel i in the range 
 are in the three elements of the cmap 
array starting at cmap[start + 3i] Its alpha component is 255 (fully opaque).
. The red, green, blue, and alpha components for 
a pixel i in the range 
 are in the four elements of the cmap 
array starting at cmap[start + 4i]
 have red, green, and blue values of 
0, Their alpha component is 0 if hasalpha is true, and 255 otherwise.
bits
- the number of bits in a pixel
size
- the size of the color component arrays
cmap
- an array of color components
start
- the starting offset of the first color component
hasalpha
- if true, the alpha values are contained in the cmap array
public IndexColorModel(int  bits, int  size,
                                              byte  cmap[], int  start,
                                              boolean  hasalpha, int  trans)
bits
- the number of bits in a pixel
size
- the size of the color component arrays
cmap
- an array of color components
start
- the starting offset of the first color component
hasalpha
- if true, the alpha values are in the cmap array
trans
- The index of the fully transparent pixel.
public final int getAlpha(int  pixel)
pixel
- a pixel value
public final void getAlphas(byte  a[])
a
- an array into which to place the results
public final int getBlue(int  pixel)
pixel
- a pixel value
public final void getBlues(byte  b[])
b
- an array into which to place the results
public final int getGreen(int  pixel)
pixel
- a pixel value
public final void getGreens(byte  g[])
g
- an array into which to place the results
public final int getMapSize()
public final int getRed(int  pixel)
pixel
- a pixel value
public final void getReds(byte  r[])
a
- an array into which to place the results
public final int getRGB(int  pixel)
pixel
- a pixel value
public final int getTransparentPixel()
Packages This Package Prev Next IndexJava API Document (HTML generated by dkramer on April 22, 1996)