RggbChannelVector

class RggbChannelVector
kotlin.Any
   ↳ android.hardware.camera2.params.RggbChannelVector

Immutable class to store a 4-element vector of floats indexable by a bayer RAW 2x2 pixel block.
Requires API level 21 (Android 5.0, Lollipop)

Summary

Constants
static Int

Blue color channel in a bayer Raw pattern.

static Int

The number of color channels in this vector.

static Int

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

static Int

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

static Int

Red color channel in a bayer Raw pattern.

Public constructors
<init>(red: Float, greenEven: Float, greenOdd: Float, blue: Float)

Create a new RggbChannelVector from an RGGB 2x2 pixel.

Public methods
Float

Get the green (odd rows) component.

Float

Get the red component.

Int

Returns a hash code value for the object.

Float

Get the green (even rows) component.

Float

Get the blue component.

Unit
copyTo(destination: FloatArray!, offset: Int)

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

Boolean
equals(other: Any?)

Check if this RggbChannelVector is equal to another RggbChannelVector.

String

Return the RggbChannelVector as a string representation.

Float
getComponent(colorChannel: Int)

Get the component by the color channel index.

Constants

BLUE

added in API level 21
static val BLUE: Int

Blue color channel in a bayer Raw pattern.
Requires API level 21 (Android 5.0, Lollipop)

Value: 3

COUNT

added in API level 21
static val COUNT: Int

The number of color channels in this vector.
Requires API level 21 (Android 5.0, Lollipop)

Value: 4

GREEN_EVEN

added in API level 21
static val GREEN_EVEN: Int

Green color channel in a bayer Raw pattern used by the even rows.
Requires API level 21 (Android 5.0, Lollipop)

Value: 1

GREEN_ODD

added in API level 21
static val GREEN_ODD: Int

Green color channel in a bayer Raw pattern used by the odd rows.
Requires API level 21 (Android 5.0, Lollipop)

Value: 2

RED

added in API level 21
static val RED: Int

Red color channel in a bayer Raw pattern.
Requires API level 21 (Android 5.0, Lollipop)

Value: 0

Public constructors

<init>

RggbChannelVector(red: Float, greenEven: Float, greenOdd: Float, blue: Float)

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 Float: red pixel
greenEven Float: green pixel (even row)
greenOdd Float: green pixel (odd row)
blue Float: blue pixel
Exceptions
IllegalArgumentException if any of the arguments were not finite

Public methods

getGreenOdd

added in API level 21
fun getGreenOdd(): Float

Get the green (odd rows) component.
Requires API level 21 (Android 5.0, Lollipop)

Return
Float: a floating point value (guaranteed to be finite)

getRed

added in API level 21
fun getRed(): Float

Get the red component.
Requires API level 21 (Android 5.0, Lollipop)

Return
Float: a floating point value (guaranteed to be finite)

hashCode

added in API level 21
fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.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 java.lang.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 Java™ programming language.)
Requires API level 21 (Android 5.0, Lollipop)

Return
Int: a hash code value for this object.

getGreenEven

added in API level 21
fun getGreenEven(): Float

Get the green (even rows) component.
Requires API level 21 (Android 5.0, Lollipop)

Return
Float: a floating point value (guaranteed to be finite)

getBlue

added in API level 21
fun getBlue(): Float

Get the blue component.
Requires API level 21 (Android 5.0, Lollipop)

Return
Float: a floating point value (guaranteed to be finite)

copyTo

added in API level 21
fun copyTo(destination: FloatArray!, offset: Int): Unit

Copy the vector into the destination in the order [R, Geven, Godd, B].
Requires API level 21 (Android 5.0, Lollipop)

Parameters
destination FloatArray!: an array big enough to hold at least {@value #COUNT} elements after the offset
offset FloatArray!: a non-negative offset into the array
Exceptions
NullPointerException If destination was null
ArrayIndexOutOfBoundsException If there's not enough room to write the elements at the specified destination and offset.

equals

added in API level 21
fun equals(other: Any?): Boolean

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.


Requires API level 21 (Android 5.0, Lollipop)
Parameters
obj Any?: the reference object with which to compare.
Return
Boolean: true if the objects were equal, false otherwise

toString

added in API level 21
fun toString(): String

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.


Requires API level 21 (Android 5.0, Lollipop)
Return
String: string representation of RggbChannelVector

getComponent

added in API level 21
fun getComponent(colorChannel: Int): Float

Get the component by the color channel index.

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


Requires API level 21 (Android 5.0, Lollipop)
Parameters
colorChannel Int: greater or equal to 0 and less than #COUNT
Return
Float: a floating point value (guaranteed to be finite)
Exceptions
IllegalArgumentException if colorChannel was out of range