ScriptIntrinsic3DLUTpublic final class ScriptIntrinsic3DLUT extends ScriptIntrinsic Intrinsic for converting RGB to RGBA by using a 3D lookup table. The
incoming r,g,b values are use as normalized x,y,z coordinates into a 3D
allocation. The 8 nearest values are sampled and linearly interpolated. The
result is placed in the output. |
Fields Summary |
---|
private Allocation | mLUT | private Element | mElement |
Methods Summary |
---|
public static android.renderscript.ScriptIntrinsic3DLUT | create(RenderScript rs, Element e)Supported elements types are {@link Element#U8_4}
The defaults tables are identity.
long id = rs.nScriptIntrinsicCreate(8, e.getID(rs));
if (!e.isCompatible(Element.U8_4(rs))) {
throw new RSIllegalArgumentException("Element must be compatible with uchar4.");
}
return new ScriptIntrinsic3DLUT(id, rs, e);
| public void | forEach(Allocation ain, Allocation aout)Invoke the kernel and apply the lookup to each cell of ain
and copy to aout.
forEach(ain, aout, null);
| public void | forEach(Allocation ain, Allocation aout, Script.LaunchOptions opt)Invoke the kernel and apply the lookup to each cell of ain
and copy to aout.
forEach(0, ain, aout, null, opt);
| public Script.KernelID | getKernelID()Get a KernelID for this intrinsic kernel.
return createKernelID(0, 3, null, null);
| public void | setLUT(Allocation lut)Sets the {@link android.renderscript.Allocation} to be used as the lookup table.
The lookup table must use the same {@link android.renderscript.Element} as the intrinsic.
final Type t = lut.getType();
if (t.getZ() == 0) {
throw new RSIllegalArgumentException("LUT must be 3d.");
}
if (!t.getElement().isCompatible(mElement)) {
throw new RSIllegalArgumentException("LUT element type must match.");
}
mLUT = lut;
setVar(0, mLUT);
|
|