Most visited

Recently visited

Added in API level 21

TonemapCurve

public final class TonemapCurve
extends Object

java.lang.Object
   ↳ android.hardware.camera2.params.TonemapCurve


用于描述浮点数的 2 x M x 3色调映射曲线的不可变类。

这定义了红色,绿色和蓝色曲线 CameraDevice时会随着色调映射/对比度/伽玛曲线使用 TONEMAP_MODE设置为 TONEMAP_MODE_CONTRAST_CURVE

每个颜色通道的总点数 (Pin, Pout)不能超过 TONEMAP_MAX_CURVE_POINTS

每个点的坐标系统是包含性的范围[内 .LEVEL_BLACK.LEVEL_WHITE

也可以看看:

Summary

Constants

int CHANNEL_BLUE

蓝色通道曲线的索引。

int CHANNEL_GREEN

绿色通道曲线的索引。

int CHANNEL_RED

红色通道曲线的索引。

float LEVEL_BLACK

对于单个颜色通道,对应于纯黑的下限色调图值。

float LEVEL_WHITE

上限色调值对应于单个颜色通道的纯白色。

int POINT_SIZE

(Pin, Pout)点中的元素数;

Public constructors

TonemapCurve(float[] red, float[] green, float[] blue)

创建一个新的不可变的TonemapCurve实例。

Public methods

void copyColorCurve(int colorChannel, float[] destination, int offset)

将单个颜色通道的颜色曲线从此色调曲线复制到目标中。

boolean equals(Object obj)

检查这个TonemapCurve是否等于另一个TonemapCurve。

PointF getPoint(int colorChannel, int index)

获取指定索引处的颜色通道的点。

int getPointCount(int colorChannel)

获取指定颜色通道中存储在此色调曲线中的点数。

int hashCode()

返回对象的哈希码值。

String toString()

以字符串表示形式返回TonemapCurve。

Inherited methods

From class java.lang.Object

Constants

CHANNEL_BLUE

Added in API level 21
int CHANNEL_BLUE

蓝色通道曲线的索引。

常量值:2(0x00000002)

CHANNEL_GREEN

Added in API level 21
int CHANNEL_GREEN

绿色通道曲线的索引。

常数值:1(0x00000001)

CHANNEL_RED

Added in API level 21
int CHANNEL_RED

红色通道曲线的索引。

常量值:0(0x00000000)

LEVEL_BLACK

Added in API level 21
float LEVEL_BLACK

对于单个颜色通道,对应于纯黑的下限色调图值。

常数值:0.0

LEVEL_WHITE

Added in API level 21
float LEVEL_WHITE

上限色调值对应于单个颜色通道的纯白色。

常数值:1.0

POINT_SIZE

Added in API level 21
int POINT_SIZE

(Pin, Pout)点中的元素数;

常量值:2(0x00000002)

Public constructors

TonemapCurve

Added in API level 21
TonemapCurve (float[] red, 
                float[] green, 
                float[] blue)

创建一个新的不可变的TonemapCurve实例。

值存储为 (Pin, Pout)点的连续数组。

所有参数可能具有独立的长度,但最多应包含 TONEMAP_MAX_CURVE_POINTS * .POINT_SIZE元素和至少2 * .POINT_SIZE元素。

所有子元素都必须是在[的包容范围 .LEVEL_BLACK.LEVEL_WHITE

此构造函数复制数组内容并不保留数组的所有权。

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 methods

copyColorCurve

Added in API level 21
void copyColorCurve (int colorChannel, 
                float[] destination, 
                int offset)

将单个颜色通道的颜色曲线从此色调曲线复制到目标中。

值存储为打包 (Pin, Pout )点,并且该相应通道总共有 getPointCount(int)个点。

所有退回的坐标为[范围之间 .LEVEL_BLACK.LEVEL_WHITE

Parameters
colorChannel int
destination float: an array big enough to hold at least getPointCount(int) * POINT_SIZE elements after the offset
offset int: 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.

也可以看看:

equals

Added in API level 21
boolean equals (Object obj)

检查这个TonemapCurve是否等于另一个TonemapCurve。

两个矩阵相等当且仅当它们的所有元素都是 equal

Parameters
obj Object: the reference object with which to compare.
Returns
boolean true if the objects were equal, false otherwise

getPoint

Added in API level 21
PointF getPoint (int colorChannel, 
                int index)

获取指定索引处的颜色通道的点。

getPointCount(int)的索引必须至少为0,但不得大于 colorChannel

在所有点返回的坐标[范围之间 .LEVEL_BLACK.LEVEL_WHITE

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

也可以看看:

getPointCount

Added in API level 21
int getPointCount (int colorChannel)

获取指定颜色通道中存储在此色调曲线中的点数。

Parameters
colorChannel int: one of CHANNEL_RED, CHANNEL_GREEN, CHANNEL_BLUE
Returns
int number of points stored in this tonemap for that color's curve (>= 0)
Throws
IllegalArgumentException if colorChannel was out of range

hashCode

Added in API level 21
int hashCode ()

返回对象的哈希码值。 这种方法支持散列表的好处,例如HashMap提供的HashMap

hashCode的总合同是:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the 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.
  • If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the 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.

尽可能合理实用,由类Object定义的hashCode方法确实为不同的对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java TM编程语言不需要此实现技术。)

Returns
int a hash code value for this object.

toString

Added in API level 21
String toString ()

以字符串表示形式返回TonemapCurve。

"TonemapCurve{R:[(%f, %f), (%f, %f) ... (%f, %f)], G:[(%f, %f), (%f, %f) ... (%f, %f)], B:[(%f, %f), (%f, %f) ... (%f, %f)]}" ,其中每个 (%f, %f)分别表示对应的色调映射曲线的一个点。

Returns
String string representation of TonemapCurve

Hooray!