public class IlvDoubleIntervalColorModel extends ColorModel implements IlvColorEncoder, IlvColorIntervalLimitFormat
pixel_bits, transferType
BITMASK, OPAQUE, TRANSLUCENT
Constructor and Description |
---|
IlvDoubleIntervalColorModel(Color[] colors,
double[] limits)
Creates an instance of
IlvIntervalColorModel . |
IlvDoubleIntervalColorModel(double min,
double max)
Creates a new
IlvDoubleIntervalColorModel instance. |
IlvDoubleIntervalColorModel(IlvInputStream stream)
Reads an
IlvIntervalColorModel instance from an
IlvIntervalColorModel object. |
Modifier and Type | Method and Description |
---|---|
boolean |
allowLimitChange()
If the color model editor is able to change the value of the limits
|
static double |
convertToDouble(Object o)
Converts an
IlvFeatureAttribute value to a
double value. |
boolean |
equals(Object object)
Compares this color model to the specified object.
|
String |
format(int value)
Formats the value using a
NumberFormat object. |
int |
getAlpha(int pixel)
Returns the alpha component for this pixel value.
|
int |
getBlue(int pixel)
Returns the interpolated blue component for this pixel value.
|
Color[] |
getColors()
Returns the color array.
|
int |
getGreen(int pixel)
Returns the interpolated green component for this pixel value.
|
int |
getIntervalCount()
Returns the number of intervals, that is, the number of limits + 1.
|
double[] |
getLimits()
Returns the limit array.
|
int |
getRed(int pixel)
Returns the interpolated red component for this pixel value.
|
int |
getRGB(int pixel)
Returns the interpolated RGB component for this pixel value.
|
int |
getValueRGB(Object value)
Encodes a graphical object meta data into a color.
|
int |
hashCode()
Returns a hash value for this object.
|
boolean |
isPersistent()
Returns
true . |
int |
parse(String limit)
Parses the limit using a
NumberFormat object. |
void |
write(IlvOutputStream stream)
Writes the renderer to an
IlvOutputStream . |
coerceData, createCompatibleSampleModel, createCompatibleWritableRaster, finalize, getAlpha, getAlphaRaster, getBlue, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElement, getDataElements, getDataElements, getDataElements, getGreen, getNormalizedComponents, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRGB, getRGBdefault, getTransferType, getTransparency, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied, isCompatibleRaster, isCompatibleSampleModel, toString
public IlvDoubleIntervalColorModel(Color[] colors, double[] limits)
IlvIntervalColorModel
. The intervals
from which the color model will interpolate the values are specified by an
array of colors and an array of limits arranged in descending order.
colors
- The array of Color
objects that define the
color limits.limits
- The array of double
values that define the
interval limits. The length of limits
should be equal to
colors.length - 2
.public IlvDoubleIntervalColorModel(IlvInputStream stream) throws IlvReadFileException
IlvIntervalColorModel
instance from an
IlvIntervalColorModel
object.stream
- The input stream.IlvReadFileException
- if an error occurs while reading.public IlvDoubleIntervalColorModel(double min, double max)
IlvDoubleIntervalColorModel
instance. The model
will contain exactly 2 limits and a black to white color model.min
- The minimum value.max
- The maximum value.public boolean equals(Object object)
equals
in class ColorModel
object
- The object to compare.true
is returned.public int hashCode()
hashCode
in class ColorModel
public int getAlpha(int pixel)
getAlpha
in class ColorModel
pixel
- The pixel value.public int getRed(int pixel)
getRed
in class ColorModel
pixel
- The pixel value.public int getGreen(int pixel)
getGreen
in class ColorModel
pixel
- The pixel value.public int getBlue(int pixel)
getBlue
in class ColorModel
pixel
- The pixel value.public int getRGB(int pixel)
getRGB
in class ColorModel
pixel
- The pixel value.public int getValueRGB(Object value)
getValueRGB
in interface IlvColorEncoder
value
- The metadata to encode.ColorModel.getRGBdefault()
color model.IlvColorEncoder.getValueRGB(java.lang.Object)
public static double convertToDouble(Object o)
IlvFeatureAttribute
value to a
double
value.o
- The IlvFeatureAttribute
to convert.double
value or
Double.NaN
if no conversion is possible.public Color[] getColors()
public double[] getLimits()
public int getIntervalCount()
public void write(IlvOutputStream stream) throws IOException
IlvOutputStream
.write
in interface IlvPersistentObject
stream
- the output streamIOException
- thrown when an exception occurs during
the write operation for this object.public boolean isPersistent()
true
.true
.public boolean allowLimitChange()
true
.allowLimitChange
in interface IlvColorIntervalLimitFormat
true
to give user access to insert/delete/change limits.IlvColorIntervalLimitFormat.allowLimitChange()
public String format(int value)
NumberFormat
object.format
in interface IlvColorIntervalLimitFormat
value
- The value.IlvColorIntervalLimitFormat.format(int)
public int parse(String limit)
NumberFormat
object.parse
in interface IlvColorIntervalLimitFormat
limit
- The limit.IlvColorIntervalLimitFormat.parse(java.lang.String)
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.