Class ColorSpaceTransform¶
- java.lang.Object
-
- com.iristick.smartglass.support.camera2.params.ColorSpaceTransform
com.iristick.smartglass.core.camera
package instead.@Deprecated public abstract class ColorSpaceTransform extends Object
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.
- Since:
- Android API level 21
- See Also:
CameraMetadata
Constructor Summary¶
Constructor and Description |
---|
ColorSpaceTransform()
Deprecated.
|
Method Summary¶
Modifier and Type | Method and Description |
---|---|
abstract void |
copyElements(int[] destination,
int offset)
Deprecated.
Copy the
Rational elements in row-major order from this matrix into the destination. |
abstract void |
copyElements(Rational[] destination,
int offset)
Deprecated.
Copy the
Rational elements in row-major order from this matrix into the destination. |
static ColorSpaceTransform |
create(int[] elements)
Deprecated.
Create a new immutable
ColorSpaceTransform instance from an int array. |
static ColorSpaceTransform |
create(Rational[] elements)
Deprecated.
Create a new immutable
ColorSpaceTransform instance from a Rational array. |
abstract boolean |
equals(Object obj)
Deprecated.
Check if this
ColorSpaceTransform is equal to another ColorSpaceTransform . |
abstract Rational |
getElement(int column,
int row)
Deprecated.
Get an element of this matrix by its row and column.
|
abstract String |
toString()
Deprecated.
Return the color space transform as a string representation.
|
Methods inherited from class java.lang.Object¶
getClass, hashCode, notify, notifyAll, wait, wait, wait
Constructor Detail¶
ColorSpaceTransform¶
public ColorSpaceTransform()
Method Detail¶
create¶
public static ColorSpaceTransform create(Rational[] elements)
ColorSpaceTransform
instance from a Rational
array.
The elements must be stored in a row-major order.
- Parameters:
elements
- An array of9
elements- Returns:
- A new
ColorSpaceTransform
instance. - Throws:
IllegalArgumentException
- if the count ofelements
is not9
NullPointerException
- ifelements
or any sub-element isnull
create¶
public static ColorSpaceTransform create(int[] elements)
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
];
ColorSpaceTransform.create(elements)
where Nij
and Dij
is the numerator and denominator for row i
and
column j
.- Parameters:
elements
- An array of18
elements- Returns:
- A new
ColorSpaceTransform
instance. - Throws:
IllegalArgumentException
- if the count ofelements
is not18
NullPointerException
- ifelements
isnull
getElement¶
public abstract Rational getElement(int column, int row)
The rows must be within the range [0, 3), and the column must be within the range [0, 3).
- Parameters:
column
- The column.row
- The row.- Returns:
- element (non-
null
) - Throws:
IllegalArgumentException
- if column or row was out of range
copyElements¶
public abstract void copyElements(Rational[] destination, int offset)
Rational
elements in row-major order from this matrix into the destination.- Parameters:
destination
- an array big enough to hold at least9
elements after theoffset
offset
- a non-negative offset into the array- Throws:
NullPointerException
- Ifdestination
wasnull
ArrayIndexOutOfBoundsException
- If there's not enough room to write the elements at the specified destination and offset.
copyElements¶
public abstract void copyElements(int[] destination, int offset)
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
create(int[])
static construction method.
- Parameters:
destination
- an array big enough to hold at least18
elements after theoffset
offset
- a non-negative offset into the array- Throws:
NullPointerException
- Ifdestination
wasnull
ArrayIndexOutOfBoundsException
- If there's not enough room to write the elements at the specified destination and offset.- See Also:
create(int[])
equals¶
public abstract boolean equals(Object obj)
ColorSpaceTransform
is equal to another ColorSpaceTransform
.
Two color space transforms are equal if and only if all of their elements are
equal
.
toString¶
public abstract 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.