BlackLevelPattern

public final class BlackLevelPattern
extends Object

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


Immutable class to store a 4-element vector of integers corresponding to a 2x2 pattern of color channel offsets used for the black level offsets of each color channel.

Summary

Constants

int COUNT

The number of offsets in this vector.

Public methods

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.

Inherited methods

Constants

COUNT

added in API level 21
public static final int COUNT

The number of offsets in this vector.

Constant Value: 4 (0x00000004)

Public methods

copyTo

added in API level 21
public void copyTo (int[] destination, 
                int offset)

Copy the ColorChannel offsets into the destination vector.

Offsets are given in row-column scan order for a given 2x2 color pattern.

Parameters
destination int: an array big enough to hold at least .COUNT elements after the offset

offset int: a non-negative offset into the array

Throws
IllegalArgumentException if the offset is invalid.
ArrayIndexOutOfBoundsException if the destination vector is too small.
NullPointerException if the destination is null.

equals

added in API level 21
public boolean equals (Object obj)

Check if this BlackLevelPattern is equal to another BlackLevelPattern.

Two vectors are only equal if and only if each of the respective elements is equal.

Parameters
obj Object: the reference object with which to compare.

Returns
boolean true if the objects were equal, false otherwise

getOffsetForIndex

added in API level 21
public int getOffsetForIndex (int column, 
                int row)

Return the color channel offset for a given index into the array of raw pixel values.

Parameters
column int: the column index in the the raw pixel array.

row int: the row index in the raw pixel array.

Returns
int a color channel offset.

Throws
IllegalArgumentException if a column or row given is negative.

hashCode

added in API level 21
public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

  • 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.

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 Java™ programming language.)

Returns
int a hash code value for this object.

toString

added in API level 21
public String toString ()

Return this 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).

Returns
String string representation of BlackLevelPattern