Most visited

Recently visited

Added in API level 21

ColorSpaceTransform

public final class ColorSpaceTransform
extends Object

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


不可变类,用于按行优先顺序描述 Rational值的3x3矩阵。

该矩阵映射从一个颜色空间到另一个颜色空间的变换。 对于特定的色彩空间来源和目标,请参阅提供此值的键的适当相机元数据文档。

也可以看看:

Summary

Public constructors

ColorSpaceTransform(Rational[] elements)

Rational阵列创建一个新的不可变的 ColorSpaceTransform实例。

ColorSpaceTransform(int[] elements)

int阵列创建一个新的不可变 ColorSpaceTransform实例。

Public methods

void copyElements(int[] destination, int offset)

Rational元素按行排序从该矩阵复制到目标中。

void copyElements(Rational[] destination, int offset)

将主矩阵中的 Rational元素从该矩阵复制到目标中。

boolean equals(Object obj)

检查这个 ColorSpaceTransform是否等于另一个 ColorSpaceTransform

Rational getElement(int column, int row)

通过行和列获取此矩阵的元素。

int hashCode()

返回对象的哈希码值。

String toString()

以字符串表示形式返回颜色空间转换。

Inherited methods

From class java.lang.Object

Public constructors

ColorSpaceTransform

Added in API level 21
ColorSpaceTransform (Rational[] elements)

Rational阵列创建一个新的不可变 ColorSpaceTransform实例。

这些元素必须以行主要顺序存储。

Parameters
elements Rational: An array of 9 elements
Throws
IllegalArgumentException if the count of elements is not 9
NullPointerException if elements or any sub-element is null

ColorSpaceTransform

Added in API level 21
ColorSpaceTransform (int[] elements)

int阵列创建一个新的不可变 ColorSpaceTransform实例。

这些元素必须以行主要顺序存储。 每个理性都被连续存储为一对(numerator, denominator)

尤其是:

int[] elements = new int[
     N11, D11, N12, D12, N13, D13,
     N21, D21, N22, D22, N23, D23,
     N31, D31, N32, D32, N33, D33
 ];

 new ColorSpaceTransform(elements)
where Nij and Dij is the numerator and denominator for row i and column j.

Parameters
elements int: An array of 18 elements
Throws
IllegalArgumentException if the count of elements is not 18
NullPointerException if elements is null

Public methods

copyElements

Added in API level 21
void copyElements (int[] destination, 
                int offset)

将主矩阵中的 Rational元素从该矩阵复制到目标中。

每个元素都被存储为一个连续的合理包装,作为一个 (numerator, denominator)整数对,与 constructor相同。

Parameters
destination int: an array big enough to hold at least 18 elements after the offset
offset int: a non-negative offset into the array
Throws
NullPointerException If destination was null
ArrayIndexOutOfBoundsException If there's not enough room to write the elements at the specified destination and offset.

也可以看看:

copyElements

Added in API level 21
void copyElements (Rational[] destination, 
                int offset)

Rational元素以行优先顺序从此矩阵复制到目标中。

Parameters
destination Rational: an array big enough to hold at least 9 elements after the offset
offset int: a non-negative offset into the array
Throws
NullPointerException If destination was null
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)

检查这 ColorSpaceTransform是否等于另一个 ColorSpaceTransform

两个颜色空间变换当且仅当它们的所有元素都是 equal

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

getElement

Added in API level 21
Rational getElement (int column, 
                int row)

通过行和列获取此矩阵的元素。

行必须在[0,3)范围内,且列必须在[0,3)范围内。

Parameters
column int
row int
Returns
Rational element (non-null)
Throws
IllegalArgumentException if column or row 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 ()

以字符串表示形式返回颜色空间转换。

Example: "ColorSpaceTransform([1/1, 0/1, 0/1], [0/1, 1/1, 0/1], [0/1, 0/1, 1/1])" is an identity transform. Elements are printed in row major order.

Returns
String string representation of color space transform

Hooray!