ios - kCGBlendMode 值中 R、S、Da 的含义

标签 ios iphone

我无法理解 R = 0R = SR = S*Da 的含义,定义在 kCGBlendMode 值,例如 kCGBlendModeClearkCGBlendModeCopykCGBlendModeSourceIn。那么,这些符号指的是什么?

最佳答案

R=0 表示结果颜色将为 0,表示将被清除。

R=S 表示结果颜色与源颜色相同

R=S*Da 表示结果是源颜色乘以目标的 alpha 值

如果你看一下 documentation向下滚动你会看到它们的含义:

The blend mode constants introduced in OS X v10.5 represent the Porter-Duff blend modes (a little explanation how they work). The symbols in the equations for these blend modes are:

  • R is the premultiplied result
  • S is the source color, and includes alpha
  • D is the destination color, and includes alpha
  • Ra, Sa, and Da are the alpha components of R, S, and D

如果您进一步查看 Setting blend modes您可以看到应用的大部分混合模式以及它们的结果可能是什么样子。

关于ios - kCGBlendMode 值中 R、S、Da 的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29866929/

相关文章:

iphone - AFNetworking - JSONRequestOperationWithRequest 在 400 状态码上成功

iphone - 使用 URL 向服务器发送信息

ios - 在循环中设置进度 View ,或者更新进度 View

iOS didAcceptNewSocket 预期不同的端口号

ios - TTTAttributedLabel 行数错误

ios - iOS 上 AIR Mobile 中的声学回声消除 - 使用 native 扩展?

ios - 尝试在 MKMapView 中查找用户位置的问题

iphone - MKMapView 无法按位置设置居中

ios - 沙盒苹果支付测试握手失败

ios - 在快速完成所有后台进程后执行功能