# Print output for @column tags ?>
  public
  
  final
  
  class
  TonemapCurve
  
    extends Object
  
  
  
  
  
  
| java.lang.Object | |
| ↳ | android.hardware.camera2.params.TonemapCurve | 
Immutable class for describing a 2 x M x 3 tonemap curve of floats.
 
This defines red, green, and blue curves that the CameraDevice will
 use as the tonemapping/contrast/gamma curve when CaptureRequest#TONEMAP_MODE is
 set to CameraMetadata#TONEMAP_MODE_CONTRAST_CURVE.
For a camera device with
 MONOCHROME capability, all 3 channels will contain the same set of control points.
 
The total number of points (Pin, Pout) for each color channel can be no more than
 CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS.
The coordinate system for each point is within the inclusive range
 [.LEVEL_BLACK, .LEVEL_WHITE].
| Constants | |
|---|---|
| int | CHANNEL_BLUEIndex of the blue color channel curve. | 
| int | CHANNEL_GREENIndex of the green color channel curve. | 
| int | CHANNEL_REDIndex of the red color channel curve. | 
| float | LEVEL_BLACKLower bound tonemap value corresponding to pure black for a single color channel. | 
| float | LEVEL_WHITEUpper bound tonemap value corresponding to a pure white for a single color channel. | 
| int | POINT_SIZENumber of elements in a  | 
| Public constructors | |
|---|---|
| 
      TonemapCurve(float[] red, float[] green, float[] blue)
      Create a new immutable TonemapCurve instance. | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      copyColorCurve(int colorChannel, float[] destination, int offset)
      Copy the color curve for a single color channel from this tonemap curve into the destination. | 
| 
        
        
        
        
        
        boolean | 
      equals(Object obj)
      Check if this TonemapCurve is equal to another TonemapCurve. | 
| 
        
        
        
        
        
        PointF | 
      getPoint(int colorChannel, int index)
      Get the point for a color channel at a specified index. | 
| 
        
        
        
        
        
        int | 
      getPointCount(int colorChannel)
      Get the number of points stored in this tonemap curve for the specified color channel. | 
| 
        
        
        
        
        
        int | 
      hashCode()
      Returns a hash code value for the object. | 
| 
        
        
        
        
        
        String | 
      toString()
      Return the TonemapCurve as a string representation. | 
| Inherited methods | |
|---|---|
public static final int CHANNEL_BLUE
Index of the blue color channel curve.
Constant Value: 2 (0x00000002)
public static final int CHANNEL_GREEN
Index of the green color channel curve.
Constant Value: 1 (0x00000001)
public static final int CHANNEL_RED
Index of the red color channel curve.
Constant Value: 0 (0x00000000)
public static final float LEVEL_BLACK
Lower bound tonemap value corresponding to pure black for a single color channel.
Constant Value: 0.0
public static final float LEVEL_WHITE
Upper bound tonemap value corresponding to a pure white for a single color channel.
Constant Value: 1.0
public static final int POINT_SIZE
Number of elements in a (Pin, Pout) point;
Constant Value: 2 (0x00000002)
public TonemapCurve (float[] red, 
                float[] green, 
                float[] blue)
    
    
    
  Create a new immutable TonemapCurve instance.
Values are stored as a contiguous array of (Pin, Pout) points.
All parameters may have independent length but should have at most
 CameraCharacteristics#TONEMAP_MAX_CURVE_POINTS * .POINT_SIZE elements and
 at least 2 * .POINT_SIZE elements.
All sub-elements must be in the inclusive range of
 [.LEVEL_BLACK, .LEVEL_WHITE].
This constructor copies the array contents and does not retain ownership of the array.
| Parameters | |
|---|---|
| red | float: An array of elements whose length is divisible by.POINT_SIZE | 
| green | float: An array of elements whose length is divisible by.POINT_SIZE | 
| blue | float: An array of elements whose length is divisible by.POINT_SIZE | 
| Throws | |
|---|---|
| IllegalArgumentException | if any of input array length is invalid,
            or if any of the elements in the array are not in the range of
            [ .LEVEL_BLACK,.LEVEL_WHITE] | 
| NullPointerException | if any of the parameters are null | 
public void copyColorCurve (int colorChannel, 
                float[] destination, 
                int offset)
    
    
    
  Copy the color curve for a single color channel from this tonemap curve into the destination.
 
 Values are stored as packed (Pin, Pout) points, and there are a total of
 getPointCount(int) points for that respective channel.
All returned coordinates are between the range of
 [.LEVEL_BLACK, .LEVEL_WHITE].
| Parameters | |
|---|---|
| colorChannel | int | 
| destination | float: an array big enough to hold at leastgetPointCount(int)*POINT_SIZEelements after theoffset | 
| offset | int: a non-negative offset into the array | 
| Throws | |
|---|---|
| NullPointerException | If destinationwasnull | 
| IllegalArgumentException | If offset was negative | 
| ArrayIndexOutOfBoundsException | If there's not enough room to write the elements at the specified destination and offset. | 
See also:
public boolean equals (Object obj)
Check if this TonemapCurve is equal to another TonemapCurve.
Two matrices are equal if and only if all of their elements are
 Object#equals.
| Parameters | |
|---|---|
| obj | Object: the reference object with which to compare. | 
| Returns | |
|---|---|
| boolean | trueif the objects were equal,falseotherwise | 
public PointF getPoint (int colorChannel, int index)
Get the point for a color channel at a specified index.
The index must be at least 0 but no greater than getPointCount(int) for
 that colorChannel.
All returned coordinates in the point are between the range of
 [.LEVEL_BLACK, .LEVEL_WHITE].
| Parameters | |
|---|---|
| colorChannel | int:CHANNEL_RED,CHANNEL_GREEN, orCHANNEL_BLUE | 
| index | int: at least 0 but no greater thangetPointCount(colorChannel) | 
| Returns | |
|---|---|
| PointF | the (Pin, Pout)pair mapping the tone for that index | 
| Throws | |
|---|---|
| IllegalArgumentException | if colorChannelorindexwas out of range | 
See also:
public int getPointCount (int colorChannel)
Get the number of points stored in this tonemap curve for the specified color channel.
| Parameters | |
|---|---|
| colorChannel | int: one ofCHANNEL_RED,CHANNEL_GREEN,CHANNEL_BLUE | 
| Returns | |
|---|---|
| int | number of points stored in this tonemap for that color's curve (>= 0) | 
| Throws | |
|---|---|
| IllegalArgumentException | if colorChannelwas out of range | 
public int hashCode ()
Returns a hash code value for the object. This method is
 supported for the benefit of hash tables such as those provided by
 HashMap.
 
 The general contract of hashCode is:
 
hashCode method
     must consistently return the same integer, provided no information
     used in equals comparisons on the object is modified.
     This integer need not remain consistent from one execution of an
     application to another execution of the same application.
 equals(Object)
     method, then calling the hashCode method on each of
     the two objects must produce the same integer result.
 equals(java.lang.Object)
     method, then calling the hashCode method on each of the
     two objects must produce distinct integer results.  However, the
     programmer should be aware that producing distinct integer results
     for unequal objects may improve the performance of hash tables.
 
 As much as is reasonably practical, the hashCode method defined by
 class Object does return distinct integers for distinct
 objects. (This is typically implemented by converting the internal
 address of the object into an integer, but this implementation
 technique is not required by the
 Java™ programming language.)
| Returns | |
|---|---|
| int | a hash code value for this object. | 
public String toString ()
Return the TonemapCurve as a string representation.
 "TonemapCurve{R:[(%f, %f), (%f, %f) ... (%f, %f)], G:[(%f, %f), (%f, %f) ...
 (%f, %f)], B:[(%f, %f), (%f, %f) ... (%f, %f)]}",
 where each (%f, %f) respectively represents one point of the corresponding
 tonemap curve. 
| Returns | |
|---|---|
| String | string representation of TonemapCurve |