while working with RenderScript, I am trying to use ScriptIntrinsic3DLUT ( http://developer.android.com/reference/android/renderscript/ScriptIntrinsic3DLUT.html )
In general, this script works just like any other renderscript
- create RS context
- create a script with this context
- create input and output distributions
- set script parameters
- kernel call
there may be a problem in the step set script parametersof the documents that I should name script.setLUT (Allocation lut), but what is the appropriate way to create / set values for this distribution?
sample code that i have:
// create RS context
RenderScript rs = RenderScript.create(context);
// create output bitmap
Bitmap bitmapOut = Bitmap.createBitmap(bitmapIn.getWidth(), bitmapIn.getHeight(), bitmapIn.getConfig());
// create bitmap allocations
Allocation allocIn = Allocation.createFromBitmap(rs, bitmapIn);
Allocation allocOut = Allocation.createFromBitmap(rs, bitmapOut);
// create script
ScriptIntrinsic3DLUT script = ScriptIntrinsic3DLUT.create(rs, Element.U8_4(rs));
// set 3D LUT for the script
how to create the `Allocation lut` ??
script.setLUT(lut);
// process the script
script.forEach(allocIn, allocOut);
// copy result to bitmap output
allocOut.copyTo(bitmapOut);
My question is similar to How to use ScriptIntrinsic3DLUT with a .cube file?
. . LUT , ints, matrix, . , -/- . ?