public class ColorPaletteDef extends Object implements Cloneable
ColorPaletteDef
class represents a curve that is used to transform the sample values of a
geo-physical band into color palette indexes.
This special implementation of a gradation curve also provides separate color values for each of the tie points contained in the curve. This allows a better image interpretation because certain colors correspond to certain sample values even if the curve points are used to create color gradient palettes.
Modifier and Type | Class and Description |
---|---|
static class |
ColorPaletteDef.Point |
Constructor and Description |
---|
ColorPaletteDef(ColorPaletteDef.Point[] points) |
ColorPaletteDef(ColorPaletteDef.Point[] points,
int numColors) |
ColorPaletteDef(double minSample,
double maxSample) |
ColorPaletteDef(double minSample,
double centerSample,
double maxSample) |
Modifier and Type | Method and Description |
---|---|
void |
addPoint(ColorPaletteDef.Point point) |
Object |
clone() |
ColorPaletteDef |
createDeepCopy() |
boolean |
createPointAfter(int index,
Scaling scaling)
creates a new point between the point at the given index
|
void |
dispose()
Releases all of the resources used by this color palette definition and all of its owned children.
|
boolean |
equals(Object o) |
static Color |
getCenterColor(Color c1,
Color c2)
Creates the center color between the given two colors.
|
Color[] |
getColors() |
ColorPaletteDef.Point |
getFirstPoint() |
Iterator |
getIterator() |
ColorPaletteDef.Point |
getLastPoint() |
double |
getMaxDisplaySample() |
double |
getMinDisplaySample() |
int |
getNumColors() |
int |
getNumPoints() |
ColorPaletteDef.Point |
getPointAt(int index) |
ColorPaletteDef.Point[] |
getPoints() |
int |
hashCode() |
void |
insertPointAfter(int index,
ColorPaletteDef.Point point) |
boolean |
isAutoDistribute() |
boolean |
isDiscrete() |
boolean |
isFullyOpaque() |
static ColorPaletteDef |
loadColorPaletteDef(File file)
Loads a color palette definition from the given file
|
void |
removePointAt(int index) |
void |
setAutoDistribute(boolean autoDistribute) |
void |
setDiscrete(boolean discrete) |
void |
setNumColors(int numColors) |
void |
setNumPoints(int numPoints) |
void |
setPoints(ColorPaletteDef.Point[] points) |
static void |
storeColorPaletteDef(ColorPaletteDef colorPaletteDef,
File file)
Stores this color palette definition in the given file
|
public ColorPaletteDef(double minSample, double maxSample)
public ColorPaletteDef(double minSample, double centerSample, double maxSample)
public ColorPaletteDef(ColorPaletteDef.Point[] points)
public ColorPaletteDef(ColorPaletteDef.Point[] points, int numColors)
public boolean isDiscrete()
public void setDiscrete(boolean discrete)
public int getNumColors()
public void setNumColors(int numColors)
public int getNumPoints()
public void setNumPoints(int numPoints)
public boolean isFullyOpaque()
public boolean isAutoDistribute()
public void setAutoDistribute(boolean autoDistribute)
public ColorPaletteDef.Point getPointAt(int index)
public ColorPaletteDef.Point getFirstPoint()
public ColorPaletteDef.Point getLastPoint()
public double getMinDisplaySample()
public double getMaxDisplaySample()
public void insertPointAfter(int index, ColorPaletteDef.Point point)
public boolean createPointAfter(int index, Scaling scaling)
index
- the indexscaling
- the scalingpublic static Color getCenterColor(Color c1, Color c2)
c1
- 1st colorc2
- 2nd colorpublic void removePointAt(int index)
public void addPoint(ColorPaletteDef.Point point)
public ColorPaletteDef.Point[] getPoints()
public void setPoints(ColorPaletteDef.Point[] points)
public Iterator getIterator()
public ColorPaletteDef createDeepCopy()
public static ColorPaletteDef loadColorPaletteDef(File file) throws IOException
file
- the fileIOException
- if an I/O error occurspublic static void storeColorPaletteDef(ColorPaletteDef colorPaletteDef, File file) throws IOException
colorPaletteDef
- thje color palette definitionfile
- the fileIOException
- if an I/O error occurspublic void dispose()
This method should be called only if it is for sure that this object instance will never be used again. The
results of referencing an instance of this class after a call to dispose()
are undefined.
Overrides of this method should always call super.dispose();
after disposing this instance.
public Color[] getColors()
Copyright © 2014–2015 European Space Agency (ESA). All rights reserved.