ScriptIntrinsicColorMatrix
classScriptIntrinsicColorMatrix: ScriptIntrinsic
kotlin.Any | ||||
↳ | android.renderscript.BaseObj | |||
↳ | android.renderscript.Script | |||
↳ | android.renderscript.ScriptIntrinsic | |||
↳ | android.renderscript.ScriptIntrinsicColorMatrix |
Intrinsic for applying a color matrix to allocations. If the element type is Element.DataType.UNSIGNED_8
, it is converted to 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
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
, and then writing it to the output 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
, android.renderscript.Element#U8_2
, Element.U8_3
, Element.U8_4
, Element.F32
, Element.F32_2
, android.renderscript.Element#F32_3
, and Element.F32_4
.
Summary
Public methods | |
---|---|
static ScriptIntrinsicColorMatrix! |
create(rs: RenderScript!) Create an intrinsic for applying a color matrix to an allocation. |
static ScriptIntrinsicColorMatrix! |
create(rs: RenderScript!, e: Element!) Create an intrinsic for applying a color matrix to an allocation. |
Unit |
forEach(ain: Allocation!, aout: Allocation!) Invoke the kernel and apply the matrix to each cell of input |
Unit |
forEach(ain: Allocation!, aout: Allocation!, opt: Script.LaunchOptions!) Invoke the kernel and apply the matrix to each cell of input |
Script.KernelID! |
Get a KernelID for this intrinsic kernel. |
Unit |
Set the value to be added after the color matrix has been applied. |
Unit |
Set the value to be added after the color matrix has been applied. |
Unit |
setColorMatrix(m: Matrix3f!) Set the color matrix which will be applied to each cell of the image. |
Unit |
setColorMatrix(m: Matrix4f!) Set the color matrix which will be applied to each cell of the image. |
Unit |
Set a color matrix to convert from RGB to luminance. |
Unit |
Set the matrix to convert from RGB to YUV with a direct copy of the 4th channel. |
Unit |
Set the matrix to convert from YUV to RGB with a direct copy of the 4th channel. |
Public methods
create
static funcreate(rs: RenderScript!): ScriptIntrinsicColorMatrix!
Deprecated: Deprecated in Java.
Create an intrinsic for applying a color matrix to an allocation.
Parameters | |
---|---|
rs |
RenderScript!: The RenderScript context |
Return | |
---|---|
ScriptIntrinsicColorMatrix! |
ScriptIntrinsicColorMatrix |
create
static funcreate(
rs: RenderScript!,
e: Element!
): ScriptIntrinsicColorMatrix!
Deprecated: Use the single argument version as Element is now ignored.
Create an intrinsic for applying a color matrix to an allocation.
Parameters | |
---|---|
rs |
RenderScript!: The RenderScript context |
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. |
Return | |
---|---|
ScriptIntrinsicColorMatrix! |
ScriptIntrinsicColorMatrix |
forEach
funforEach(
ain: Allocation!,
aout: Allocation!
): Unit
Deprecated: Deprecated in Java.
Invoke the kernel and apply the matrix to each cell of input Allocation
and copy to the output 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.
Parameters | |
---|---|
ain |
Allocation!: Input allocation |
aout |
Allocation!: Output allocation |
forEach
funforEach(
ain: Allocation!,
aout: Allocation!,
opt: Script.LaunchOptions!
): Unit
Deprecated: Deprecated in Java.
Invoke the kernel and apply the matrix to each cell of input Allocation
and copy to the output 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.
Parameters | |
---|---|
ain |
Allocation!: Input allocation |
aout |
Allocation!: Output allocation |
opt |
Script.LaunchOptions!: LaunchOptions for clipping |
getKernelID
fungetKernelID(): Script.KernelID!
Deprecated: Deprecated in Java.
Get a KernelID for this intrinsic kernel.
Return | |
---|---|
Script.KernelID! |
Script.KernelID The KernelID object. |
setAdd
funsetAdd(f: Float4!): Unit
Deprecated: Deprecated in Java.
Set the value to be added after the color matrix has been applied. The default value is {0, 0, 0, 0}
Parameters | |
---|---|
f |
Float4!: The float4 value to be added. |
setAdd
funsetAdd(
r: Float,
g: Float,
b: Float,
a: Float
): Unit
Deprecated: Deprecated in Java.
Set the value to be added after the color matrix has been applied. The default value is {0, 0, 0, 0}
Parameters | |
---|---|
r |
Float: The red add value. |
g |
Float: The green add value. |
b |
Float: The blue add value. |
a |
Float: The alpha add value. |
setColorMatrix
funsetColorMatrix(m: Matrix3f!): Unit
Deprecated: Deprecated in Java.
Set the color matrix which will be applied to each cell of the image. This will set the alpha channel to be a copy.
Parameters | |
---|---|
m |
Matrix3f!: The 3x3 matrix to set. |
setColorMatrix
funsetColorMatrix(m: Matrix4f!): Unit
Deprecated: Deprecated in Java.
Set the color matrix which will be applied to each cell of the image.
Parameters | |
---|---|
m |
Matrix4f!: The 4x4 matrix to set. |
setGreyscale
funsetGreyscale(): Unit
Deprecated: Deprecated in Java.
Set a color matrix to convert from RGB to luminance. The alpha channel will be a copy.
setRGBtoYUV
funsetRGBtoYUV(): Unit
Deprecated: Deprecated in Java.
Set the matrix to convert from RGB to YUV with a direct copy of the 4th channel.
setYUVtoRGB
funsetYUVtoRGB(): Unit
Deprecated: Deprecated in Java.
Set the matrix to convert from YUV to RGB with a direct copy of the 4th channel.