Skip to content
com.iristick.smartglass.support.camera2.params

Class TonemapCurve


Deprecated. 
Not maintained anymore. Please use the com.iristick.smartglass.core.camera package instead.

@Deprecated
public abstract class TonemapCurve
extends Object
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.

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 [0.0f, 1.0f].

Since:
Android API level 21
See Also:
CaptureRequest.TONEMAP_CURVE, CameraMetadata.TONEMAP_MODE_CONTRAST_CURVE, CameraCharacteristics.TONEMAP_MAX_CURVE_POINTS

Field Summary

Modifier and Type Field and Description
static int CHANNEL_BLUE
Deprecated. 
Index of the blue color channel curve.
static int CHANNEL_GREEN
Deprecated. 
Index of the green color channel curve.
static int CHANNEL_RED
Deprecated. 
Index of the red color channel curve.
static float LEVEL_BLACK
Deprecated. 
Lower bound tonemap value corresponding to pure black for a single color channel.
static float LEVEL_WHITE
Deprecated. 
Upper bound tonemap value corresponding to a pure white for a single color channel.
static int POINT_SIZE
Deprecated. 
Number of elements in a (Pin, Pout) point;

Constructor Summary

Constructor and Description
TonemapCurve()
Deprecated. 
 

Method Summary

Modifier and Type Method and Description
abstract void copyColorCurve(int colorChannel, float[] destination, int offset)
Deprecated. 
Copy the color curve for a single color channel from this tonemap curve into the destination.
static TonemapCurve create(float[] red, float[] green, float[] blue)
Deprecated. 
Create a new immutable TonemapCurve instance.
abstract boolean equals(Object obj)
Deprecated. 
Check if this TonemapCurve is equal to another TonemapCurve.
abstract PointF getPoint(int colorChannel, int index)
Deprecated. 
Get the point for a color channel at a specified index.
abstract int getPointCount(int colorChannel)
Deprecated. 
Get the number of points stored in this tonemap curve for the specified color channel.
abstract int hashCode()
Deprecated. 
abstract String toString()
Deprecated. 
Return the TonemapCurve as a string representation.

Methods inherited from class java.lang.Object

getClass, notify, notifyAll, wait, wait, wait

Field Detail

LEVEL_BLACK

public static final float LEVEL_BLACK
Deprecated. 
Lower bound tonemap value corresponding to pure black for a single color channel.

LEVEL_WHITE

public static final float LEVEL_WHITE
Deprecated. 
Upper bound tonemap value corresponding to a pure white for a single color channel.

POINT_SIZE

public static final int POINT_SIZE
Deprecated. 
Number of elements in a (Pin, Pout) point;

CHANNEL_RED

public static final int CHANNEL_RED
Deprecated. 
Index of the red color channel curve.

CHANNEL_GREEN

public static final int CHANNEL_GREEN
Deprecated. 
Index of the green color channel curve.

CHANNEL_BLUE

public static final int CHANNEL_BLUE
Deprecated. 
Index of the blue color channel curve.

Constructor Detail

TonemapCurve

public TonemapCurve()
Deprecated. 

Method Detail

create

public static TonemapCurve create(float[] red,
                                  float[] green,
                                  float[] blue)
Deprecated. 
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 * 2 elements and at least 2 * 2 elements.

All sub-elements must be in the inclusive range of [0.0f, 1.0f].

This constructor copies the array contents and does not retain ownership of the array.

Parameters:
red - An array of elements whose length is divisible by 2
green - An array of elements whose length is divisible by 2
blue - An array of elements whose length is divisible by 2
Returns:
A new TonemapCurve instance.
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 [0.0f, 1.0f]
NullPointerException - if any of the parameters are null

getPointCount

public abstract int getPointCount(int colorChannel)
Deprecated. 
Get the number of points stored in this tonemap curve for the specified color channel.
Parameters:
colorChannel - one of CHANNEL_RED, CHANNEL_GREEN, CHANNEL_BLUE
Returns:
number of points stored in this tonemap for that color's curve (≥ 0)
Throws:
IllegalArgumentException - if colorChannel was out of range

getPoint

public abstract PointF getPoint(int colorChannel,
                                int index)
Deprecated. 
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 [0.0f, 1.0f].

Parameters:
colorChannel - CHANNEL_RED, CHANNEL_GREEN, or CHANNEL_BLUE
index - at least 0 but no greater than getPointCount(colorChannel)
Returns:
the (Pin, Pout) pair mapping the tone for that index
Throws:
IllegalArgumentException - if colorChannel or index was out of range
See Also:
LEVEL_BLACK, LEVEL_WHITE

copyColorCurve

public abstract void copyColorCurve(int colorChannel,
                                    float[] destination,
                                    int offset)
Deprecated. 
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 [0.0f, 1.0f].

Parameters:
colorChannel - The color channel to copy.
destination - an array big enough to hold at least getPointCount(int) * POINT_SIZE elements after the offset
offset - a non-negative offset into the array
Throws:
NullPointerException - If destination was null
IllegalArgumentException - If offset was negative
ArrayIndexOutOfBoundsException - If there's not enough room to write the elements at the specified destination and offset.
See Also:
LEVEL_BLACK, LEVEL_WHITE

equals

public abstract boolean equals(Object obj)
Deprecated. 
Check if this TonemapCurve is equal to another TonemapCurve.

Two matrices are equal if and only if all of their elements are equal.

Overrides:
equals in class Object
Returns:
true if the objects were equal, false otherwise

hashCode

public abstract int hashCode()
Deprecated. 
Overrides:
hashCode in class Object

toString

public abstract String toString()
Deprecated. 
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.

Overrides:
toString in class Object
Returns:
string representation of TonemapCurve