public class ScriptIntrinsicHistogram
extends ScriptIntrinsic
| java.lang.Object | ||||
| android.support.v8.renderscript.BaseObj | ||||
| android.support.v8.renderscript.Script | ||||
| android.support.v8.renderscript.ScriptIntrinsic | ||||
| android.support.v8.renderscript.ScriptIntrinsicHistogram | ||||
内在直方图过滤器。
Protected constructors |
|
|---|---|
ScriptIntrinsicHistogram(long id, RenderScript rs) |
|
公共方法(Public methods) |
|
|---|---|
static ScriptIntrinsicHistogram |
create(RenderScript rs, Element e) 创建一个用于计算uchar或uchar4图像直方图的内部函数。 |
void |
forEach(Allocation ain, Script.LaunchOptions opt) 处理输入缓冲区并将直方图放入输出分配中。 |
void |
forEach(Allocation ain) 处理输入缓冲区并将直方图放入输出分配中。 |
void |
forEach_Dot(Allocation ain, Script.LaunchOptions opt) 处理输入缓冲区并将直方图放入输出分配中。 |
void |
forEach_Dot(Allocation ain) 处理输入缓冲区并将直方图放入输出分配中。 |
Script.FieldID |
getFieldID_Input() 获取此内在的输入字段的FieldID。 |
Script.KernelID |
getKernelID_Separate() 为此内核获取KernelID。 |
void |
setDotCoefficients(float r, float g, float b, float a) 将用于RGBA的系数设置为Luminocity计算。 |
void |
setOutput(Allocation aout) 设置直方图的输出。 |
继承方法(Inherited methods) |
|
|---|---|
android.support.v8.renderscript.Script
|
|
android.support.v8.renderscript.BaseObj
|
|
java.lang.Object
|
|
ScriptIntrinsicHistogram (long id,
RenderScript rs)
| 参数(Parameters) | |
|---|---|
id |
long
|
rs |
RenderScript
|
ScriptIntrinsicHistogram create (RenderScript rs, Element e)
创建一个用于计算uchar或uchar4图像直方图的内部函数。 支持的元素类型是U8_4(RenderScript) , U8_3(RenderScript) , U8_2(RenderScript) , U8(RenderScript)
| 参数(Parameters) | |
|---|---|
rs |
RenderScript: The RenderScript context |
e |
Element: Element type for inputs |
| 返回(Returns) | |
|---|---|
ScriptIntrinsicHistogram |
ScriptIntrinsicHistogram |
void forEach (Allocation ain, Script.LaunchOptions opt)
处理输入缓冲区并将直方图放入输出分配中。 输出分配可以是比输入更窄的矢量大小。 在这种情况下,输出的矢量大小用于确定在计算中使用了多少个输入通道。 如果您有RGBA输入缓冲区,但只需要RGB的直方图,则此功能非常有用。 支持1D和2D输入分配。
| 参数(Parameters) | |
|---|---|
ain |
Allocation: The input image |
opt |
Script.LaunchOptions: LaunchOptions for clipping |
void forEach (Allocation ain)
处理输入缓冲区并将直方图放入输出分配中。 输出分配可以是比输入更窄的矢量大小。 在这种情况下,输出的矢量大小用于确定在计算中使用了多少个输入通道。 如果您有RGBA输入缓冲区,但只需要RGB的直方图,则此功能非常有用。 支持1D和2D输入分配。
| 参数(Parameters) | |
|---|---|
ain |
Allocation: The input image |
void forEach_Dot (Allocation ain, Script.LaunchOptions opt)
处理输入缓冲区并将直方图放入输出分配中。 输入通道的点积和'setDotCoefficients'中的系数用于计算输出值。 支持1D和2D输入分配。
| 参数(Parameters) | |
|---|---|
ain |
Allocation: The input image |
opt |
Script.LaunchOptions: LaunchOptions for clipping |
void forEach_Dot (Allocation ain)
处理输入缓冲区并将直方图放入输出分配中。 输入通道的点积和'setDotCoefficients'中的系数用于计算输出值。 支持1D和2D输入分配。
| 参数(Parameters) | |
|---|---|
ain |
Allocation: The input image |
Script.FieldID getFieldID_Input ()
获取此内在的输入字段的FieldID。
| 返回(Returns) | |
|---|---|
Script.FieldID |
Script.FieldID The FieldID object. |
Script.KernelID getKernelID_Separate ()
为此内核获取KernelID。
| 返回(Returns) | |
|---|---|
Script.KernelID |
Script.KernelID The KernelID object. |
void setDotCoefficients (float r,
float g,
float b,
float a)
将用于RGBA的系数设置为Luminocity计算。 默认值是{0.299f,0.587f,0.114f,0.f}。 系数必须> = 0并且总和为1.0或更小。
| 参数(Parameters) | |
|---|---|
r |
float: Red coefficient |
g |
float: Green coefficient |
b |
float: Blue coefficient |
a |
float: Alpha coefficient |
void setOutput (Allocation aout)
设置直方图的输出。 支持32位整数类型。
| 参数(Parameters) | |
|---|---|
aout |
Allocation: The output allocation |