【发布时间】:2015-07-26 12:02:44
【问题描述】:
我正在尝试使用 Android Renderscript 来模糊图像。我的输入是一个包含像素颜色的整数数组。这是我做过但没用的。应用程序在 Galaxy S 设备上关闭且没有任何错误消息
bmp.getPixels(pixels, 0, bmp.getWidth(), 0, 0, bmp.getWidth(), bmp.getHeight());
Allocation input = Allocation.createSized(rs, Element.I32(rs), pixels.length);
input.copy1DRangeFrom(0, pixels.length, pixels);
Allocation output = Allocation.createTyped(rs, input.getType());
ScriptIntrinsicBlur script = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));
script.setRadius(6f);
script.setInput(input);
script.forEach(output);
output.copyTo(pixels);
【问题讨论】:
标签: android allocation renderscript