Public Member Functions | Static Public Member Functions
android::RSC::ScriptIntrinsicHistogram Class Reference

#include <rsCppStructs.h>

Inheritance diagram for android::RSC::ScriptIntrinsicHistogram:
android::RSC::ScriptIntrinsic android::RSC::Script android::RSC::BaseObj

Public Member Functions

void setOutput (sp< Allocation > aout)
void setDotCoefficients (float r, float g, float b, float a)
void forEach (sp< Allocation > ain)
void forEach_dot (sp< Allocation > ain)

Static Public Member Functions

static sp
< ScriptIntrinsicHistogram
create (sp< RS > rs)

Detailed Description

Intrinsic for computing a histogram.

Definition at line 1699 of file rsCppStructs.h.


Member Function Documentation

static sp<ScriptIntrinsicHistogram> android::RSC::ScriptIntrinsicHistogram::create ( sp< RS rs) [static]

Create an intrinsic for calculating the histogram of an uchar or uchar4 image.

Supported elements types are U8_4, U8_3, U8_2, and U8.

Parameters:
[in]rsThe RenderScript context
[in]eElement type for inputs
Returns:
ScriptIntrinsicHistogram
void android::RSC::ScriptIntrinsicHistogram::forEach ( sp< 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:
[in]ainThe input image
void android::RSC::ScriptIntrinsicHistogram::forEach_dot ( sp< 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:
ainThe input image
void android::RSC::ScriptIntrinsicHistogram::setDotCoefficients ( float  r,
float  g,
float  b,
float  a 
)

Set the coefficients used for the dot product calculation. The default is {0.299f, 0.587f, 0.114f, 0.f}.

Coefficients must be >= 0 and sum to 1.0 or less.

Parameters:
[in]rRed coefficient
[in]gGreen coefficient
[in]bBlue coefficient
[in]aAlpha coefficient
void android::RSC::ScriptIntrinsicHistogram::setOutput ( sp< Allocation aout)

Set the output of the histogram. 32 bit integer types are supported.

Parameters:
[in]aoutThe output allocation

The documentation for this class was generated from the following file: