我们应该使用哪个CGImageAlphaInfo?

编程入门 行业动态 更新时间:2024-10-27 20:26:28
本文介绍了我们应该使用哪个CGImageAlphaInfo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

Quartz 2D编程指南定义了各种alpha存储模式的可用性:

The Quartz 2D programming guide defines the availability of the various alpha storage modes:

我们应该将哪些用于RGB上下文,为什么?

Which ones should we use for RGB contexts, and why?

对于非不透明的上下文, kCGImageAlphaPremultipliedFirst 或 kCGImageAlphaPremultipliedLast ?

For non-opaque contexts, kCGImageAlphaPremultipliedFirst or kCGImageAlphaPremultipliedLast?

对于不透明的上下文, kCGImageAlphaNoneSkipFirst 或 kCGImageAlphaNoneSkipLast ?

For opaque contexts, kCGImageAlphaNoneSkipFirst or kCGImageAlphaNoneSkipLast?

价值的选择会影响效果吗?

通常,我看到 kCGImageAlphaPremultipliedFirst 用于非opaque和 kCGImageAlphaNoneSkipFirst 。有些人表示这些表现更好,但我没有看到任何关于此的确凿证据或文件。

Typically, I see kCGImageAlphaPremultipliedFirst for non-opaque and kCGImageAlphaNoneSkipFirst for opaque contexts. Some state that these perform better but I haven't seen any hard evidence or documentation about this.

快速GitHub搜索显示开发者青睐 kCGImageAlphaPremultipliedFirst over kCGImageAlphaPremultipliedLast 和 kCGImageAlphaNoneSkipLast over kCGImageAlphaNoneSkipFirst 。可悲的是,这只不过是轶事证据。

A quick GitHub search shows that developers favor kCGImageAlphaPremultipliedFirst over kCGImageAlphaPremultipliedLast and kCGImageAlphaNoneSkipLast over kCGImageAlphaNoneSkipFirst. Sadly, this is little more than anecdotal evidence.

推荐答案

2014年WWDC的Apple工程师确认我们应该使用 kCGImageAlphaPremultipliedFirst 或 kCGImageAlphaNoneSkipFirst ,它确实会影响性能。

Confirmed by an Apple engineer at WWDC 2014 that we should use kCGImageAlphaPremultipliedFirst or kCGImageAlphaNoneSkipFirst, and that it does affect performance.

更多推荐

我们应该使用哪个CGImageAlphaInfo?

本文发布于:2023-11-09 05:14:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1571477.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:我们应该   CGImageAlphaInfo

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!