HiRISE

HiRISE.HiPlan.HOGG
Class Linear_LUT

java.lang.Object
  extended by HiRISE.HiPlan.HOGG.Linear_LUT
All Implemented Interfaces:
Function2D

public class Linear_LUT
extends Object
implements Function2D

A two-dimensional function that implements the HiRISE linear lookup table algorithm.

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.

Algorithm Details

(Insert algorithm details here.)

Version:
1.10
Author:
Christian Schaller - UA/PIRL

Field Summary
static int DEFAULT_MAXIMUM
          The default maximum input 14-bit value.
static int DEFAULT_MINIMUM
          The default minimum input 14-bit value.
static 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 Summary
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.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

MINIMUM_14_BIT_VALUE

public static final int MINIMUM_14_BIT_VALUE
The minimum value for input 14-bit data. Any input less than this value results in output of MINIMUM_8_BIT_VALUE.

See Also:
Constant Field Values

MAXIMUM_14_BIT_VALUE

public static final int MAXIMUM_14_BIT_VALUE
The maximum value for input 14-bit data. Any input greater than this value results in output of MAXIMUM_8_BIT_VALUE.

See Also:
Constant Field Values

MINIMUM_8_BIT_VALUE

public static final int MINIMUM_8_BIT_VALUE
The smallest value output by this function.

See Also:
Constant Field Values

MAXIMUM_8_BIT_VALUE

public static final int MAXIMUM_8_BIT_VALUE
The largest value output by this function.

See Also:
Constant Field Values

DEFAULT_MINIMUM

public static final int DEFAULT_MINIMUM
The default minimum input 14-bit value.

See Also:
Constant Field Values

DEFAULT_MAXIMUM

public static final int DEFAULT_MAXIMUM
The default maximum input 14-bit value.

See Also:
Constant Field Values
Constructor Detail

Linear_LUT

public Linear_LUT(int minimum,
                  int maximum)
Creates a Linear_LUT from a minimum input 14-bit value and a maximum.

Parameters:
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.

Linear_LUT

public Linear_LUT()
Creates a Linear_LUT using default values for the minimum and maximum.

See Also:
DEFAULT_MINIMUM, DEFAULT_MAXIMUM
Method Detail

getMinimum

public int getMinimum()
Returns the minimum input 14-bit value used by this lookup table function.

Returns:
the lookup table function's minimum input 14-bit value.

setMinimum

public void setMinimum(int minimum)
Sets the minimum input 14-bit value used by this lookup table function. If the minimum is less than MINIMUM_14_BIT_VALUE or greater than MAXIMUM_14_BIT_VALUE, MINIMUM_14_BIT_VALUE will be used instead.

Parameters:
minimum - the new value for the minimum input 14-bit value used by this lookup table function.

getMaximum

public int getMaximum()
Returns the maximum input 14-bit value used by this lookup table function.

Returns:
the lookup table function's maximum input 14-bit value.

setMaximum

public void setMaximum(int maximum)
Sets the maximum input 14-bit value used by this lookup table function. If the maximum is less than MINIMUM_14_BIT_VALUE or greater than MAXIMUM_14_BIT_VALUE, MAXIMUM_14_BIT_VALUE will be used instead.

Parameters:
maximum - the new value for the maximum input 14-bit value used by this lookup table function.

getValue

public double getValue(double x)
Returns the value of the function (y) for a given input (x). In the case of a Linear_LUT object, the value of the function is the 8-bit value calculated using the simple linear lookup table algorithm. The input is the 14-bit value of the original data.

Specified by:
getValue in interface Function2D
Parameters:
x - the input x-value, a 14-bit pixel brightness.
Returns:
the function value, an 8-bit pixel brightness.

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona