android 代码 lut,在ScriptIntrinsic3DLUT上,如何将LUT分配给用户?_android_开发99编程知识库...

一般来说,这个脚本的工作方式与其他创建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 分配。 这里分配的适当格式是什么?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值