public class Square_Root_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 median value that specifies where the square root curve is steepest and a constant k that determines how spreading out the curve is. k is sometimes referred to as the "spreading constant" for this reason.
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.) The spreading constant k is constrained to be between 14 and 100.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MEDIAN
The default median input 14-bit value.
|
static int |
DEFAULT_SPREADING
The default spreading constant k.
|
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 |
MEDIAN_8_BIT_VALUE
The output median value for 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.
|
static int |
SPREADING_MAXIMUM
The maximum allowable value for the spreading constant k.
|
static int |
SPREADING_MINIMUM
The minimum allowable value for the spreading constant k.
|
Constructor and Description |
---|
Square_Root_LUT()
Creates a Square_Root_LUT using default values for the median
and spreading constant k.
|
Square_Root_LUT(int median,
int spreading)
Creates a Square_Root_LUT from a median input 14-bit value and
a spreading constant k.
|
Modifier and Type | Method and Description |
---|---|
int |
getMedian()
Returns the median input 14-bit value used by this lookup table function.
|
int |
getSpreading()
Returns the spreading constant k used by this lookup table function.
|
double |
getValue(double x)
Returns the value of the function (y) for a given input (x).
|
void |
setMedian(int median)
Sets the median input 14-bit value used by this lookup table function.
|
void |
setSpreading(int spreading)
Sets the spreading constant k used by this lookup table function.
|
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 MEDIAN_8_BIT_VALUE
public static final int SPREADING_MINIMUM
public static final int SPREADING_MAXIMUM
public static final int DEFAULT_MEDIAN
public static final int DEFAULT_SPREADING
public Square_Root_LUT(int median, int spreading)
median
- the value for the median input 14-bit value used by this
lookup table function.spreading
- the value for the spreading constant k used by this
lookup table function.public Square_Root_LUT()
DEFAULT_MEDIAN
,
DEFAULT_SPREADING
public int getMedian()
public void setMedian(int median)
MINIMUM_14_BIT_VALUE
, MINIMUM_14_BIT_VALUE
will be used instead. Likewise, if the median value
is greater than MAXIMUM_14_BIT_VALUE
, MAXIMUM_14_BIT_VALUE
will be used.median
- the new value for the median input 14-bit value used by
this lookup table algorithm.public int getSpreading()
public void setSpreading(int spreading)
SPREADING_MINIMUM
, SPREADING_MINIMUM
is used instead. If the spreading constant is greater than
SPREADING_MAXIMUM
, then SPREADING_MAXIMUM
is used.spreading
- the new value for the spreading constant k used by
this lookup table algorithm.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