public class Linear_LUT
extends java.lang.Object
implements org.jfree.data.function.Function2D
This algorithm maps 14-bit data numbers (DNs) between 0 and 16383 to 8-bit DNs between 0 and 254. (The 8-bit number 255 is a reserved value.) The algorithm has two parameters: a minimum 14-bit value and a maximum 14-bit value. Input 14-bit values that are less than the minimum are mapped to 0. Input values that are greater than the maximum are mapped to 254. Input values between the minimum and maximum are mapped according to a simple linear function.
The algorithm is strictly an integer algorithm. This implementation returns
doubles, however, because the Function2D
interface is double-based.
In addition, because this function represents a lookup table that maps
14-bit data to 8-bit data, the values are bounded: If the input parameter
(the 14-bit DN) is less than MINIMUM_14_BIT_VALUE
, MINIMUM_8_BIT_VALUE
is returned. If the input is greater than MAXIMUM_14_BIT_VALUE
, MAXIMUM_8_BIT_VALUE
is returned.
(Insert algorithm details here.)
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAXIMUM
The default maximum input 14-bit value.
|
static int |
DEFAULT_MINIMUM
The default minimum input 14-bit value.
|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static int |
MAXIMUM_14_BIT_VALUE
The maximum value for input 14-bit data.
|
static int |
MAXIMUM_8_BIT_VALUE
The largest value output by this function.
|
static int |
MINIMUM_14_BIT_VALUE
The minimum value for input 14-bit data.
|
static int |
MINIMUM_8_BIT_VALUE
The smallest value output by this function.
|
Constructor and Description |
---|
Linear_LUT()
Creates a Linear_LUT using default values for the minimum and
maximum.
|
Linear_LUT(int minimum,
int maximum)
Creates a Linear_LUT from a minimum input 14-bit value and a
maximum.
|
Modifier and Type | Method and Description |
---|---|
int |
getMaximum()
Returns the maximum input 14-bit value used by this lookup table function.
|
int |
getMinimum()
Returns the minimum input 14-bit value used by this lookup table function.
|
double |
getValue(double x)
Returns the value of the function (y) for a given input (x).
|
void |
setMaximum(int maximum)
Sets the maximum input 14-bit value used by this lookup table function.
|
void |
setMinimum(int minimum)
Sets the minimum input 14-bit value used by this lookup table function.
|
public static final java.lang.String ID
public static final int MINIMUM_14_BIT_VALUE
MINIMUM_8_BIT_VALUE
.public static final int MAXIMUM_14_BIT_VALUE
MAXIMUM_8_BIT_VALUE
.public static final int MINIMUM_8_BIT_VALUE
public static final int MAXIMUM_8_BIT_VALUE
public static final int DEFAULT_MINIMUM
public static final int DEFAULT_MAXIMUM
public Linear_LUT(int minimum, int maximum)
minimum
- the value for the minimum input 14-bit value used by this
lookup table function.maximum
- the value for the maximum input 14-bit value used by this
lookup table function.public Linear_LUT()
DEFAULT_MINIMUM
,
DEFAULT_MAXIMUM
public int getMinimum()
public void setMinimum(int minimum)
MINIMUM_14_BIT_VALUE
or greater than
MAXIMUM_14_BIT_VALUE
, MINIMUM_14_BIT_VALUE
will be used
instead.minimum
- the new value for the minimum input 14-bit value used by
this lookup table function.public int getMaximum()
public void setMaximum(int maximum)
MINIMUM_14_BIT_VALUE
or greater than
MAXIMUM_14_BIT_VALUE
, MAXIMUM_14_BIT_VALUE
will be used
instead.maximum
- the new value for the maximum input 14-bit value used by
this lookup table function.public double getValue(double x)
getValue
in interface org.jfree.data.function.Function2D
x
- the input x-value, a 14-bit pixel brightness.Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona