public final class ScriptIntrinsicColorMatrix extends ScriptIntrinsic
Element.F32_4(android.renderscript.RenderScript)
, multiplying the
result by the 4x4 color matrix as performed by
rsMatrixMultiply() and writing it to the output after
conversion back to Element.U8_4(android.renderscript.RenderScript)
.Script.Builder, Script.FieldBase, Script.FieldID, Script.KernelID
Modifier and Type | Method and Description |
---|---|
static ScriptIntrinsicColorMatrix |
create(RenderScript rs,
Element e)
Create an intrinsic for applying a color matrix to an
allocation.
|
void |
forEach(Allocation ain,
Allocation aout)
Invoke the kernel and apply the matrix to each cell of ain and copy to
aout.
|
Script.KernelID |
getKernelID()
Get a KernelID for this intrinsic kernel.
|
void |
setColorMatrix(Matrix3f m)
Set the color matrix which will be applied to each cell of the image.
|
void |
setColorMatrix(Matrix4f m)
Set the color matrix which will be applied to each cell of
the image.
|
void |
setGreyscale()
Set a color matrix to convert from RGB to luminance.
|
void |
setRGBtoYUV()
Set the matrix to convert from RGB to YUV with a direct copy of the 4th
channel.
|
void |
setYUVtoRGB()
Set the matrix to convert from YUV to RGB with a direct copy of the 4th
channel.
|
bindAllocation, createFieldID, createKernelID, forEach, invoke, invoke, setTimeZone, setVar, setVar, setVar, setVar, setVar, setVar, setVar, setVar
public static ScriptIntrinsicColorMatrix create(RenderScript rs, Element e)
Element.U8_4(android.renderscript.RenderScript)
rs
- The Renderscript contexte
- Element type for intputs and outputspublic void setColorMatrix(Matrix4f m)
m
- The 4x4 matrix to set.public void setColorMatrix(Matrix3f m)
m
- The 3x3 matrix to set.public void setGreyscale()
public void setYUVtoRGB()
public void setRGBtoYUV()
public void forEach(Allocation ain, Allocation aout)
ain
- Input allocationaout
- Output allocationpublic Script.KernelID getKernelID()