ScriptIntrinsic3DLUTpublic 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 |
Constructors Summary |
---|
protected ScriptIntrinsic3DLUT(int id, RenderScript rs, Element e)
super(id, rs);
mElement = e;
|
Methods Summary |
---|
public static android.support.v8.renderscript.ScriptIntrinsic3DLUT | create(RenderScript rs, Element e)Supported elements types are {@link Element#U8_4}
The defaults tables are identity.
if (rs.isNative) {
RenderScriptThunker rst = (RenderScriptThunker) rs;
return ScriptIntrinsic3DLUTThunker.create(rs, e);
}
int 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(0, ain, aout, null);
| 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.support.v8.renderscript.Allocation} to be used as
the lookup table.
The lookup table must use the same
{@link android.support.v8.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);
|
|