一般来说,这个脚本的工作方式与其他创建RS上下文
使用这里上下文创建脚本
创建输入和输出分配
设置脚本参数
调用内核
可能在 set script parameters 步骤中出现问题,从文档我应该调用 script.setLUT (Allocation lut),但是如何正确地生成/设置这个分配值的方法是什么?
我拥有的代码示例如下://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);
但这不一样。 我不关心多维数据集文件。 我可以从字节的array,int,矩阵创建 LUT 。 我只想知道如何/在哪里放置字节 inside 分配。 这里分配的适当格式是什么?