public
final
class
RggbChannelVector
extends Object
java.lang.Object | |
↳ | android.hardware.camera2.params.RggbChannelVector |
Immutable class to store a 4-element vector of floats indexable by a bayer RAW 2x2 pixel block.
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 |
Public methods | |
---|---|
void
|
copyTo(float[] destination, int offset)
Copy the vector into the destination in the order |
boolean
|
equals(Object obj)
Check if this |
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 a hash code value for the object. |
String
|
toString()
Return the RggbChannelVector as a string representation. |
Inherited methods | |
---|---|
From
class
java.lang.Object
|
int BLUE
Blue color channel in a bayer Raw pattern.
Constant Value: 3 (0x00000003)
int COUNT
The number of color channels in this vector.
Constant Value: 4 (0x00000004)
int GREEN_EVEN
Green color channel in a bayer Raw pattern used by the even rows.
Constant Value: 1 (0x00000001)
int GREEN_ODD
Green color channel in a bayer Raw pattern used by the odd rows.
Constant Value: 2 (0x00000002)
int RED
Red color channel in a bayer Raw pattern.
Constant Value: 0 (0x00000000)
RggbChannelVector (float red, float greenEven, float greenOdd, float blue)
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 |
Throws | |
---|---|
IllegalArgumentException |
if any of the arguments were not finite |
void copyTo (float[] destination, int offset)
Copy the vector into the destination in the order [R, Geven, Godd, B]
.
Parameters | |
---|---|
destination |
float :
an array big enough to hold at least .COUNT elements after the
offset |
offset |
int :
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. |
boolean equals (Object obj)
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 |
Object :
the reference object with which to compare. |
Returns | |
---|---|
boolean |
true if the objects were equal, false otherwise
|
float getBlue ()
Get the blue component.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
float getComponent (int colorChannel)
Get the component by the color channel index.
colorChannel
must be one of RED
, GREEN_EVEN
, GREEN_ODD
,
BLUE
.
Parameters | |
---|---|
colorChannel |
int :
greater or equal to 0 and less than COUNT |
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
Throws | |
---|---|
IllegalArgumentException |
if colorChannel was out of range
|
float getGreenEven ()
Get the green (even rows) component.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
float getGreenOdd ()
Get the green (odd rows) component.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
float getRed ()
Get the red component.
Returns | |
---|---|
float |
a floating point value (guaranteed to be finite) |
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:
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.
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.)
Returns | |
---|---|
int |
a hash code value for this object. |
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.
Returns | |
---|---|
String |
string representation of RggbChannelVector
|