我正在尝试编译一个renderScript示例,但没办法。 我有一些我无法解决的错误:
[09.22.2014 18:28:44 - aaa] error: Error reading '... \ aaa \ process.rs'
当我创建文件.rs。
时,我也会得到那种ScriptC_process
project.properties:
project.properties:
renderscript.target=18
renderscript.support.mode=true
sdk.buildtools=19.1.0
target=android-20
还显示项目的配置。非常感谢你。
修改
process.rs的代码如下:
#pragma version(1)
#pragma rs java_package_name(com.example.aaa)
//multipliers to convert a RGB colors to black and white
const static float3 gMonoMult = {0.299f, 0.587f, 0.114f};
void root(const uchar4 *v_in, uchar4 *v_out) {
//unpack a color to a float4
float4 f4 = rsUnpackColor8888(*v_in);
//take the dot product of the color and the multiplier
float3 mono = dot(f4.rgb, gMonoMult);
//repack the float to a color
*v_out = rsPackColorTo8888(mono);
}
我只是使用以下网站: [link] https://stuff.mit.edu/afs/sipb/project/android/docs/guide/topics/renderscript/compute.html