Class ColorMap
java.lang.Object
org.csstudio.swt.widgets.datadefinition.ColorMap
Color Map data type.
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionColorMap()
ColorMap
(ColorMap.PredefinedColorMap predefinedColorMap, boolean autoScale, boolean interpolate) -
Method Summary
Modifier and TypeMethodDescriptiondrawImage
(double[] dataArray, int dataWidth, int dataHeight, double max, double min) Calculate the image data from source data based on the color map.drawImage
(IPrimaryArrayWrapper dataArray, int dataWidth, int dataHeight, double max, double min, ImageData imageData, boolean shrink) Calculate the image data from source data based on the color map.boolean
RGB[]
Get a colors lookup table from 0 to 255.getMap()
getValueRGB
(ColorTuple[] colorTupleArray, double[] keyArray, double value) int
hashCode()
boolean
boolean
void
setAutoScale
(boolean autoScale) void
setColorMap
(LinkedHashMap<Double, RGB> colorMap) Set a new map.void
setInterpolate
(boolean interpolate) void
setPredefinedColorMap
(ColorMap.PredefinedColorMap predefinedColorMap) toString()
-
Constructor Details
-
ColorMap
public ColorMap() -
ColorMap
public ColorMap(ColorMap.PredefinedColorMap predefinedColorMap, boolean autoScale, boolean interpolate)
-
-
Method Details
-
getMap
- Returns:
- the map which back up the ColorMap
-
setColorMap
Set a new map.- Parameters:
colorMap
- the new map.
-
setAutoScale
public void setAutoScale(boolean autoScale) - Parameters:
autoScale
- the autoScale to set
-
isAutoScale
public boolean isAutoScale()- Returns:
- the autoScale
-
setInterpolate
public void setInterpolate(boolean interpolate) - Parameters:
interpolate
- the interpolate to set
-
isInterpolate
public boolean isInterpolate()- Returns:
- the interpolate
-
setPredefinedColorMap
- Parameters:
predefinedColorMap
- the predefinedColorMap to set
-
getPredefinedColorMap
- Returns:
- the predefinedColorMap
-
toString
-
drawImage
public ImageData drawImage(IPrimaryArrayWrapper dataArray, int dataWidth, int dataHeight, double max, double min, ImageData imageData, boolean shrink) Calculate the image data from source data based on the color map.- Parameters:
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/.- Returns:
- the image data. null if dataWidth or dataHeight is less than 1.
-
drawImage
public ImageData drawImage(double[] dataArray, int dataWidth, int dataHeight, double max, double min) Calculate the image data from source data based on the color map.- Parameters:
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 dataArray- Returns:
- the image data. null if dataWidth or dataHeight is less than 1.
-
getValueRGB
- Parameters:
value
- the value which has been scaled or not based on the autoScale flag.
-
getColorsLookupTable
Get a colors lookup table from 0 to 255. This only works for autoScale is true;- Returns:
- the colorsLookupTable a array of 256 colors corresponding to the value from min to max
-
getPalette
-
hashCode
public int hashCode() -
equals
-