【发布时间】:2020-07-10 12:38:33
【问题描述】:
这是我当前的实现,输出与预期不同
private fun multiplyBitmap(bitmap: Bitmap?):Bitmap{
var mRenderScript = RenderScript.create(context!!)
var bitmapMultiply = mOriginalBitmap!!.copy(mOriginalBitmap!!.config,true)
var blend = ScriptIntrinsicBlend.create(mRenderScript, U8_4(mRenderScript))
var allocationIn = Allocation.createFromBitmap(mRenderScript, originalBackground)
var allocationOut = Allocation.createFromBitmap(mRenderScript,bitmapMultiply)
blend.forEachMultiply(allocationIn,allocationOut)
return bitmapMultiply
}
【问题讨论】:
-
ScriptIntrinsicBlend中的每个 src/dst 方法都映射到 Porter-Duff mode 如果您真的想将两个图像相乘,您应该更新您的帖子,详细说明您的输入是什么以及什么您的预期输出应该是。 -
这个工作成功了吗?我正在尝试一些类似的事情,但没有任何反应......
-
@slott,ScriptIntrinsicBlend 对我不起作用。我只是用 PorterDuff
标签: android image-processing renderscript