| java.lang.Object | |
| ↳ | android.hardware.camera2.params.ColorSpaceTransform |
Immutable class for describing a 3x3 matrix of Rational values in row-major order.
This matrix maps a transform from one color space to another. For the particular color space source and target, see the appropriate camera metadata documentation for the key that provides this value.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Create a new immutable
ColorSpaceTransform instance from a Rational array. | |||||||||||
Create a new immutable
ColorSpaceTransform instance from an int array. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Copy the
Rational elements in row-major order from this matrix into the destination. | |||||||||||
Copy the
Rational elements in row-major order from this matrix into the destination. | |||||||||||
Check if this
ColorSpaceTransform is equal to another ColorSpaceTransform. | |||||||||||
Get an element of this matrix by its row and column.
| |||||||||||
Returns an integer hash code for this object.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a new immutable ColorSpaceTransform instance from a Rational array.
The elements must be stored in a row-major order.
| elements | An array of 9 elements |
|---|
| IllegalArgumentException | if the count of elements is not 9 |
|---|---|
| NullPointerException | if elements or any sub-element is null
|
Create a new immutable ColorSpaceTransform instance from an int array.
The elements must be stored in a row-major order. Each rational is stored
contiguously as a (numerator, denominator) pair.
In particular:
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.| elements | An array of 18 elements |
|---|
| IllegalArgumentException | if the count of elements is not 18 |
|---|---|
| NullPointerException | if elements is null
|
Copy the Rational elements in row-major order from this matrix into the destination.
| destination | an array big enough to hold at least 9 elements after the
offset |
|---|---|
| offset | a non-negative offset into the array |
| NullPointerException | If destination was null |
|---|---|
| ArrayIndexOutOfBoundsException | If there's not enough room to write the elements at the specified destination and offset. |
Copy the Rational elements in row-major order from this matrix into the destination.
Each element is stored as a contiguous rational packed as a
(numerator, denominator) pair of ints, identical to the
constructor.
| destination | an array big enough to hold at least 18 elements after the
offset |
|---|---|
| offset | a non-negative offset into the array |
| NullPointerException | If destination was null |
|---|---|
| ArrayIndexOutOfBoundsException | If there's not enough room to write the elements at the specified destination and offset. |
Check if this ColorSpaceTransform is equal to another ColorSpaceTransform.
Two color space transforms are equal if and only if all of their elements are
equal.
| obj | the object to compare this instance with. |
|---|
true if the objects were equal, false otherwise
Get an element of this matrix by its row and column.
The rows must be within the range [0, 3), and the column must be within the range [0, 3).
null)| IllegalArgumentException | if column or row was out of range |
|---|
Returns an integer hash code for this object. By contract, any two
objects for which equals(Object) returns true must return
the same hash code value. This means that subclasses of Object
usually override both methods or neither method.
Note that hash values must not change over time unless information used in equals comparisons also changes.
See Writing a correct
hashCode method
if you intend implementing your own hashCode method.