edu.wisc.ssec.mcidas
Class EnhancementTable
- java.lang.Object
-
- edu.wisc.ssec.mcidas.EnhancementTable
-
public class EnhancementTable extends java.lang.ObjectClass for reading a McIDAS enhancement table (.ET file). The default constructor creates a grey scale enhancement.
-
-
Constructor Summary
Constructors Constructor and Description EnhancementTable()Construct an enhancement table with a grey scale enhancement.EnhancementTable(java.io.File file)Construct an enhancement table from a file object.EnhancementTable(java.lang.String source)Construct an enhancement table from a local disk file or URL.EnhancementTable(java.net.URL url)Construct an enhancement table from a remote URL object.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetIndex(int red, int green, int blue)Look up a unique (hopefully) RGB value and return the indexint[][]getRGBValues()Retrieve the data values.static voidmain(java.lang.String[] args)Test by running: java edu.wisc.ssec.mcidas.EnhancementTable _OR_ java edu.wisc.ssec.mcidas.EnhancementTable enhancement_file.java.lang.StringtoString()Print out a pretty table.
-
-
-
Constructor Detail
-
EnhancementTable
public EnhancementTable()
Construct an enhancement table with a grey scale enhancement.
-
EnhancementTable
public EnhancementTable(java.lang.String source) throws McIDASExceptionConstruct 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(java.io.File file) throws McIDASExceptionConstruct 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(java.net.URL url) throws McIDASExceptionConstruct 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 java.lang.String toString()
Print out a pretty table. Currently lists all values, but will eventually print a format like EU TABLE.- Overrides:
toStringin classjava.lang.Object- Returns:
- table of levels, red, green and blue values
-
main
public static void main(java.lang.String[] args)
Test by running:- java edu.wisc.ssec.mcidas.EnhancementTable _OR_
- java edu.wisc.ssec.mcidas.EnhancementTable enhancement_file.
-
-
DMelt 3.0 © DataMelt by jWork.ORG