<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--NewPage-->
<html>
<head>
<!-- Generated by javadoc on Wed Jul 28 01:21:15 GMT 1999 -->
<title>
  Class java.awt.image.IndexColorModel
</title>
</head>
<body>
<a name="_top_"></a>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.image.html">This Package</a>  <a href="java.awt.image.ImageFilter.html#_top_">Previous</a>  <a href="java.awt.image.MemoryImageSource.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
<hr>
<h1>
  Class java.awt.image.IndexColorModel
</h1>
<pre>
<a href="java.lang.Object.html#_top_">java.lang.Object</a>
   |
   +----<a href="java.awt.image.ColorModel.html#_top_">java.awt.image.ColorModel</a>
           |
           +----java.awt.image.IndexColorModel
</pre>
<hr>
<dl>
  <dt> public class <b>IndexColorModel</b>
  <dt> extends <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
</dl>
A ColorModel class that specifies a translation from pixel values
 to alpha, red, green, and blue color components for pixels which
 represent indices into a fixed colormap.  An optional transparent
 pixel value can be supplied which indicates a completely transparent
 pixel, regardless of any alpha value recorded for that pixel value.
 This color model is similar to an X11 PseudoColor visual.
 <p>Many of the methods in this class are final.  The reason for
 this is that the underlying native graphics code makes assumptions
 about the layout and operation of this class and those assumptions
 are reflected in the implementations of the methods here that are
 marked final.  You can subclass this class for other reaons, but
 you cannot override or modify the behaviour of those methods.
<p>
<dl>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
</dl>
<hr>
<a name="index"></a>
<h2>
  <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index">
</h2>
<dl>
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IndexColorModel(int, int, byte[], byte[], byte[])"><b>IndexColorModel</b></a>(int, int, byte[], byte[], byte[])
  <dd>  Constructs an IndexColorModel from the given arrays of red,
 green, and blue components.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IndexColorModel(int, int, byte[], byte[], byte[], byte[])"><b>IndexColorModel</b></a>(int, int, byte[], byte[], byte[], byte[])
  <dd>  Constructs an IndexColorModel from the given arrays of red,
 green, blue and alpha components.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IndexColorModel(int, int, byte[], byte[], byte[], int)"><b>IndexColorModel</b></a>(int, int, byte[], byte[], byte[], int)
  <dd>  Constructs an IndexColorModel from the given arrays of red,
 green, and blue components.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IndexColorModel(int, int, byte[], int, boolean)"><b>IndexColorModel</b></a>(int, int, byte[], int, boolean)
  <dd>  Constructs an IndexColorModel from a single arrays of packed
 red, green, blue and optional alpha components.
  <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#IndexColorModel(int, int, byte[], int, boolean, int)"><b>IndexColorModel</b></a>(int, int, byte[], int, boolean, int)
  <dd>  Constructs an IndexColorModel from a single arrays of packed
 red, green, blue and optional alpha components.
</dl>
<h2>
  <img src="images/method-index.gif" width=207 height=38 alt="Method Index">
</h2>
<dl>
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlpha(int)"><b>getAlpha</b></a>(int)
  <dd>  Returns the alpha transparency value for the specified pixel in the
 range 0-255.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getAlphas(byte[])"><b>getAlphas</b></a>(byte[])
  <dd>  Copies the array of alpha transparency values into the given array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getBlue(int)"><b>getBlue</b></a>(int)
  <dd>  Returns the blue color compoment for the specified pixel in the
 range 0-255.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getBlues(byte[])"><b>getBlues</b></a>(byte[])
  <dd>  Copies the array of blue color components into the given array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getGreen(int)"><b>getGreen</b></a>(int)
  <dd>  Returns the green color compoment for the specified pixel in the
 range 0-255.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getGreens(byte[])"><b>getGreens</b></a>(byte[])
  <dd>  Copies the array of green color components into the given array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getMapSize()"><b>getMapSize</b></a>()
  <dd>  Returns the size of the color component arrays in this IndexColorModel.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRed(int)"><b>getRed</b></a>(int)
  <dd>  Returns the red color compoment for the specified pixel in the
 range 0-255.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getReds(byte[])"><b>getReds</b></a>(byte[])
  <dd>  Copies the array of red color components into the given array.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getRGB(int)"><b>getRGB</b></a>(int)
  <dd>  Returns the color of the pixel in the default RGB color model.
  <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o ">
	<a href="#getTransparentPixel()"><b>getTransparentPixel</b></a>()
  <dd>  Returns the index of the transparent pixel in this IndexColorModel
 or -1 if there is no transparent pixel.
</dl>
<a name="constructors"></a>
<h2>
  <img src="images/constructors.gif" width=231 height=38 alt="Constructors">
</h2>
<a name="IndexColorModel"></a>
<a name="IndexColorModel(int, int, byte[], byte[], byte[])"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IndexColorModel</b>
<pre>
 public IndexColorModel(int bits,
                        int size,
                        byte r[],
                        byte g[],
                        byte b[])
</pre>
<dl>
  <dd> Constructs an IndexColorModel from the given arrays of red,
 green, and blue components.  Pixels described by this color
 model will all have alpha components of 255 (fully opaque).
 All of the arrays specifying the color components must have
 at least the specified number of entries.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> bits - The number of bits each pixel occupies.
    <dd> size - The size of the color component arrays.
    <dd> r - The array of red color components.
    <dd> g - The array of green color components.
    <dd> b - The array of blue color components.
  </dl></dd>
</dl>
<a name="IndexColorModel(int, int, byte[], byte[], byte[], int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IndexColorModel</b>
<pre>
 public IndexColorModel(int bits,
                        int size,
                        byte r[],
                        byte g[],
                        byte b[],
                        int trans)
</pre>
<dl>
  <dd> Constructs an IndexColorModel from the given arrays of red,
 green, and blue components.  Pixels described by this color
 model will all have alpha components of 255 (fully opaque),
 except for the indicated transparent pixel.  All of the arrays
 specifying the color components must have at least the specified
 number of entries.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> bits - The number of bits each pixel occupies.
    <dd> size - The size of the color component arrays.
    <dd> r - The array of red color components.
    <dd> g - The array of green color components.
    <dd> b - The array of blue color components.
    <dd> trans - The index of the transparent pixel.
  </dl></dd>
</dl>
<a name="IndexColorModel(int, int, byte[], byte[], byte[], byte[])"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IndexColorModel</b>
<pre>
 public IndexColorModel(int bits,
                        int size,
                        byte r[],
                        byte g[],
                        byte b[],
                        byte a[])
</pre>
<dl>
  <dd> Constructs an IndexColorModel from the given arrays of red,
 green, blue and alpha components.  All of the arrays specifying
 the color components must have at least the specified number
 of entries.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> bits - The number of bits each pixel occupies.
    <dd> size - The size of the color component arrays.
    <dd> r - The array of red color components.
    <dd> g - The array of green color components.
    <dd> b - The array of blue color components.
    <dd> a - The array of alpha value components.
  </dl></dd>
</dl>
<a name="IndexColorModel(int, int, byte[], int, boolean)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IndexColorModel</b>
<pre>
 public IndexColorModel(int bits,
                        int size,
                        byte cmap[],
                        int start,
                        boolean hasalpha)
</pre>
<dl>
  <dd> Constructs an IndexColorModel from a single arrays of packed
 red, green, blue and optional alpha components.  The array
 must have enough values in it to fill all of the needed
 component arrays of the specified size.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> bits - The number of bits each pixel occupies.
    <dd> size - The size of the color component arrays.
    <dd> cmap - The array of color components.
    <dd> start - The starting offset of the first color component.
    <dd> hasalpha - Indicates whether alpha values are contained in
			the cmap array.
  </dl></dd>
</dl>
<a name="IndexColorModel(int, int, byte[], int, boolean, int)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a>
<b>IndexColorModel</b>
<pre>
 public IndexColorModel(int bits,
                        int size,
                        byte cmap[],
                        int start,
                        boolean hasalpha,
                        int trans)
</pre>
<dl>
  <dd> Constructs an IndexColorModel from a single arrays of packed
 red, green, blue and optional alpha components.  The specified
 transparent index represents a pixel which will be considered
 entirely transparent regardless of any alpha value specified
 for it.  The array must have enough values in it to fill all
 of the needed component arrays of the specified size.
<p>
  <dd><dl>
    <dt> <b>Parameters:</b>
    <dd> bits - The number of bits each pixel occupies.
    <dd> size - The size of the color component arrays.
    <dd> cmap - The array of color components.
    <dd> start - The starting offset of the first color component.
    <dd> hasalpha - Indicates whether alpha values are contained in
			the cmap array.
    <dd> trans - The index of the fully transparent pixel.
  </dl></dd>
</dl>
<a name="methods"></a>
<h2>
  <img src="images/methods.gif" width=151 height=38 alt="Methods">
</h2>
<a name="getMapSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getMapSize"><b>getMapSize</b></a>
<pre>
 public final int getMapSize()
</pre>
<dl>
  <dd> Returns the size of the color component arrays in this IndexColorModel.
<p>
</dl>
<a name="getTransparentPixel()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getTransparentPixel"><b>getTransparentPixel</b></a>
<pre>
 public final int getTransparentPixel()
</pre>
<dl>
  <dd> Returns the index of the transparent pixel in this IndexColorModel
 or -1 if there is no transparent pixel.
<p>
</dl>
<a name="getReds(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getReds"><b>getReds</b></a>
<pre>
 public final void getReds(byte r[])
</pre>
<dl>
  <dd> Copies the array of red color components into the given array.  Only
 the initial entries of the array as specified by getMapSize() are
 written.
<p>
</dl>
<a name="getGreens(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getGreens"><b>getGreens</b></a>
<pre>
 public final void getGreens(byte g[])
</pre>
<dl>
  <dd> Copies the array of green color components into the given array.  Only
 the initial entries of the array as specified by getMapSize() are
  written.
<p>
</dl>
<a name="getBlues(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getBlues"><b>getBlues</b></a>
<pre>
 public final void getBlues(byte b[])
</pre>
<dl>
  <dd> Copies the array of blue color components into the given array.  Only
 the initial entries of the array as specified by getMapSize() will
 be written.
<p>
</dl>
<a name="getAlphas(byte[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlphas"><b>getAlphas</b></a>
<pre>
 public final void getAlphas(byte a[])
</pre>
<dl>
  <dd> Copies the array of alpha transparency values into the given array.  Only
 the initial entries of the array as specified by getMapSize() will
 be written.
<p>
</dl>
<a name="getRed(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRed"><b>getRed</b></a>
<pre>
 public final int getRed(int pixel)
</pre>
<dl>
  <dd> Returns the red color compoment for the specified pixel in the
 range 0-255.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getRed(int)">getRed</a> in class <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
  </dl></dd>
</dl>
<a name="getGreen(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getGreen"><b>getGreen</b></a>
<pre>
 public final int getGreen(int pixel)
</pre>
<dl>
  <dd> Returns the green color compoment for the specified pixel in the
 range 0-255.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getGreen(int)">getGreen</a> in class <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
  </dl></dd>
</dl>
<a name="getBlue(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getBlue"><b>getBlue</b></a>
<pre>
 public final int getBlue(int pixel)
</pre>
<dl>
  <dd> Returns the blue color compoment for the specified pixel in the
 range 0-255.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getBlue(int)">getBlue</a> in class <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
  </dl></dd>
</dl>
<a name="getAlpha(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getAlpha"><b>getAlpha</b></a>
<pre>
 public final int getAlpha(int pixel)
</pre>
<dl>
  <dd> Returns the alpha transparency value for the specified pixel in the
 range 0-255.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getAlpha(int)">getAlpha</a> in class <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
  </dl></dd>
</dl>
<a name="getRGB(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a>
<a name="getRGB"><b>getRGB</b></a>
<pre>
 public final int getRGB(int pixel)
</pre>
<dl>
  <dd> Returns the color of the pixel in the default RGB color model.
<p>
  <dd><dl>
    <dt> <b>Overrides:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getRGB(int)">getRGB</a> in class <a href="java.awt.image.ColorModel.html#_top_">ColorModel</a>
    <dt> <b>See Also:</b>
    <dd> <a href="java.awt.image.ColorModel.html#getRGBdefault">getRGBdefault</a>
  </dl></dd>
</dl>
<hr>
<pre>
<a href="packages.html">All Packages</a>  <a href="tree.html">Class Hierarchy</a>  <a href="Package-java.awt.image.html">This Package</a>  <a href="java.awt.image.ImageFilter.html#_top_">Previous</a>  <a href="java.awt.image.MemoryImageSource.html#_top_">Next</a>  <a href="AllNames.html">Index</a></pre>
</body>
</html>
