The IndexColorModel class is a ColorModel that uses a color map lookup table (with a maximum size of 256) to convert pixel values into their alpha, red, green, and blue component parts.
public class java.awt.image.IndexColorModel extends java.awt.image.ColorModel { // Constructors public IndexColorModel (int bits, int size, byte[] colorMap, int start, boolean hasalpha); public IndexColorModel (int bits, int size, byte[] colorMap, int start, boolean hasalpha, int transparent); public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue); public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue, byte[] alpha); public IndexColorModel (int bits, int size, byte[] red, byte[] green, byte[] blue, int transparent); // Instance Methods public final int getAlpha (int pixel); public final void getAlphas (byte[] alphas); public final int getBlue (int pixel); public final void getBlues (byte[] blues); public final int getGreen (int pixel); public final void getGreens (byte[] greens); public final int getMapSize(); public final int getRed (int pixel); public final void getReds (byte[] reds); public final int getRGB (int pixel); public final int getTransparentPixel(); }
The number of bits in a pixel.
The number of entries in the color map. Note: this is not the size of the colorMap parameter.
Color component values in red, green, blue, alpha order; the alpha component is optional, and may not be present.
The starting position in colorMap array.
If hasalpha is true, alpha components are present in colorMap array.
If size is invalid.
Constructs an IndexColorModel object with the given component settings. The size of colorMap must be at least 3*size+start, if hasalpha is false; if hasalpha is true, colorMap.length must be at least 4*size+start.
The number of bits in a pixel.
The number of entries in the color map. Note: this is not the size of the colorMap parameter.
Color component values in red, green, blue, alpha order; the alpha component is optional, and may not be present.
The starting position in colorMap array.
If hasalpha is true, alpha components are present in colorMap array.
Position of colorMap entry for transparent pixel entry.
If size invalid.
Constructs an IndexColorModel object with the given component settings. The size of colorMap must be at least 3*size+start, if hasalpha is false; if hasalpha is true, colorMap.length must be at least 4*size+start. The color map has a transparent pixel; its location is given by transparent.
The number of bits in a pixel.
The number of entries in the color map.
Red color component values.
Green color component values.
Blue color component values.
If size invalid.
Constructs an IndexColorModel object with the given component settings. There is no alpha component. The length of the red, green, and blue arrays must be greater than size.
The number of bits in a pixel.
The number of entries in the color map.
Red color component values.
Green color component values.
Blue color component values.
Alpha component values.
If size is invalid.
If size is positive and alpha array is null.
Constructs an IndexColorModel object with the given component settings. The length of the red, green, blue, and alpha arrays must be greater than size.
The number of bits in a pixel.
The number of entries in the color map.
Red color component values.
Green color component values.
Blue color component values.
Position of transparent pixel entry.
If size is invalid.
Constructs an IndexColorModel object with the given component settings. The length of the red, green, blue, and alpha arrays must be greater than size. The color map has a transparent pixel; its location is given by transparent.
A pixel encoded with this ColorModel.
The current alpha setting of the pixel.
ColorModel.getAlpha(int)
The alpha values of the pixels in the color model.
Copies the alpha values from the color map into the array alphas[].
A pixel encoded with this ColorModel.
The current blue setting of the pixel.
ColorModel.getBlue(int)
The blue values of the pixels in the color model.
Copies the blue values from the color map into the array blues[].
A pixel encoded with this ColorModel.
The current green setting of the pixel.
ColorModel.getGreen(int)
The green values of the pixels in the color model.
Copies the green values from the color map into the array greens[].
The current size of the color map table.
A pixel encoded with this ColorModel.
The current red setting of the pixel.
ColorModel.getRed(int)
The red values of the pixels in the color model.
Copies the red values from the color map into the array reds[].
A pixel encoded with this ColorModel.
The current combined red, green, and blue settings of the pixel.
ColorModel.getRGB(int)
Gets the color of pixel in the default RGB color model.
The array index for the transparent pixel in the color model.
ColorModel