
 |
Chapter 22 java.awt.image Reference |
 |
ColorModel
Name
ColorModel
The abstract ColorModel class
defines the way a Java program represents colors. It provides methods for
extracting different color components from a pixel.
public class java.awt.image.ColorModel
extends java.lang.Object {
// Variables
protected int pixel_bits;
// Constructors
public ColorModel (int bits);
// Class Methods
public static ColorModel getRGBdefault();
// Instance Methods
public void finalize();
public abstract int getAlpha (int pixel);
public abstract int getBlue (int pixel);
public abstract int getGreen (int pixel);
public int getPixelSize();
public abstract int getRed (int pixel);
public int getRGB (int pixel);
}
The pixel_bits variable saves the ColorModel's
bits setting (the total number
of bits per pixel).
- Parameters
-
- bits
-
The number of bits required per pixel using this model.
- Description
-
Constructs a ColorModel object.
- Returns
-
The default ColorModel format,
which uses 8 bits for each of a pixel's color components: alpha (transparency),
red, green, and blue.
- Overrides
-
Object.finalize()
- Description
-
Cleans up when this object is garbage collected.
- Parameters
-
- pixel
-
A pixel encoded with this ColorModel.
- Returns
-
The current alpha setting of the pixel.
- Parameters
-
- pixel
-
A pixel encoded with this ColorModel.
- Returns
-
The current blue setting of the pixel.
- Parameters
-
- pixel
-
A pixel encoded with this ColorModel.
- Returns
-
The current green setting of the pixel.
- Returns
-
The current pixel size for the color model.
- Parameters
-
- pixel
-
A pixel encoded with this ColorModel.
- Returns
-
The current red setting of the pixel.
- Parameters
-
- pixel
-
A pixel encoded with this ColorModel.
- Returns
-
The current combined red, green, and blue settings of the pixel.
- Description
-
Gets the color of pixel in
the default RGB color model.
DirectColorModel, IndexColorModel,
Object
|
|