Class ColorTable
- java.lang.Object
-
- org.hortonmachine.gears.io.grasslegacy.map.color.ColorTable
-
- Direct Known Subclasses:
GrassColorTable
public abstract class ColorTable extends Object
A JGrass colortable.
The color table consists of a list of catagory intervals sorted by starting catagory (cat0:RR:GG:BB - cat1:RR:GG:BB).
- Since:
- 1.1.0
- Author:
- Andrea Antonello - www.hydrologis.com
-
-
Field Summary
Fields Modifier and Type Field Description protected ColorbackgroundColorstatic byte[]blankprotected booleancolorTableEmptyprotected static intFIXED_COLORMAPprotected static intGRADIENT_COLORMAPprotected Vector<ColorRule>rules
-
Constructor Summary
Constructors Constructor Description ColorTable()Creates a new instance of ColorTable
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddColorRule(float cat0, int r0, int g0, int b0, float cat1, int r1, int g1, int b1)protected voidaddColorRule(int cat, int r, int g, int b)voidcreateDefaultColorTable(double[] dataRange)intgetAlpha()byte[]getColor(float x)Enumeration<ColorRule>getColorRules()voidinsertRule(float cat, ColorRule newrule)ByteBufferinterpolateColorMap(int mapType, ByteBuffer data, int dataOffset)Create the buffer with the rbg colormap.voidinterpolateColorValue(ByteBuffer cmapBuffer, double cell)Create the buffer with the rbg colormap.voidinterpolateColorValue(ByteBuffer cmapBuffer, float cell)Create the buffer with the rbg colormap.voidinterpolateColorValue(ByteBuffer cmapBuffer, int cell)Create the buffer with the rbg colormap.booleanisEmpty()voidsetBackgroundColor(Color clr)intsize()
-
-
-
Field Detail
-
blank
public static final byte[] blank
-
backgroundColor
protected Color backgroundColor
-
FIXED_COLORMAP
protected static final int FIXED_COLORMAP
- See Also:
- Constant Field Values
-
GRADIENT_COLORMAP
protected static final int GRADIENT_COLORMAP
- See Also:
- Constant Field Values
-
colorTableEmpty
protected boolean colorTableEmpty
-
-
Method Detail
-
getColorRules
public Enumeration<ColorRule> getColorRules()
-
size
public int size()
-
setBackgroundColor
public void setBackgroundColor(Color clr)
-
isEmpty
public boolean isEmpty()
-
addColorRule
protected void addColorRule(int cat, int r, int g, int b)
-
addColorRule
protected void addColorRule(float cat0, int r0, int g0, int b0, float cat1, int r1, int g1, int b1)
-
interpolateColorMap
public ByteBuffer interpolateColorMap(int mapType, ByteBuffer data, int dataOffset)
Create the buffer with the rbg colormap.- Parameters:
mapType- - type of map, from which to understand the single value offsetdata- - the buffer with the datadataOffset- - offset to define rows- Returns:
- the colormap byte buffer
-
interpolateColorValue
public void interpolateColorValue(ByteBuffer cmapBuffer, int cell)
Create the buffer with the rbg colormap.
-
interpolateColorValue
public void interpolateColorValue(ByteBuffer cmapBuffer, float cell)
Create the buffer with the rbg colormap.
-
interpolateColorValue
public void interpolateColorValue(ByteBuffer cmapBuffer, double cell)
Create the buffer with the rbg colormap.
-
insertRule
public void insertRule(float cat, ColorRule newrule)
-
getColor
public byte[] getColor(float x)
-
createDefaultColorTable
public void createDefaultColorTable(double[] dataRange)
-
getAlpha
public int getAlpha()
-
-