Android APIs
public final class

RggbChannelVector

extends Object
java.lang.Object
   ↳ android.hardware.camera2.params.RggbChannelVector

Class Overview

Immutable class to store a 4-element vector of floats indexable by a bayer RAW 2x2 pixel block.

Summary

Constants
int BLUE Blue color channel in a bayer Raw pattern.
int COUNT The number of color channels in this vector.
int GREEN_EVEN Green color channel in a bayer Raw pattern used by the even rows.
int GREEN_ODD Green color channel in a bayer Raw pattern used by the odd rows.
int RED Red color channel in a bayer Raw pattern.
Public Constructors
RggbChannelVector(float red, float greenEven, float greenOdd, float blue)
Create a new RggbChannelVector from an RGGB 2x2 pixel.
Public Methods
void copyTo(float[] destination, int offset)
Copy the vector into the destination in the order [R, Geven, Godd, B].
boolean equals(Object obj)
Check if this RggbChannelVector is equal to another RggbChannelVector.
float getBlue()
Get the blue component.
float getComponent(int colorChannel)
Get the component by the color channel index.
float getGreenEven()
Get the green (even rows) component.
float getGreenOdd()
Get the green (odd rows) component.
final float getRed()
Get the red component.
int hashCode()
Returns an integer hash code for this object.
String toString()
Return the RggbChannelVector as a string representation.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final int BLUE

Added in API level 21

Blue color channel in a bayer Raw pattern.

Constant Value: 3 (0x00000003)

public static final int COUNT

Added in API level 21

The number of color channels in this vector.

Constant Value: 4 (0x00000004)

public static final int GREEN_EVEN

Added in API level 21

Green color channel in a bayer Raw pattern used by the even rows.

Constant Value: 1 (0x00000001)

public static final int GREEN_ODD

Added in API level 21

Green color channel in a bayer Raw pattern used by the odd rows.

Constant Value: 2 (0x00000002)

public static final int RED

Added in API level 21

Red color channel in a bayer Raw pattern.

Constant Value: 0 (0x00000000)

Public Constructors

public RggbChannelVector (float red, float greenEven, float greenOdd, float blue)

Added in API level 21

Create a new RggbChannelVector from an RGGB 2x2 pixel.

All pixel values are considered normalized within [0.0f, 1.0f] (i.e. 1.0f could be linearized to 255 if converting to a non-floating point pixel representation).

All arguments must be finite; NaN and infinity is not allowed.

Parameters
red red pixel
greenEven green pixel (even row)
greenOdd green pixel (odd row)
blue blue pixel
Throws
IllegalArgumentException if any of the arguments were not finite

Public Methods

public void copyTo (float[] destination, int offset)

Added in API level 21

Copy the vector into the destination in the order [R, Geven, Godd, B].

Parameters
destination an array big enough to hold at least .COUNT elements after the offset
offset 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.

public boolean equals (Object obj)

Added in API level 21

Check if this RggbChannelVector is equal to another RggbChannelVector.

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

Parameters
obj the object to compare this instance with.
Returns
  • true if the objects were equal, false otherwise

public float getBlue ()

Added in API level 21

Get the blue component.

Returns
  • a floating point value (guaranteed to be finite)

public float getComponent (int colorChannel)

Added in API level 21

Get the component by the color channel index.

colorChannel must be one of RED, GREEN_EVEN, GREEN_ODD, BLUE.

Parameters
colorChannel greater or equal to 0 and less than COUNT
Returns
  • a floating point value (guaranteed to be finite)
Throws
IllegalArgumentException if colorChannel was out of range

public float getGreenEven ()

Added in API level 21

Get the green (even rows) component.

Returns
  • a floating point value (guaranteed to be finite)

public float getGreenOdd ()

Added in API level 21

Get the green (odd rows) component.

Returns
  • a floating point value (guaranteed to be finite)

public final float getRed ()

Added in API level 21

Get the red component.

Returns
  • a floating point value (guaranteed to be finite)

public int hashCode ()

Added in API level 21

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.

Returns
  • this object's hash code.

public String toString ()

Added in API level 21

Return the RggbChannelVector as a string representation.

"RggbChannelVector{R:%f, G_even:%f, G_odd:%f, B:%f"}, where each %f respectively represents one of the the four color channels.

Returns