public class ColorEnhancement extends EarthDataView
changed, image, imageDims, overlays, progress, stopRendering, trans, UPDATE_FRACTION, verbose
Constructor and Description |
---|
ColorEnhancement(EarthTransform trans,
Grid grid,
Palette pal,
EnhancementFunction func)
Constructs a new color enhancement from the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Overrides the parent class to null out the cached legend.
|
java.awt.image.IndexColorModel |
getColorModel()
Gets the index color model used for images.
|
int |
getColors()
Gets the number of colors in color model.
|
EnhancementFunction |
getFunction()
Gets the enhancement function.
|
Grid |
getGrid()
Gets the data grid variable.
|
Legend |
getLegend()
Gets a data color scale legend for annotation of this color
enhancement.
|
Palette |
getPalette()
Gets the enhancement color palette.
|
void |
normalize(double units)
Normalizes the enhancement function for this view using the
visible grid value statistics.
|
protected void |
prepare(java.awt.Graphics2D g)
Prepares this view for rendering using the specified graphics
object.
|
void |
restoreSettings(ColorEnhancementSettings settings)
Restores the previously saved settings.
|
ColorEnhancementSettings |
saveSettings()
Saves and returns the current settings.
|
void |
setAdjustingFunction(EnhancementFunction adjFunc)
Sets an adjusting function.
|
void |
setColors(int colors)
Sets the number of colors in the color model.
|
void |
setFunction(EnhancementFunction func)
Sets the enhancement function.
|
void |
setGrid(Grid grid)
Sets the data grid variable.
|
void |
setMissingColor(java.awt.Color missingColor)
Sets the missing value color.
|
void |
setPalette(Palette pal)
Sets the enhancement color palette.
|
addOverlay, addOverlays, computeCaches, containsOverlay, getArea, getBounds, getCenter, getCorners, getImageAffine, getOrientationAffine, getOverlays, getProgress, getResolution, getScale, getSize, getSubregion, getTransform, getUpsideDown, hasCompatibleCaches, hasCoordinateCaches, invalidate, isChanged, isPrepared, isRendering, magnify, magnify, magnify, main, removeOverlay, render, reset, resize, resize, resizeHeight, resizeMaxAspect, resizeWidth, setCenter, setCenterAndScale, setChanged, setImageAffine, setProgress, setProperties, setSize, setVerbose, showSubregion, stopRendering, transform, transform
public ColorEnhancement(EarthTransform trans, Grid grid, Palette pal, EnhancementFunction func) throws java.awt.geom.NoninvertibleTransformException
trans
- the view earth transform.grid
- the grid variable to use for this enhancement.pal
- the indexed color palette for color enhancement.func
- the enhancement function.java.awt.geom.NoninvertibleTransformException
- if the resulting image
transform is not invertible.public int getColors()
setColors(int)
public void setColors(int colors)
colors
- the number of colors in the model, up to 256
which is the default. The actual number of colors for data
will be one less than the number of colors in the model, and
the last color will be used for missing data.public java.awt.image.IndexColorModel getColorModel()
public Grid getGrid()
public Palette getPalette()
public EnhancementFunction getFunction()
public void setGrid(Grid grid)
public void setPalette(Palette pal)
public void setMissingColor(java.awt.Color missingColor)
public void setAdjustingFunction(EnhancementFunction adjFunc)
setFunction(noaa.coastwatch.render.EnhancementFunction)
will set the view back to
normal.adjFunc
- the adjusting function.public void setFunction(EnhancementFunction func)
protected void prepare(java.awt.Graphics2D g)
EarthDataView
prepare
in class EarthDataView
public Legend getLegend()
getLegend
in class EarthDataView
DataColorScale
public void normalize(double units)
units
- the number of standard deviation units above and
below the mean for the data range.public ColorEnhancementSettings saveSettings()
public void restoreSettings(ColorEnhancementSettings settings)
settings
- the settings to restore. Only the palette and
function are used -- the variable name is igored.public java.lang.Object clone()
clone
in class EarthDataView