Class PaletteEntryForRange
java.lang.Object
org.apache.commons.imaging.formats.tiff.photometricinterpreters.floatingpoint.PaletteEntryForRange
- All Implemented Interfaces:
PaletteEntry
Provides a palette entry for colors associated with a range of values. The return value will be interpolated between the minimum and maximum value for this
entry.
In keeping with the conventions of many Geographic Information Systems (GIS) and art applications, this instance "covered" values in the range v0 ≤ f < v1. Thus, a value that exactly matches the upper bound of the range is not considered "covered".
-
Constructor Summary
ConstructorsConstructorDescriptionPaletteEntryForRange(float v0, float v1, Color color) Constructs a palette entry for the range of values v0 ≤ f < v1.PaletteEntryForRange(float v0, float v1, Color color0, Color color1) Constructs a palette entry for the range of values v0 ≤ f < v1. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates that the entry covers exactly one unique value (including, potentially, Float.NaN).intgetArgb(float f) Gets the integer ARGB color assignment associated with the input value.getColor(float f) Gets the color assignment associated with the input value.floatGets the lower-bound value for the palette entryfloatGets the upper-bound value for the palette entrybooleanisCovered(float f) Indicates whether the indicated floating-point value is within the range covered by this palette entry and can be assigned a valid color by the implementation.toString()
-
Constructor Details
-
PaletteEntryForRange
Constructs a palette entry for the range of values v0 ≤ f < v1. A single color will be returned for all values in range- Parameters:
v0- the lower bounds (inclusive) of the covered range of valuesv1- the upper bounds (non-inclusive) of the covered range of valuecolor- the color assigned to value v0
-
PaletteEntryForRange
Constructs a palette entry for the range of values v0 ≤ f < v1. The return color value will be interpolated between the two specified colors.- Parameters:
v0- the lower bounds (inclusive) of the covered range of valuesv1- the upper bounds (non-inclusive) of the covered range of valuecolor0- the color assigned to value v0color1- the color assigned to value v1
-
-
Method Details
-
coversSingleEntry
Description copied from interface:PaletteEntryIndicates that the entry covers exactly one unique value (including, potentially, Float.NaN).- Specified by:
coversSingleEntryin interfacePaletteEntry- Returns:
- true if the entry covers exactly one unique value
-
getArgb
Description copied from interface:PaletteEntryGets the integer ARGB color assignment associated with the input value. If the input value is not within the covered range of this instance, the return value is undefined (though the value zero is often used).- Specified by:
getArgbin interfacePaletteEntry- Parameters:
f- valid floating point value, or a NaN.- Returns:
- an integer value
-
getColor
Description copied from interface:PaletteEntryGets the color assignment associated with the input value. If the input value is not within the covered range of this instance, the return value is undefined (though a null return is often used).- Specified by:
getColorin interfacePaletteEntry- Parameters:
f- a valid floating point value, or a NaN.- Returns:
- a valid color instance or, potentially, a null if the floating point input is not within the covered range.
-
getLowerBound
Description copied from interface:PaletteEntryGets the lower-bound value for the palette entry- Specified by:
getLowerBoundin interfacePaletteEntry- Returns:
- if defined, a valid floating point value; otherwise, a null.
-
getUpperBound
Description copied from interface:PaletteEntryGets the upper-bound value for the palette entry- Specified by:
getUpperBoundin interfacePaletteEntry- Returns:
- if defined, a valid floating point value; otherwise, a null.
-
isCovered
Description copied from interface:PaletteEntryIndicates whether the indicated floating-point value is within the range covered by this palette entry and can be assigned a valid color by the implementation.- Specified by:
isCoveredin interfacePaletteEntry- Parameters:
f- a valid floating point value, or a NaN.- Returns:
- true if the entry can assign a color to the entry; otherwise, false.
-
toString
-