All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.las.ogdi.OGDIIndexColorModel

java.lang.Object
   |
   +----java.awt.image.ColorModel
           |
           +----java.awt.image.IndexColorModel
                   |
                   +----com.las.ogdi.OGDIIndexColorModel

public class OGDIIndexColorModel
extends IndexColorModel
The IndexColorModel class extends an indexed color table with labels for each. There is also the quantity of that category in the geographic object (if matrix).

Version:
1.0
Author:
Las Inc.

Constructor Index

 o OGDIIndexColorModel(int, int, byte[], byte[], byte[], byte[], String[], int[])
Creates an OGDIIndexColorModel table with 4 color channels.
 o OGDIIndexColorModel(int, int, byte[], int, boolean, int, String[], int[])
Creates an OGDIIndexColorModel instance with a colormap table.

Method Index

 o getLabel(int)
Gets a label describing that category.
 o getLabels()
Gets a label table for all categories.
 o getQuantities()
Gets a quantity of pixels table for all categories.
 o getQuantity(int)
Gets a quantity of pixels for that category.
 o toString()
Gets the complete color model description.

Constructors

 o OGDIIndexColorModel
 public OGDIIndexColorModel(int bits,
                            int size,
                            byte colorMap[],
                            int start,
                            boolean hasalpha,
                            int trans,
                            String label[],
                            int qty[])
Creates an OGDIIndexColorModel instance with a colormap table. Note: java.awt.image.IndexColorModel does not enforce exception throwing. It's your responsibility to catch ArrayIndexOutOfBoundsException & NullPointerException.

Parameters:
bits - number of bits in each pixel
size - of the palette
colorMap - array of packed red, green, blue and transparency values
start - index of the first value
hasalpha - true if colorMap includes tranparencies
trans - index of the transparent color
label - array of labels
qty - array of quantities of that category in a matrix
Returns:
no return
Throws: IllegalArgumentException
if size less than 1, qty, label out of bounds or contains null
See Also:
indexColorModel
 o OGDIIndexColorModel
 public OGDIIndexColorModel(int bits,
                            int size,
                            byte red[],
                            byte green[],
                            byte blue[],
                            byte trans[],
                            String label[],
                            int qty[])
Creates an OGDIIndexColorModel table with 4 color channels. Note: java.awt.image.IndexColorModel does not enforce exception throwing. It's your responsibility to catch ArrayIndexOutOfBoundsException & NullPointerException.

Parameters:
bits - number of bits in each pixel
size - of the palette
red - array of red values
green - array of green values
blue - array of blue values
trans - array of transparency values (0 is transparent)
label - array of labels
qty - array of quantities of that category in a matrix
Returns:
no return
Throws: IllegalArgumentException
if size less than 1, qty, label out of bounds or contains null

Methods

 o getLabel
 public String getLabel(int pixel)
Gets a label describing that category.

Parameters:
pixel - the category of the pixel
Returns:
a string label (an empty string if the category does not exist)
Throws: no
exception
 o getLabels
 public String[] getLabels()
Gets a label table for all categories.

Parameters:
no - parameter
Returns:
an array of string labels
Throws: no
exception
 o getQuantity
 public int getQuantity(int pixel)
Gets a quantity of pixels for that category.

Parameters:
pixel - the category of the pixel
Returns:
a number (0 if the category does not exist)
Throws: no
exception
 o getQuantities
 public int[] getQuantities()
Gets a quantity of pixels table for all categories.

Parameters:
no - parameter
Returns:
an array of quantities
Throws: no
exception
 o toString
 public String toString()
Gets the complete color model description.

Parameters:
no - parameter
Returns:
the color table list (red, green, blue, alpha, label and quantity) as a string
Throws: no
exception
Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index