Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Constants](https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#constants) \| [Ctors](https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#pubctors) \| [Methods](https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#inhmethods)

# RggbChannelVector

*** ** * ** ***


`
public

final

class
RggbChannelVector
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.hardware.camera2.params.RggbChannelVector |

<br />

*** ** * ** ***

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

## Summary

| ### Constants ||
|---|---|
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#BLUE` Blue color channel in a bayer Raw pattern. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#COUNT` The number of color channels in this vector. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#GREEN_EVEN` Green color channel in a bayer Raw pattern used by the even rows. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#GREEN_ODD` Green color channel in a bayer Raw pattern used by the odd rows. |
| `int` | `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#RED` Red color channel in a bayer Raw pattern. |

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#RggbChannelVector(float,%20float,%20float,%20float)(float red, float greenEven, float greenOdd, float blue) ` Create a new `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector` from an RGGB 2x2 pixel. |

| ### Public methods ||
|---|---|
| ` void` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#copyTo(float[],%20int)(float[] destination, int offset) ` Copy the vector into the destination in the order `[R, Geven, Godd, B]`. |
| ` boolean` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Check if this `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector` is equal to another `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector`. |
| ` float` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#getBlue()() ` Get the blue component. |
| ` float` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#getComponent(int)(int colorChannel) ` Get the component by the color channel index. |
| ` float` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#getGreenEven()() ` Get the green (even rows) component. |
| ` float` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#getGreenOdd()() ` Get the green (odd rows) component. |
| ` float` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#getRed()() ` Get the red component. |
| ` int` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#toString()() ` Return the RggbChannelVector as a string representation. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` https://developer.android.com/reference/java/lang/Object#finalize()() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object. | | ` final https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#wait()() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||

## Constants

### BLUE

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int BLUE
```

Blue color channel in a bayer Raw pattern.

<br />

Constant Value:

3
(0x00000003)


### COUNT

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int COUNT
```

The number of color channels in this vector.

<br />

Constant Value:

4
(0x00000004)


### GREEN_EVEN

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int GREEN_EVEN
```

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

<br />

Constant Value:

1
(0x00000001)


### GREEN_ODD

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int GREEN_ODD
```

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

<br />

Constant Value:

2
(0x00000002)


### RED

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static final int RED
```

Red color channel in a bayer Raw pattern.

<br />

Constant Value:

0
(0x00000000)


## Public constructors

### RggbChannelVector

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

Create a new `https://developer.android.com/reference/android/hardware/camera2/params/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.

<br />

<br />

| Parameters ||
|---|---|
| `red` | `float`: red pixel <br /> |
| `greenEven` | `float`: green pixel (even row) <br /> |
| `greenOdd` | `float`: green pixel (odd row) <br /> |
| `blue` | `float`: blue pixel <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if any of the arguments were not finite |

## Public methods

### copyTo

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

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

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

<br />

| Parameters ||
|---|---|
| `destination` | `float`: an array big enough to hold at least `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#COUNT` elements after the `offset` <br /> |
| `offset` | `int`: a non-negative offset into the array <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ArrayIndexOutOfBoundsException` | If there's not enough room to write the elements at the specified destination and offset. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | If `destination` was `null` |

### equals

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public boolean equals (Object obj)
```

Check if this `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector` is equal to another `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector`.

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

<br />

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if the objects were equal, `false` otherwise <br /> |

### getBlue

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getBlue ()
```

Get the blue component.

<br />

| Returns ||
|---|---|
| `float` | a floating point value (guaranteed to be finite) <br /> |

### getComponent

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getComponent (int colorChannel)
```

Get the component by the color channel index.

`colorChannel` must be one of `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#RED`, `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#GREEN_EVEN`, `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#GREEN_ODD`,
`https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#BLUE`.

<br />

<br />

| Parameters ||
|---|---|
| `colorChannel` | `int`: greater or equal to `0` and less than `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector#COUNT` <br /> |

| Returns ||
|---|---|
| `float` | a floating point value (guaranteed to be finite) <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/IllegalArgumentException` | if `colorChannel` was out of range |

### getGreenEven

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getGreenEven ()
```

Get the green (even rows) component.

<br />

| Returns ||
|---|---|
| `float` | a floating point value (guaranteed to be finite) <br /> |

### getGreenOdd

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getGreenOdd ()
```

Get the green (odd rows) component.

<br />

| Returns ||
|---|---|
| `float` | a floating point value (guaranteed to be finite) <br /> |

### getRed

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public float getRed ()
```

Get the red component.

<br />

| Returns ||
|---|---|
| `float` | a floating point value (guaranteed to be finite) <br /> |

### hashCode

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
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
`https://developer.android.com/reference/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 `https://developer.android.com/reference/java/lang/Object#equals(java.lang.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 `https://developer.android.com/reference/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.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### toString

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public String toString ()
```

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.

<br />

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | string representation of `https://developer.android.com/reference/android/hardware/camera2/params/RggbChannelVector` <br /> |