edu.wisc.ssec.mcidas
Class EnhancementTable

java.lang.Object
  extended by edu.wisc.ssec.mcidas.EnhancementTable

public class EnhancementTable
extends Object

Class for reading a McIDAS enhancement table (.ET file). The default constructor creates a grey scale enhancement.


Constructor Summary
EnhancementTable()
          Construct an enhancement table with a grey scale enhancement.
EnhancementTable(File file)
          Construct an enhancement table from a file object.
EnhancementTable(String source)
          Construct an enhancement table from a local disk file or URL.
EnhancementTable(URL url)
          Construct an enhancement table from a remote URL object.
 
Method Summary
 int getIndex(int red, int green, int blue)
          Look up a unique (hopefully) RGB value and return the index
 int[][] getRGBValues()
          Retrieve the data values.
static void main(String[] args)
          Test by running: java edu.wisc.ssec.mcidas.EnhancementTable _OR_ java edu.wisc.ssec.mcidas.EnhancementTable enhancement_file.
 String toString()
          Print out a pretty table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EnhancementTable

public EnhancementTable()
Construct an enhancement table with a grey scale enhancement.


EnhancementTable

public EnhancementTable(String source)
                 throws McIDASException
Construct an enhancement table from a local disk file or URL.

Parameters:
source - source of the enhancement table (path or URL)
Throws:
McIDASException - error finding or reading the source.

EnhancementTable

public EnhancementTable(File file)
                 throws McIDASException
Construct an enhancement table from a file object.

Parameters:
file - file object representing the enhancement table.
Throws:
McIDASException - error finding or reading the file.

EnhancementTable

public EnhancementTable(URL url)
                 throws McIDASException
Construct an enhancement table from a remote URL object.

Parameters:
url - URL representing the enhancement table.
Throws:
McIDASException - error finding or reading the URL.
Method Detail

getRGBValues

public int[][] getRGBValues()
Retrieve the data values.

Returns:
integer array [3][256] of red, green, blue values or null if the table was not initialized correctly. Values range from 0-255.

getIndex

public int getIndex(int red,
                    int green,
                    int blue)
Look up a unique (hopefully) RGB value and return the index

Returns:
index value (0-255) or -1 if not found

toString

public String toString()
Print out a pretty table. Currently lists all values, but will eventually print a format like EU TABLE.

Overrides:
toString in class Object
Returns:
table of levels, red, green and blue values

main

public static void main(String[] args)
Test by running: