我正在根据 Adobe 的文档从头开始为 Android 开发柔光算法: http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf http://opensource.adobe.com/svn/opensource/flex/sdk/trunk/frameworks/projects/framework/src/mx/graphics/shaderClasses/SoftLight.pbk
任何人都可以为我解释算法或至少 dst、src、cb、cs
、sampleNearest()
函数以及如何计算它们吗?
谢谢!
input image4 dst;
input image4 src;
output pixel4 result;
void
evaluatePixel()
{
pixel4 a = sampleNearest(dst,outCoord()); // cb
pixel4 b = sampleNearest(src,outCoord()); // cs
....
}
最佳答案
See this answer对于混合公式:
ChannelBlend_SoftLight(A,B) ((uint8)((B < 128)?(2*((A>>1)+64))*((float)B/255):(255-(2*(255-((A>>1)+64))*(float)(255-B)/255))))
您上面的代码计算一个像素的混合。
a, b
是 2 个不同的像素,aampleNearest
函数从输入图像中获取 2 个像素。
dst,src
是 2 个输入图像。
关于android - 图像处理 : Soft-Light algorithm like Photoshop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9818075/