public final class BlackLevelPattern extends Object
Modifier and Type | Field and Description |
---|---|
static int |
COUNT
The number of offsets in this vector.
|
Constructor and Description |
---|
BlackLevelPattern(int[] offsets)
Create a new
BlackLevelPattern from a given offset array. |
Modifier and Type | Method and Description |
---|---|
void |
copyTo(int[] destination,
int offset)
Copy the ColorChannel offsets into the destination vector.
|
boolean |
equals(Object obj)
Check if this
BlackLevelPattern is equal to another BlackLevelPattern . |
int |
getOffsetForIndex(int column,
int row)
Return the color channel offset for a given index into the array of raw pixel values.
|
int |
hashCode()
Returns a hash code value for the object.
|
String |
toString()
Return this
BlackLevelPattern as a string representation. |
public static final int COUNT
public BlackLevelPattern(int[] offsets)
BlackLevelPattern
from a given offset array.
The given offset array must contain offsets for each color channel in a 2x2 pattern corresponding to the color filter arrangement. Offsets are given in row-column scan order.
offsets
- an array containing a 2x2 pattern of offsets.IllegalArgumentException
- if the given array has an incorrect length.NullPointerException
- if the given array is null.public int getOffsetForIndex(int column, int row)
column
- the column index in the the raw pixel array.row
- the row index in the raw pixel array.IllegalArgumentException
- if a column or row given is negative.public void copyTo(int[] destination, int offset)
Offsets are given in row-column scan order for a given 2x2 color pattern.
destination
- an array big enough to hold at least 4 elements after the
offset
offset
- a non-negative offset into the arrayIllegalArgumentException
- if the offset is invalid.ArrayIndexOutOfBoundsException
- if the destination vector is too small.NullPointerException
- if the destination is null.public boolean equals(Object obj)
BlackLevelPattern
is equal to another BlackLevelPattern
.
Two vectors are only equal if and only if each of the respective elements is equal.
equals
in class Object
obj
- the reference object with which to compare.true
if the objects were equal, false
otherwiseObject.hashCode()
,
HashMap
public int hashCode()
HashMap
.
The general contract of hashCode
is:
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.
equals(Object)
method, then calling the hashCode
method on each of
the two objects must produce the same integer result.
Object.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.
As much as is reasonably practical, the hashCode method defined by
class Object
does return distinct integers for distinct
objects. (This is typically implemented by converting the internal
address of the object into an integer, but this implementation
technique is not required by the
JavaTM programming language.)
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)
public String toString()
BlackLevelPattern
as a string representation.
"BlackLevelPattern([%d, %d], [%d, %d])"
, where each %d
represents one
black level offset of a color channel. The values are in the same order as channels listed
for the CFA layout key (see
CameraCharacteristics.SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
).
toString
in class Object
BlackLevelPattern
CameraCharacteristics.SENSOR_INFO_COLOR_FILTER_ARRANGEMENT