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 |
Intrinsic Histogram filter.
Protected constructors | |
---|---|
ScriptIntrinsicHistogram(long id, RenderScript rs)
|
Public methods | |
---|---|
static
ScriptIntrinsicHistogram
|
create(RenderScript rs, Element e)
Create an intrinsic for calculating the histogram of an uchar or uchar4 image. |
void
|
forEach(Allocation ain, Script.LaunchOptions opt)
Process an input buffer and place the histogram into the output allocation. |
void
|
forEach(Allocation ain)
Process an input buffer and place the histogram into the output allocation. |
void
|
forEach_Dot(Allocation ain, Script.LaunchOptions opt)
Process an input buffer and place the histogram into the output allocation. |
void
|
forEach_Dot(Allocation ain)
Process an input buffer and place the histogram into the output allocation. |
Script.FieldID
|
getFieldID_Input()
Get a FieldID for the input field of this intrinsic. |
Script.KernelID
|
getKernelID_Separate()
Get a KernelID for this intrinsic kernel. |
void
|
setDotCoefficients(float r, float g, float b, float a)
Set the coefficients used for the RGBA to Luminocity calculation. |
void
|
setOutput(Allocation aout)
Set the output of the histogram. |
Inherited methods | |
---|---|
From
class
android.support.v8.renderscript.Script
| |
From
class
android.support.v8.renderscript.BaseObj
| |
From
class
java.lang.Object
|
ScriptIntrinsicHistogram (long id, RenderScript rs)
Parameters | |
---|---|
id |
long
|
rs |
RenderScript
|
ScriptIntrinsicHistogram create (RenderScript rs, Element e)
Create an intrinsic for calculating the histogram of an uchar
or uchar4 image.
Supported elements types are
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)
Process an input buffer and place the histogram into the output allocation. The output allocation may be a narrower vector size than the input. In this case the vector size of the output is used to determine how many of the input channels are used in the computation. This is useful if you have an RGBA input buffer but only want the histogram for RGB. 1D and 2D input allocations are supported.
Parameters | |
---|---|
ain |
Allocation :
The input image |
opt |
Script.LaunchOptions :
LaunchOptions for clipping
|
void forEach (Allocation ain)
Process an input buffer and place the histogram into the output allocation. The output allocation may be a narrower vector size than the input. In this case the vector size of the output is used to determine how many of the input channels are used in the computation. This is useful if you have an RGBA input buffer but only want the histogram for RGB. 1D and 2D input allocations are supported.
Parameters | |
---|---|
ain |
Allocation :
The input image
|
void forEach_Dot (Allocation ain, Script.LaunchOptions opt)
Process an input buffer and place the histogram into the output allocation. The dot product of the input channel and the coefficients from 'setDotCoefficients' are used to calculate the output values. 1D and 2D input allocations are supported.
Parameters | |
---|---|
ain |
Allocation :
The input image |
opt |
Script.LaunchOptions :
LaunchOptions for clipping
|
void forEach_Dot (Allocation ain)
Process an input buffer and place the histogram into the output allocation. The dot product of the input channel and the coefficients from 'setDotCoefficients' are used to calculate the output values. 1D and 2D input allocations are supported.
Parameters | |
---|---|
ain |
Allocation :
The input image
|
Script.FieldID getFieldID_Input ()
Get a FieldID for the input field of this intrinsic.
Returns | |
---|---|
Script.FieldID |
Script.FieldID The FieldID object. |
Script.KernelID getKernelID_Separate ()
Get a KernelID for this intrinsic kernel.
Returns | |
---|---|
Script.KernelID |
Script.KernelID The KernelID object. |
void setDotCoefficients (float r, float g, float b, float a)
Set the coefficients used for the RGBA to Luminocity calculation. The default is {0.299f, 0.587f, 0.114f, 0.f}. Coefficients must be >= 0 and sum to 1.0 or less.
Parameters | |
---|---|
r |
float :
Red coefficient |
g |
float :
Green coefficient |
b |
float :
Blue coefficient |
a |
float :
Alpha coefficient
|
void setOutput (Allocation aout)
Set the output of the histogram. 32 bit integer types are supported.
Parameters | |
---|---|
aout |
Allocation :
The output allocation
|