【问题标题】:ScriptIntrinsicColorMatrix: setAdd method is not implemented in support libraryScriptIntrinsicColorMatrix:setAdd 方法未在支持库中实现
【发布时间】:2015-09-01 20:26:32
【问题描述】:

这是我的问题: 我正在使用实时图像处理,所以我想使用 ScriptIntrinsicColorMatrix 而不是常规的 ColorMatrix (因为它更快)

android.renderscript.ScriptIntrinsicColorMatrix(API 级别 19) 具有方法 setAdd

void    setAdd(float r, float g, float b, float a)
void    setAdd(Float4 f)
Set the value to be added after the color matrix has been applied.

其参数与ColorMatrix公式中的(e, j, o, t)含义相同

   R’ = a*R + b*G + c*B + d*A + e;
   G’ = f*R + g*G + h*B + i*A + j;
   B’ = k*R + l*G + m*B + n*A + o;
   A’ = p*R + q*G + r*B + s*A + t;

我的最低 SDK 版本是 14,所以我必须使用支持库中的 android.support.v8.renderscript.ScriptIntrinsicColorMatrix
很遗憾,它没有这些 setAdd 方法。而且我找不到他们的解决方法。

有人处理过这个问题吗?是否可以使用支持库中的 Instrinsic 渲染脚本完全覆盖 ColorMatrix 功能,还是应该编写自己的自定义 RenderScript?

【问题讨论】:

  • 嗯...我检查了两次,发现 setAdd 仅添加到构建工具 23.0.0 (其中有与渲染脚本相关的错误:))在 21.0.1 这些方法不存在。无论如何,非常感谢你,你的评论为我指明了正确的方向
  • 顺便说一下,这里描述的是构建工具23.0.0缺陷stackoverflow.com/questions/32080309/…
  • 支持库版本与构建工具版本有什么关系?我错过了什么吗?
  • 导入类的真实路径如下:C:\Users\VinSmile\AppData\Local\Android\sdk1\build-tools\22.0.1\renderscript\lib\renderscript-v8.jar !\android\support\v8\renderscript\ScriptIntrinsicColorMatrix.class

标签: android renderscript colormatrix android-renderscript


【解决方案1】:

好的,可能的解决方案(感谢pskink 的建议):

1) 将构建工具版本更改为 23.0.0(由于defect in this build tool,此时无法编译)
2) 从this guy 尝试解决方法
3) 利润

我刚刚测试过它,它可以工作。希望android能尽快修复这个缺陷

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-07
    • 2018-10-10
    相关资源
    最近更新 更多