public final class LinearColorMap extends AbstractList<LinearColorMapElement> implements ColorMapTransform<LinearColorMapElement>
ColorMapTransform
implementation defining a linear colormap transformationModifier and Type | Class and Description |
---|---|
static class |
LinearColorMap.LinearColorMapType |
modCount
Constructor and Description |
---|
LinearColorMap(CharSequence name,
LinearColorMapElement[] standardElements)
Constructor which creates a
LinearColorMap without a NoDataCategory . |
LinearColorMap(CharSequence name,
LinearColorMapElement[] standardElements,
Color defColor) |
LinearColorMap(CharSequence name,
LinearColorMapElement[] standardElements,
LinearColorMapElement[] preFilteringElements,
Color defaultColor) |
LinearColorMap(String string,
LinearColorMapElement[] linearColorMapElements,
LinearColorMapElement[] linearColorMapElements2) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
LinearColorMapElement |
findDomainElement(double sample)
Returns the
DomainElement1D of the specified sample value. |
LinearColorMapElement |
get(int index) |
Range |
getApproximateDomainRange()
Returns the range of values in this
Domain1D . |
IndexColorModel |
getColorModel()
Returns a color model for this category list.
|
double |
getDefaultValue()
The default value which will be returned when asked to transform a value outside the valid domain elements.
|
LinearColorMapElement[] |
getDomainElements() |
String |
getName()
Returns the name of this object.
|
SampleModel |
getSampleModel(int width,
int height)
Creates a
SampleModel compatible with the underlying ColorModel having the specified width and height. |
int |
getSourceDimensions() |
int |
getTargetDimensions() |
boolean |
hasDefaultValue()
Indicates whether or not this
PiecewiseTransform1D has a default value which will be returned when asked to transform a value outside
the valid domain elements. |
boolean |
hasGaps()
Tell us if there is a gap in this
Domain1D which means a range where no DomainElement1D is defined. |
int |
hashCode() |
int |
size() |
double |
transform(double value)
Transforms the specified value.
|
Position |
transform(Position ptSrc,
Position ptDst) |
add, add, addAll, clear, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
public LinearColorMap(CharSequence name, LinearColorMapElement[] standardElements)
LinearColorMap
without a NoDataCategory
. Keep in mind that if the list has gaps, if you try to
transform a value that falls into a gap you'll get a nice TransformException
!categories
- the array of a categories to use for this LinearColorMap
.public LinearColorMap(CharSequence name, LinearColorMapElement[] standardElements, Color defColor)
public LinearColorMap(CharSequence name, LinearColorMapElement[] standardElements, LinearColorMapElement[] preFilteringElements, Color defaultColor)
public LinearColorMap(String string, LinearColorMapElement[] linearColorMapElements, LinearColorMapElement[] linearColorMapElements2)
public IndexColorModel getColorModel()
#getColors
).getColorModel
in interface ColorMapTransform<LinearColorMapElement>
visibleBand
- The band to be made visible (usually 0). All other bands, if any will be ignored.numBands
- The number of bands for the color model (usually 1). The returned color model will renderer only the visibleBand
and
ignore the others, but the existence of all numBands
will be at least tolerated. Supplemental bands, even invisible, are useful
for processing with Java Advanced Imaging.RenderedImage
objects with values in the #getRange
range.public SampleModel getSampleModel(int width, int height)
SampleModel
compatible with the underlying ColorModel
having the specified width and height.getSampleModel
in interface ColorMapTransform<LinearColorMapElement>
width
- represents the width for the final SampleModel
height
- represents the height for the final SampleModel
public LinearColorMapElement get(int index)
get
in interface List<LinearColorMapElement>
get
in class AbstractList<LinearColorMapElement>
public int size()
size
in interface Collection<LinearColorMapElement>
size
in interface List<LinearColorMapElement>
size
in class AbstractCollection<LinearColorMapElement>
public double getDefaultValue()
PiecewiseTransform1D
In case PiecewiseTransform1D.hasDefaultValue()
return false
this value has no meaning.
getDefaultValue
in interface PiecewiseTransform1D<LinearColorMapElement>
public boolean hasDefaultValue()
PiecewiseTransform1D
PiecewiseTransform1D
has a default value which will be returned when asked to transform a value outside
the valid domain elements.hasDefaultValue
in interface PiecewiseTransform1D<LinearColorMapElement>
boolean
to indicate whether or not this PiecewiseTransform1D
has a default value.public Range getApproximateDomainRange()
Domain1D
Domain1D
. This is the union of the range of values of every Domain1D
.getApproximateDomainRange
in interface Domain1D<LinearColorMapElement>
public LinearColorMapElement findDomainElement(double sample)
Domain1D
DomainElement1D
of the specified sample value. If no DomainElement1D
fits, then this method returns null
.findDomainElement
in interface Domain1D<LinearColorMapElement>
sample
- The value.null
.public LinearColorMapElement[] getDomainElements()
public String getName()
Domain1D
getName
in interface Domain1D<LinearColorMapElement>
public boolean hasGaps()
Domain1D
Domain1D
which means a range where no DomainElement1D
is defined.hasGaps
in interface Domain1D<LinearColorMapElement>
true
in case a gap exists, false
otherwise.public double transform(double value) throws TransformationException
PiecewiseTransform1D
transform
in interface PiecewiseTransform1D<LinearColorMapElement>
value
- The value to transform.TransformationException
- if the value can't be transformed.public int getSourceDimensions()
public int getTargetDimensions()
public Position transform(Position ptSrc, Position ptDst) throws TransformationException
TransformationException
public boolean equals(Object o)
equals
in interface Collection<LinearColorMapElement>
equals
in interface List<LinearColorMapElement>
equals
in class AbstractList<LinearColorMapElement>
public int hashCode()
hashCode
in interface Collection<LinearColorMapElement>
hashCode
in interface List<LinearColorMapElement>
hashCode
in class AbstractList<LinearColorMapElement>
Copyright © 2006–2015 GeoSolutions. All rights reserved.