API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.awt.image. ColorModel View Source
Author(s)
Since
Version
10 Feb 1997
Serial
Hierarchy
 Object
      ColorModel
Implements
 Transparency
Subclasses
Description
publicabstract abstract class ColorModel
  The ColorModel abstract class encapsulates the methods for translating a pixel value to color components (for example, red, green, and blue) and an alpha component.
Constructors
public ColorModel (int bits)
  Constructs a ColorModel that translates pixels of the specified number of bits to color/alpha components.
protected ColorModel (int pixel_bits, int[] bits, ColorSpace cspace, boolean hasAlpha, boolean isAlphaPremultiplied, int transparency, int transferType)
  Constructs a ColorModel that translates pixel values to color/alpha components.
Methods
Hide/Show inherited methods
public ColorModel coerceData (WritableRaster raster, boolean isAlphaPremultiplied)
  Forces the raster data to match the state specified in the isAlphaPremultiplied variable, assuming the data is currently correctly described by this ColorModel.
public SampleModel createCompatibleSampleModel (int w, int h)
  Creates a SampleModel with the specified width and height that has a data layout compatible with this ColorModel.
public WritableRaster createCompatibleWritableRaster (int w, int h)
  Creates a WritableRaster with the specified width and height that has a data layout (SampleModel) compatible with this ColorModel.
public boolean equals (Object obj)
  Tests if the specified Object is an instance of ColorModel and if it equals this ColorModel.
public void finalize ()
Disposes of system resources associated with this ColorModel once this ColorModel is no longer referenced.
publicabstract int getAlpha (int pixel)
  Returns the alpha component for the specified pixel, scaled from 0 to 255.
public int getAlpha (Object inData)
  Returns the alpha component for the specified pixel, scaled from 0 to 255.
public WritableRaster getAlphaRaster (WritableRaster raster)
  Returns a Raster representing the alpha channel of an image, extracted from the input Raster, provided that pixel values of this ColorModel represent color and alpha information as separate spatial bands (e.g.
publicabstract int getBlue (int pixel)
  Returns the blue color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
public int getBlue (Object inData)
  Returns the blue color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
publicfinal ColorSpace getColorSpace ()
  Returns the ColorSpace associated with this ColorModel.
public int getComponents (int pixel, int[] components, int offset)
  Returns an array of unnormalized color/alpha components given a pixel in this ColorModel.
public int getComponents (Object pixel, int[] components, int offset)
  Returns an array of unnormalized color/alpha components given a pixel in this ColorModel.
public int getComponentSize ()
  Returns an array of the number of bits per color/alpha component.
public int getComponentSize (int componentIdx)
  Returns the number of bits for the specified color/alpha component.
public int getDataElement (float[] normComponents, int normOffset)
  Returns a pixel value represented as an int in this ColorModel, given an array of normalized color/alpha components.
public int getDataElement (int[] components, int offset)
  Returns a pixel value represented as an int in this ColorModel, given an array of unnormalized color/alpha components.
public Object getDataElements (float[] normComponents, int normOffset, Object obj)
  Returns a data element array representation of a pixel in this ColorModel, given an array of normalized color/alpha components.
public Object getDataElements (int[] components, int offset, Object obj)
  Returns a data element array representation of a pixel in this ColorModel, given an array of unnormalized color/alpha components.
public Object getDataElements (int rgb, Object pixel)
  Returns a data element array representation of a pixel in this ColorModel, given an integer pixel representation in the default RGB color model.
pack-privatestatic int getDefaultTransferType (int pixel_bits)
pack-privatestatic byte getGray16TosRGB8LUT (ICC_ColorSpace grayCS)
pack-privatestatic byte getGray8TosRGB8LUT (ICC_ColorSpace grayCS)
publicabstract int getGreen (int pixel)
  Returns the green color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
public int getGreen (Object inData)
  Returns the green color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
pack-privatestatic short getLinearGray16ToOtherGray16LUT (ICC_ColorSpace grayCS)
pack-privatestatic byte getLinearGray16ToOtherGray8LUT (ICC_ColorSpace grayCS)
pack-privatestatic byte getLinearRGB16TosRGB8LUT ()
pack-privatestatic byte getLinearRGB8TosRGB8LUT ()
public float getNormalizedComponents (int[] components, int offset, float[] normComponents, int normOffset)
  Returns an array of all of the color/alpha components in normalized form, given an unnormalized component array.
public float getNormalizedComponents (Object pixel, float[] normComponents, int normOffset)
  Returns an array of all of the color/alpha components in normalized form, given a pixel in this ColorModel.
public int getNumColorComponents ()
  Returns the number of color components in this ColorModel.
public int getNumComponents ()
  Returns the number of components, including alpha, in this ColorModel.
public int getPixelSize ()
  Returns the number of bits per pixel described by this ColorModel.
publicabstract int getRed (int pixel)
  Returns the red color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
public int getRed (Object inData)
  Returns the red color component for the specified pixel, scaled from 0 to 255 in the default RGB ColorSpace, sRGB.
public int getRGB (int pixel)
  Returns the color/alpha components of the pixel in the default RGB color model format.
public int getRGB (Object inData)
  Returns the color/alpha components for the specified pixel in the default RGB color model format.
publicstatic ColorModel getRGBdefault ()
  Returns a DirectColorModel that describes the default format for integer RGB values used in many of the methods in the AWT image interfaces for the convenience of the programmer.
pack-privatestatic short getsRGB8ToLinearRGB16LUT ()
pack-privatestatic byte getsRGB8ToLinearRGB8LUT ()
publicfinal int getTransferType ()
  Returns the transfer type of this ColorModel.
public int getTransparency () [Specified in Transparency]
  Returns the transparency.
public int getUnnormalizedComponents (float[] normComponents, int normOffset, int[] components, int offset)
  Returns an array of all of the color/alpha components in unnormalized form, given a normalized component array.
publicfinal boolean hasAlpha ()
  Returns whether or not alpha is supported in this ColorModel.
public int hashCode ()
  Returns the hash code for this ColorModel.
publicfinal boolean isAlphaPremultiplied ()
  Returns whether or not the alpha has been premultiplied in the pixel values to be translated by this ColorModel.
public boolean isCompatibleRaster (Raster raster)
  Returns true if raster is compatible with this ColorModel and false if it is not.
public boolean isCompatibleSampleModel (SampleModel sm)
  Checks if the SampleModel is compatible with this ColorModel.
pack-privatestatic boolean isLinearGRAYspace (ColorSpace cs)
pack-privatestatic boolean isLinearRGBspace (ColorSpace cs)
pack-privatestatic void loadLibraries ()
public String toString ()
  Returns the String representation of the contents of this ColorModelobject.
Fields
Hide/Show inherited fields
publicfinalstatic int BITMASK = "2" [Inherited From Transparency]
Represents image data that is guaranteed to be either completely opaque, with an alpha value of 1.0, or completely transparent, with an alpha value of 0.0.
pack-private ColorSpace colorSpace
pack-private int colorSpaceType
pack-privatestatic Map g16Tos8Map
pack-privatestatic Map g8Tos8Map
pack-private boolean is_sRGB
pack-private boolean isAlphaPremultiplied
pack-privatestatic byte l16Tos8
pack-privatestatic byte l8Tos8
pack-privatestatic Map lg16Toog16Map
pack-privatestatic Map lg16Toog8Map
pack-private int maxBits
pack-private int nBits
pack-private int numColorComponents
pack-private int numComponents
publicfinalstatic int OPAQUE = "1" [Inherited From Transparency]
Represents image data that is guaranteed to be completely opaque, meaning that all pixels have an alpha value of 1.0.
protected int pixel_bits
The total number of bits in the pixel.
pack-privatestatic short s8Tol16
pack-privatestatic byte s8Tol8
pack-private boolean supportsAlpha
protected int transferType
Data type of the array used to represent pixel values.
publicfinalstatic int TRANSLUCENT = "3" [Inherited From Transparency]
Represents image data that contains or might contain arbitrary alpha values between and including 0.0 and 1.0.
pack-private int transparency
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar