Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#inhmethods)

# ScriptIntrinsicHistogram

*** ** * ** ***

` public final class ScriptIntrinsicHistogram `   
` ` ` ` ` ` ` extends https://developer.android.com/reference/android/renderscript/ScriptIntrinsic ` ` `

|---|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) |||||
| ↳ | [android.renderscript.BaseObj](https://developer.android.com/reference/android/renderscript/BaseObj) ||||
|   | ↳ | [android.renderscript.Script](https://developer.android.com/reference/android/renderscript/Script) |||
|   |   | ↳ | [android.renderscript.ScriptIntrinsic](https://developer.android.com/reference/android/renderscript/ScriptIntrinsic) ||
|   |   |   | ↳ | android.renderscript.ScriptIntrinsicHistogram |

<br />

*** ** * ** ***

<br />

**This class was deprecated in API level 31.**   

Renderscript has been deprecated in API level 31. Please refer to the [migration guide](https://developer.android.com/guide/topics/renderscript/migration-guide) for the proposed alternatives.

Intrinsic Histogram filter.

## Summary

| ### Public methods ||
|---|---|
| ` static https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#create(android.renderscript.RenderScript,%20android.renderscript.Element)(https://developer.android.com/reference/android/renderscript/RenderScript rs, https://developer.android.com/reference/android/renderscript/Element e) ` Create an intrinsic for calculating the histogram of an uchar or uchar4 image. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#forEach(android.renderscript.Allocation)(https://developer.android.com/reference/android/renderscript/Allocation ain) ` Process an input buffer and place the histogram into the output allocation. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#forEach(android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions)(https://developer.android.com/reference/android/renderscript/Allocation ain, https://developer.android.com/reference/android/renderscript/Script.LaunchOptions opt) ` Process an input buffer and place the histogram into the output allocation. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#forEach_Dot(android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions)(https://developer.android.com/reference/android/renderscript/Allocation ain, https://developer.android.com/reference/android/renderscript/Script.LaunchOptions opt) ` Process an input buffer and place the histogram into the output allocation. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#forEach_Dot(android.renderscript.Allocation)(https://developer.android.com/reference/android/renderscript/Allocation ain) ` Process an input buffer and place the histogram into the output allocation. |
| ` https://developer.android.com/reference/android/renderscript/Script.FieldID` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#getFieldID_Input()() ` Get a FieldID for the input field of this intrinsic. |
| ` https://developer.android.com/reference/android/renderscript/Script.KernelID` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#getKernelID_Separate()() ` Get a KernelID for this intrinsic kernel. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#setDotCoefficients(float,%20float,%20float,%20float)(float r, float g, float b, float a) ` Set the coefficients used for the RGBA to Luminocity calculation. |
| ` void` | ` https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram#setOutput(android.renderscript.Allocation)(https://developer.android.com/reference/android/renderscript/Allocation aout) ` Set the output of the histogram. |

### Inherited methods

From class ` https://developer.android.com/reference/android/renderscript/Script ` ` void` ` https://developer.android.com/reference/android/renderscript/Script#bindAllocation(android.renderscript.Allocation,%20int)(https://developer.android.com/reference/android/renderscript/Allocation va, int slot) `

Only intended for use by generated reflected code.
` https://developer.android.com/reference/android/renderscript/Script.FieldID` ` https://developer.android.com/reference/android/renderscript/Script#createFieldID(int,%20android.renderscript.Element)(int slot, https://developer.android.com/reference/android/renderscript/Element e) `

Only to be used by generated reflected classes.
` https://developer.android.com/reference/android/renderscript/Script.InvokeID` ` https://developer.android.com/reference/android/renderscript/Script#createInvokeID(int)(int slot) `

Only to be used by generated reflected classes.
` https://developer.android.com/reference/android/renderscript/Script.KernelID` ` https://developer.android.com/reference/android/renderscript/Script#createKernelID(int,%20int,%20android.renderscript.Element,%20android.renderscript.Element)(int slot, int sig, https://developer.android.com/reference/android/renderscript/Element ein, https://developer.android.com/reference/android/renderscript/Element eout) `

Only to be used by generated reflected classes.
` void` ` https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation[],%20android.renderscript.Allocation,%20android.renderscript.FieldPacker)(int slot, https://developer.android.com/reference/android/renderscript/Allocation ains, https://developer.android.com/reference/android/renderscript/Allocation aout, https://developer.android.com/reference/android/renderscript/FieldPacker v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation,%20android.renderscript.Allocation,%20android.renderscript.FieldPacker,%20android.renderscript.Script.LaunchOptions)(int slot, https://developer.android.com/reference/android/renderscript/Allocation ain, https://developer.android.com/reference/android/renderscript/Allocation aout, https://developer.android.com/reference/android/renderscript/FieldPacker v, https://developer.android.com/reference/android/renderscript/Script.LaunchOptions sc) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation,%20android.renderscript.Allocation,%20android.renderscript.FieldPacker)(int slot, https://developer.android.com/reference/android/renderscript/Allocation ain, https://developer.android.com/reference/android/renderscript/Allocation aout, https://developer.android.com/reference/android/renderscript/FieldPacker v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation[],%20android.renderscript.Allocation,%20android.renderscript.FieldPacker,%20android.renderscript.Script.LaunchOptions)(int slot, https://developer.android.com/reference/android/renderscript/Allocation ains, https://developer.android.com/reference/android/renderscript/Allocation aout, https://developer.android.com/reference/android/renderscript/FieldPacker v, https://developer.android.com/reference/android/renderscript/Script.LaunchOptions sc) `

Only intended for use by generated reflected code.
` boolean` ` https://developer.android.com/reference/android/renderscript/Script#getVarB(int)(int index) ` ` double` ` https://developer.android.com/reference/android/renderscript/Script#getVarD(int)(int index) ` ` float` ` https://developer.android.com/reference/android/renderscript/Script#getVarF(int)(int index) ` ` int` ` https://developer.android.com/reference/android/renderscript/Script#getVarI(int)(int index) ` ` long` ` https://developer.android.com/reference/android/renderscript/Script#getVarJ(int)(int index) ` ` void` ` https://developer.android.com/reference/android/renderscript/Script#getVarV(int,%20android.renderscript.FieldPacker)(int index, https://developer.android.com/reference/android/renderscript/FieldPacker v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#invoke(int)(int slot) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#invoke(int,%20android.renderscript.FieldPacker)(int slot, https://developer.android.com/reference/android/renderscript/FieldPacker v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#reduce(int,%20android.renderscript.Allocation[],%20android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions)(int slot, https://developer.android.com/reference/android/renderscript/Allocation ains, https://developer.android.com/reference/android/renderscript/Allocation aout, https://developer.android.com/reference/android/renderscript/Script.LaunchOptions sc) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setTimeZone(java.lang.String)(https://developer.android.com/reference/java/lang/String timeZone) ` ` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20boolean)(int index, boolean v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20int)(int index, int v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.FieldPacker,%20android.renderscript.Element,%20int[])(int index, https://developer.android.com/reference/android/renderscript/FieldPacker v, https://developer.android.com/reference/android/renderscript/Element e, int[] dims) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.FieldPacker)(int index, https://developer.android.com/reference/android/renderscript/FieldPacker v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20float)(int index, float v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20double)(int index, double v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20long)(int index, long v) `

Only intended for use by generated reflected code.
` void` ` https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.BaseObj)(int index, https://developer.android.com/reference/android/renderscript/BaseObj o) `

Only intended for use by generated reflected code.
From class ` https://developer.android.com/reference/android/renderscript/BaseObj ` ` void` ` https://developer.android.com/reference/android/renderscript/BaseObj#destroy()() `

Frees any native resources associated with this object.
` boolean` ` https://developer.android.com/reference/android/renderscript/BaseObj#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Compare the current BaseObj with another BaseObj for equality.
` void` ` https://developer.android.com/reference/android/renderscript/BaseObj#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/android/renderscript/BaseObj#getName()() ` ` int` ` https://developer.android.com/reference/android/renderscript/BaseObj#hashCode()() `

Calculates the hash code value for a BaseObj.
` void` ` https://developer.android.com/reference/android/renderscript/BaseObj#setName(java.lang.String)(https://developer.android.com/reference/java/lang/String name) `

setName assigns a name to an object.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### create

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public static ScriptIntrinsicHistogram create (RenderScript rs, 
                Element e)
```

Create an intrinsic for calculating the histogram of an uchar or uchar4 image. Supported elements types are `https://developer.android.com/reference/android/renderscript/Element#U8_4(android.renderscript.RenderScript)`, `https://developer.android.com/reference/android/renderscript/Element#U8_3(android.renderscript.RenderScript)`, `https://developer.android.com/reference/android/renderscript/Element#U8_2(android.renderscript.RenderScript)`, `https://developer.android.com/reference/android/renderscript/Element#U8(android.renderscript.RenderScript)`

<br />

| Parameters ||
|---|---|
| `rs` | `RenderScript`: The RenderScript context <br /> |
| `e` | `Element`: Element type for inputs <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/renderscript/ScriptIntrinsicHistogram` | ScriptIntrinsicHistogram <br /> |

### forEach

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `ain` | `Allocation`: The input image <br /> |

### forEach

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `ain` | `Allocation`: The input image <br /> |
| `opt` | `Script.LaunchOptions`: LaunchOptions for clipping <br /> |

### forEach_Dot

Added in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)   
Deprecated in [API level 31](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `ain` | `Allocation`: The input image <br /> |
| `opt` | `Script.LaunchOptions`: LaunchOptions for clipping <br /> |

### forEach_Dot

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `ain` | `Allocation`: The input image <br /> |

### getFieldID_Input

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Script.FieldID getFieldID_Input ()
```

Get a FieldID for the input field of this intrinsic.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/renderscript/Script.FieldID` | Script.FieldID The FieldID object. <br /> |

### getKernelID_Separate

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public Script.KernelID getKernelID_Separate ()
```

Get a KernelID for this intrinsic kernel.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/renderscript/Script.KernelID` | Script.KernelID The KernelID object. <br /> |

### setDotCoefficients

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public 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.

<br />

| Parameters ||
|---|---|
| `r` | `float`: Red coefficient <br /> |
| `g` | `float`: Green coefficient <br /> |
| `b` | `float`: Blue coefficient <br /> |
| `a` | `float`: Alpha coefficient <br /> |

### setOutput

Added in [API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public void setOutput (Allocation aout)
```

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

<br />

| Parameters ||
|---|---|
| `aout` | `Allocation`: The output allocation <br /> |