# ScriptIntrinsicColorMatrix

Added in[API level 17](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/ScriptIntrinsicColorMatrix#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#inhmethods)  

# ScriptIntrinsicColorMatrix

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/renderscript/ScriptIntrinsicColorMatrix "View this page in Kotlin")\|Java

`
public

final

class
ScriptIntrinsicColorMatrix
`  
`


``


``


``

extends `[ScriptIntrinsic](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.ScriptIntrinsicColorMatrix |

<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 for applying a color matrix to allocations. If the element type is[Element.DataType.UNSIGNED_8](https://developer.android.com/reference/android/renderscript/Element.DataType#UNSIGNED_8), it is converted to[Element.DataType.FLOAT_32](https://developer.android.com/reference/android/renderscript/Element.DataType#FLOAT_32)and normalized from (0-255) to (0-1). If the incoming vector size is less than four, a[Element.F32_4](https://developer.android.com/reference/android/renderscript/Element#F32_4(android.renderscript.RenderScript))is created by filling the missing vector channels with zero. This value is then multiplied by the 4x4 color matrix as performed by rsMatrixMultiply(), adding a[Element.F32_4](https://developer.android.com/reference/android/renderscript/Element#F32_4(android.renderscript.RenderScript)), and then writing it to the output[Allocation](https://developer.android.com/reference/android/renderscript/Allocation). If the ouptut type is unsigned, the value is normalized from (0-1) to (0-255) and converted. If the output vector size is less than four, the unused channels are discarded. Supported elements types are[Element.U8](https://developer.android.com/reference/android/renderscript/Element#U8(android.renderscript.RenderScript)),[Element.U8_2(RenderScript)](https://developer.android.com/reference/android/renderscript/Element#U8_2(android.renderscript.RenderScript)),[Element.U8_3](https://developer.android.com/reference/android/renderscript/Element#U8_3(android.renderscript.RenderScript)),[Element.U8_4](https://developer.android.com/reference/android/renderscript/Element#U8_4(android.renderscript.RenderScript)),[Element.F32](https://developer.android.com/reference/android/renderscript/Element#F32(android.renderscript.RenderScript)),[Element.F32_2](https://developer.android.com/reference/android/renderscript/Element#F32_2(android.renderscript.RenderScript)),[Element.F32_3(RenderScript)](https://developer.android.com/reference/android/renderscript/Element#F32_3(android.renderscript.RenderScript)), and[Element.F32_4](https://developer.android.com/reference/android/renderscript/Element#F32_4(android.renderscript.RenderScript)).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                              ### Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                              ||
|---------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` static `[ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix) | ` `[create](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#create(android.renderscript.RenderScript,%20android.renderscript.Element))`(`[RenderScript](https://developer.android.com/reference/android/renderscript/RenderScript)` rs, `[Element](https://developer.android.com/reference/android/renderscript/Element)` e) ` *This method was deprecated in API level 19. Use the single argument version as Element is now ignored.*                                                                                                                                                                                                                                                                                                                             |
| ` static `[ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix) | ` `[create](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#create(android.renderscript.RenderScript))`(`[RenderScript](https://developer.android.com/reference/android/renderscript/RenderScript)` rs) ` Create an intrinsic for applying a color matrix to an allocation.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` void`                                                                                                                         | ` `[forEach](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#forEach(android.renderscript.Allocation,%20android.renderscript.Allocation))`(`[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` ain, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout) ` Invoke the kernel and apply the matrix to each cell of input[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)and copy to the output[Allocation](https://developer.android.com/reference/android/renderscript/Allocation).                                                                                                                                                               |
| ` void`                                                                                                                         | ` `[forEach](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#forEach(android.renderscript.Allocation,%20android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions))`(`[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` ain, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[Script.LaunchOptions](https://developer.android.com/reference/android/renderscript/Script.LaunchOptions)` opt) ` Invoke the kernel and apply the matrix to each cell of input[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)and copy to the output[Allocation](https://developer.android.com/reference/android/renderscript/Allocation). |
| ` `[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID)                              | ` `[getKernelID](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#getKernelID())`() ` Get a KernelID for this intrinsic kernel.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ` void`                                                                                                                         | ` `[setAdd](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setAdd(float,%20float,%20float,%20float))`(float r, float g, float b, float a) ` Set the value to be added after the color matrix has been applied.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ` void`                                                                                                                         | ` `[setAdd](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setAdd(android.renderscript.Float4))`(`[Float4](https://developer.android.com/reference/android/renderscript/Float4)` f) ` Set the value to be added after the color matrix has been applied.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ` void`                                                                                                                         | ` `[setColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setColorMatrix(android.renderscript.Matrix3f))`(`[Matrix3f](https://developer.android.com/reference/android/renderscript/Matrix3f)` m) ` Set the color matrix which will be applied to each cell of the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                                         | ` `[setColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setColorMatrix(android.renderscript.Matrix4f))`(`[Matrix4f](https://developer.android.com/reference/android/renderscript/Matrix4f)` m) ` Set the color matrix which will be applied to each cell of the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ` void`                                                                                                                         | ` `[setGreyscale](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setGreyscale())`() ` Set a color matrix to convert from RGB to luminance.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ` void`                                                                                                                         | ` `[setRGBtoYUV](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setRGBtoYUV())`() ` Set the matrix to convert from RGB to YUV with a direct copy of the 4th channel.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| ` void`                                                                                                                         | ` `[setYUVtoRGB](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix#setYUVtoRGB())`() ` Set the matrix to convert from YUV to RGB with a direct copy of the 4th channel.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

| ### Inherited methods |
|-----------------------|---|
| From class` `[android.renderscript.Script](https://developer.android.com/reference/android/renderscript/Script)` ` |----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                                                            | ` `[bindAllocation](https://developer.android.com/reference/android/renderscript/Script#bindAllocation(android.renderscript.Allocation,%20int))`(`[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` va, int slot) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` `[Script.FieldID](https://developer.android.com/reference/android/renderscript/Script.FieldID)   | ` `[createFieldID](https://developer.android.com/reference/android/renderscript/Script#createFieldID(int,%20android.renderscript.Element))`(int slot, `[Element](https://developer.android.com/reference/android/renderscript/Element)` e) ` Only to be used by generated reflected classes.                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` `[Script.InvokeID](https://developer.android.com/reference/android/renderscript/Script.InvokeID) | ` `[createInvokeID](https://developer.android.com/reference/android/renderscript/Script#createInvokeID(int))`(int slot) ` Only to be used by generated reflected classes.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | | ` `[Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID) | ` `[createKernelID](https://developer.android.com/reference/android/renderscript/Script#createKernelID(int,%20int,%20android.renderscript.Element,%20android.renderscript.Element))`(int slot, int sig, `[Element](https://developer.android.com/reference/android/renderscript/Element)` ein, `[Element](https://developer.android.com/reference/android/renderscript/Element)` eout) ` Only to be used by generated reflected classes.                                                                                                                                                                                                                                                                                           | | ` void`                                                                                            | ` `[forEach](https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation[],%20android.renderscript.Allocation,%20android.renderscript.FieldPacker))`(int slot, `[Allocation[]](https://developer.android.com/reference/android/renderscript/Allocation)` ains, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v) ` Only intended for use by generated reflected code.                                                                                                                                                              | | ` void`                                                                                            | ` `[forEach](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, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` ain, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v, `[Script.LaunchOptions](https://developer.android.com/reference/android/renderscript/Script.LaunchOptions)` sc) ` Only intended for use by generated reflected code.      | | ` void`                                                                                            | ` `[forEach](https://developer.android.com/reference/android/renderscript/Script#forEach(int,%20android.renderscript.Allocation,%20android.renderscript.Allocation,%20android.renderscript.FieldPacker))`(int slot, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` ain, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v) ` Only intended for use by generated reflected code.                                                                                                                                                                   | | ` void`                                                                                            | ` `[forEach](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, `[Allocation[]](https://developer.android.com/reference/android/renderscript/Allocation)` ains, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v, `[Script.LaunchOptions](https://developer.android.com/reference/android/renderscript/Script.LaunchOptions)` sc) ` Only intended for use by generated reflected code. | | ` boolean`                                                                                         | ` `[getVarB](https://developer.android.com/reference/android/renderscript/Script#getVarB(int))`(int index) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` double`                                                                                          | ` `[getVarD](https://developer.android.com/reference/android/renderscript/Script#getVarD(int))`(int index) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` float`                                                                                           | ` `[getVarF](https://developer.android.com/reference/android/renderscript/Script#getVarF(int))`(int index) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` int`                                                                                             | ` `[getVarI](https://developer.android.com/reference/android/renderscript/Script#getVarI(int))`(int index) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` long`                                                                                            | ` `[getVarJ](https://developer.android.com/reference/android/renderscript/Script#getVarJ(int))`(int index) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` void`                                                                                            | ` `[getVarV](https://developer.android.com/reference/android/renderscript/Script#getVarV(int,%20android.renderscript.FieldPacker))`(int index, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                   | | ` void`                                                                                            | ` `[invoke](https://developer.android.com/reference/android/renderscript/Script#invoke(int))`(int slot) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | | ` void`                                                                                            | ` `[invoke](https://developer.android.com/reference/android/renderscript/Script#invoke(int,%20android.renderscript.FieldPacker))`(int slot, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                            | ` `[reduce](https://developer.android.com/reference/android/renderscript/Script#reduce(int,%20android.renderscript.Allocation[],%20android.renderscript.Allocation,%20android.renderscript.Script.LaunchOptions))`(int slot, `[Allocation[]](https://developer.android.com/reference/android/renderscript/Allocation)` ains, `[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)` aout, `[Script.LaunchOptions](https://developer.android.com/reference/android/renderscript/Script.LaunchOptions)` sc) ` Only intended for use by generated reflected code.                                                                                                                                    | | ` void`                                                                                            | ` `[setTimeZone](https://developer.android.com/reference/android/renderscript/Script#setTimeZone(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` timeZone) `                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20boolean))`(int index, boolean v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20int))`(int index, int v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.FieldPacker,%20android.renderscript.Element,%20int[]))`(int index, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v, `[Element](https://developer.android.com/reference/android/renderscript/Element)` e, int[] dims) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                           | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.FieldPacker))`(int index, `[FieldPacker](https://developer.android.com/reference/android/renderscript/FieldPacker)` v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                     | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20float))`(int index, float v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20double))`(int index, double v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20long))`(int index, long v) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | | ` void`                                                                                            | ` `[setVar](https://developer.android.com/reference/android/renderscript/Script#setVar(int,%20android.renderscript.BaseObj))`(int index, `[BaseObj](https://developer.android.com/reference/android/renderscript/BaseObj)` o) ` Only intended for use by generated reflected code.                                                                                                                                                                                                                                                                                                                                                                                                                                                 | ||
| From class` `[android.renderscript.BaseObj](https://developer.android.com/reference/android/renderscript/BaseObj)` ` |-----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` void`                                                               | ` `[destroy](https://developer.android.com/reference/android/renderscript/BaseObj#destroy())`() ` Frees any native resources associated with this object.                                                                                              | | ` boolean`                                                            | ` `[equals](https://developer.android.com/reference/android/renderscript/BaseObj#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Compare the current BaseObj with another BaseObj for equality. | | ` void`                                                               | ` `[finalize](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.                   | | ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/android/renderscript/BaseObj#getName())`() `                                                                                                                                                      | | ` int`                                                                | ` `[hashCode](https://developer.android.com/reference/android/renderscript/BaseObj#hashCode())`() ` Calculates the hash code value for a BaseObj.                                                                                                      | | ` void`                                                               | ` `[setName](https://developer.android.com/reference/android/renderscript/BaseObj#setName(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` setName assigns a name to an object.                        | ||
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](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 `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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`                                                                  | ` `[wait](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 17](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Deprecated in[API level 19](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

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

<br />

**This method was deprecated in API level 19.**   
Use the single argument version as Element is now ignored.

Create an intrinsic for applying a color matrix to an allocation.

<br />

|                                                                           Parameters                                                                            ||
|------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `rs` | `RenderScript`: The RenderScript context <br />                                                                                                           |
| `e`  | `Element`: Element type for inputs and outputs, As of API 19, this parameter is ignored. The Element type check is performed in the kernel launch. <br /> |

|                                                                         Returns                                                                          ||
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------|
| [ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix) | ScriptIntrinsicColorMatrix <br /> |

### create

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)  

```
public static ScriptIntrinsicColorMatrix create (RenderScript rs)
```

Create an intrinsic for applying a color matrix to an allocation.

<br />

|                      Parameters                       ||
|------|-------------------------------------------------|
| `rs` | `RenderScript`: The RenderScript context <br /> |

|                                                                         Returns                                                                          ||
|-----------------------------------------------------------------------------------------------------------------------|-----------------------------------|
| [ScriptIntrinsicColorMatrix](https://developer.android.com/reference/android/renderscript/ScriptIntrinsicColorMatrix) | ScriptIntrinsicColorMatrix <br /> |

### forEach

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

```
public void forEach (Allocation ain, 
                Allocation aout)
```

Invoke the kernel and apply the matrix to each cell of input[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)and copy to the output[Allocation](https://developer.android.com/reference/android/renderscript/Allocation). If the vector size of the input is less than four, the remaining components are treated as zero for the matrix multiply. If the output vector size is less than four, the unused vector components are discarded.

<br />

|                   Parameters                   ||
|--------|----------------------------------------|
| `ain`  | `Allocation`: Input allocation <br />  |
| `aout` | `Allocation`: Output allocation <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, 
                Allocation aout, 
                Script.LaunchOptions opt)
```

Invoke the kernel and apply the matrix to each cell of input[Allocation](https://developer.android.com/reference/android/renderscript/Allocation)and copy to the output[Allocation](https://developer.android.com/reference/android/renderscript/Allocation). If the vector size of the input is less than four, the remaining components are treated as zero for the matrix multiply. If the output vector size is less than four, the unused vector components are discarded.

<br />

|                            Parameters                             ||
|--------|-----------------------------------------------------------|
| `ain`  | `Allocation`: Input allocation <br />                     |
| `aout` | `Allocation`: Output allocation <br />                    |
| `opt`  | `Script.LaunchOptions`: LaunchOptions for clipping <br /> |

### getKernelID

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

```
public Script.KernelID getKernelID ()
```

Get a KernelID for this intrinsic kernel.

<br />

|                                                                   Returns                                                                    ||
|-------------------------------------------------------------------------------------------------|---------------------------------------------|
| [Script.KernelID](https://developer.android.com/reference/android/renderscript/Script.KernelID) | Script.KernelID The KernelID object. <br /> |

### setAdd

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)  

```
public void setAdd (float r, 
                float g, 
                float b, 
                float a)
```

Set the value to be added after the color matrix has been applied. The default value is {0, 0, 0, 0}

<br />

|                Parameters                 ||
|-----|--------------------------------------|
| `r` | `float`: The red add value. <br />   |
| `g` | `float`: The green add value. <br /> |
| `b` | `float`: The blue add value. <br />  |
| `a` | `float`: The alpha add value. <br /> |

### setAdd

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)  

```
public void setAdd (Float4 f)
```

Set the value to be added after the color matrix has been applied. The default value is {0, 0, 0, 0}

<br />

|                     Parameters                      ||
|-----|------------------------------------------------|
| `f` | `Float4`: The float4 value to be added. <br /> |

### setColorMatrix

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

```
public void setColorMatrix (Matrix3f m)
```

Set the color matrix which will be applied to each cell of the image. This will set the alpha channel to be a copy.

<br />

|                   Parameters                   ||
|-----|-------------------------------------------|
| `m` | `Matrix3f`: The 3x3 matrix to set. <br /> |

### setColorMatrix

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

```
public void setColorMatrix (Matrix4f m)
```

Set the color matrix which will be applied to each cell of the image.

<br />

|                   Parameters                   ||
|-----|-------------------------------------------|
| `m` | `Matrix4f`: The 4x4 matrix to set. <br /> |

### setGreyscale

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

```
public void setGreyscale ()
```

Set a color matrix to convert from RGB to luminance. The alpha channel will be a copy.

<br />

### setRGBtoYUV

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

```
public void setRGBtoYUV ()
```

Set the matrix to convert from RGB to YUV with a direct copy of the 4th channel.

<br />

### setYUVtoRGB

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

```
public void setYUVtoRGB ()
```

Set the matrix to convert from YUV to RGB with a direct copy of the 4th channel.

<br />