public class ColorMap
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ColorMap.PredefinedColorMap |
Constructor and Description |
---|
ColorMap() |
ColorMap(ColorMap.PredefinedColorMap predefinedColorMap,
boolean autoScale,
boolean interpolate) |
Modifier and Type | Method and Description |
---|---|
org.eclipse.swt.graphics.ImageData |
drawImage(double[] dataArray,
int dataWidth,
int dataHeight,
double max,
double min)
Calculate the image data from source data based on the color map.
|
org.eclipse.swt.graphics.ImageData |
drawImage(IPrimaryArrayWrapper dataArray,
int dataWidth,
int dataHeight,
double max,
double min,
org.eclipse.swt.graphics.ImageData imageData,
boolean shrink)
Calculate the image data from source data based on the color map.
|
org.eclipse.swt.graphics.RGB[] |
getColorsLookupTable()
Get a colors lookup table from 0 to 255.
|
java.util.LinkedHashMap<java.lang.Double,org.eclipse.swt.graphics.RGB> |
getMap() |
org.eclipse.swt.graphics.PaletteData |
getPalette() |
ColorMap.PredefinedColorMap |
getPredefinedColorMap() |
org.eclipse.swt.graphics.RGB |
getValueRGB(ColorTuple[] colorTupleArray,
double[] keyArray,
double value) |
boolean |
isAutoScale() |
boolean |
isInterpolate() |
void |
setAutoScale(boolean autoScale) |
void |
setColorMap(java.util.LinkedHashMap<java.lang.Double,org.eclipse.swt.graphics.RGB> colorMap)
Set a new map.
|
void |
setInterpolate(boolean interpolate) |
void |
setPredefinedColorMap(ColorMap.PredefinedColorMap predefinedColorMap) |
java.lang.String |
toString() |
public ColorMap()
public ColorMap(ColorMap.PredefinedColorMap predefinedColorMap, boolean autoScale, boolean interpolate)
public java.util.LinkedHashMap<java.lang.Double,org.eclipse.swt.graphics.RGB> getMap()
public void setColorMap(java.util.LinkedHashMap<java.lang.Double,org.eclipse.swt.graphics.RGB> colorMap)
colorMap
- the new map.public void setAutoScale(boolean autoScale)
autoScale
- the autoScale to setpublic boolean isAutoScale()
public void setInterpolate(boolean interpolate)
interpolate
- the interpolate to setpublic boolean isInterpolate()
public void setPredefinedColorMap(ColorMap.PredefinedColorMap predefinedColorMap)
predefinedColorMap
- the predefinedColorMap to setpublic ColorMap.PredefinedColorMap getPredefinedColorMap()
public java.lang.String toString()
toString
in class java.lang.Object
public org.eclipse.swt.graphics.ImageData drawImage(IPrimaryArrayWrapper dataArray, int dataWidth, int dataHeight, double max, double min, org.eclipse.swt.graphics.ImageData imageData, boolean shrink)
dataArray
- the source datadataWidth
- number of columns of dataArray; This will be the width of image data.dataHeight
- number of rows of dataArray; This will be the height of image data.max
- the upper limit of the data in dataArraymin
- the lower limit of the data in dataArrayimageData
- the imageData to be filled. null if a new instance should be created.shrink
- true if area size of image data is smaller than dataWidth*dataHeight. If this is true, it will use
the nearest neighbor iamge scaling algorithm as described at http://tech-algorithm.com/articles/nearest-neighbor-image-scaling/.public org.eclipse.swt.graphics.ImageData drawImage(double[] dataArray, int dataWidth, int dataHeight, double max, double min)
dataArray
- the source datadataWidth
- number of columns of dataArray; This will be the width of image data.dataHeight
- number of rows of dataArray; This will be the height of image data.max
- the upper limit of the data in dataArraymin
- the lower limit of the data in dataArrayimageData
- the imageData to be filled. null if a new instance should be created.public org.eclipse.swt.graphics.RGB getValueRGB(ColorTuple[] colorTupleArray, double[] keyArray, double value)
colorTupleArray
- keyArray
- value
- the value which has been scaled or not based on the autoScale flag.min
- max
- public org.eclipse.swt.graphics.RGB[] getColorsLookupTable()
public org.eclipse.swt.graphics.PaletteData getPalette()