Most visited

Recently visited

Added in API level 21

RggbChannelVector

public final class RggbChannelVector
extends Object

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


不可变的类,用于存储浮点数的4元素矢量,可以通过bayer RAW 2x2像素块进行索引。

Summary

Constants

int BLUE

拜耳的蓝色通道原始模式。

int COUNT

此向量中的颜色通道数。

int GREEN_EVEN

拜耳中的绿色通道偶数行使用的原始模式。

int GREEN_ODD

拜耳中的绿色通道奇数行使用的原始模式。

int RED

拜耳中的红色通道原始模式。

Public constructors

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

从RGGB 2x2像素创建一个新的 RggbChannelVector

Public methods

void copyTo(float[] destination, int offset)

按照 [R, Geven, Godd, B]的顺序将矢量复制到目标中。

boolean equals(Object obj)

检查这 RggbChannelVector是否等于另一个 RggbChannelVector

float getBlue()

获取蓝色组件。

float getComponent(int colorChannel)

通过颜色通道索引获取组件。

float getGreenEven()

获取绿色(偶数行)组件。

float getGreenOdd()

获取绿色(奇数行)组件。

final float getRed()

获取红色组件。

int hashCode()

返回对象的哈希码值。

String toString()

以字符串表示形式返回RggbChannelVector。

Inherited methods

From class java.lang.Object

Constants

BLUE

Added in API level 21
int BLUE

拜耳的蓝色通道原始模式。

常量值:3(0x00000003)

COUNT

Added in API level 21
int COUNT

此向量中的颜色通道数。

常量值:4(0x00000004)

GREEN_EVEN

Added in API level 21
int GREEN_EVEN

拜耳中的绿色通道偶数行使用的原始模式。

常数值:1(0x00000001)

GREEN_ODD

Added in API level 21
int GREEN_ODD

拜耳中的绿色通道奇数行使用的原始模式。

常量值:2(0x00000002)

RED

Added in API level 21
int RED

拜耳中的红色通道原始模式。

常量值:0(0x00000000)

Public constructors

RggbChannelVector

Added in API level 21
RggbChannelVector (float red, 
                float greenEven, 
                float greenOdd, 
                float blue)

从RGGB 2x2像素创建一个新的 RggbChannelVector

所有像素值被内考虑归一化 [0.0f, 1.0f] (即 1.0f可以被线性化,以 255如果转换到非浮点像素表示)。

所有论据必须是有限的; NaN和无限是不允许的。

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

Public methods

copyTo

Added in API level 21
void copyTo (float[] destination, 
                int offset)

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

equals

Added in API level 21
boolean equals (Object obj)

检查这 RggbChannelVector是否等于另一个 RggbChannelVector

两个向量只有当且仅当每个相应元素相等时才相等。

Parameters
obj Object: the reference object with which to compare.
Returns
boolean true if the objects were equal, false otherwise

getBlue

Added in API level 21
float getBlue ()

获取蓝色组件。

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

getComponent

Added in API level 21
float getComponent (int colorChannel)

通过颜色通道索引获取组件。

colorChannel必须是一个 REDGREEN_EVENGREEN_ODDBLUE

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

getGreenEven

Added in API level 21
float getGreenEven ()

获取绿色(偶数行)组件。

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

getGreenOdd

Added in API level 21
float getGreenOdd ()

获取绿色(奇数行)组件。

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

getRed

Added in API level 21
float getRed ()

获取红色组件。

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

hashCode

Added in API level 21
int hashCode ()

返回对象的哈希码值。 为了散列表的好处而支持此方法,例如由HashMap提供的HashMap

hashCode的总合同是:

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

尽可能合理实用,由类Object定义的hashCode方法确实为不同的对象返回不同的整数。 (这通常通过将对象的内部地址转换为整数来实现,但Java TM编程语言不需要此实现技术。)

Returns
int a hash code value for this object.

toString

Added in API level 21
String toString ()

以字符串表示形式返回RggbChannelVector。

"RggbChannelVector{R:%f, G_even:%f, G_odd:%f, B:%f}" ,其中每个 %f分别代表四个颜色通道中的一个。

Returns
String string representation of RggbChannelVector

Hooray!