如何在CoreImage中禁用颜色管理

4
我想禁用苹果的最佳性能指南中所述的颜色管理:https://developer.apple.com/library/content/documentation/GraphicsImaging/Conceptual/CoreImaging/ci_performance/ci_performance.html。其中提到必须将kCIImageColorSpace设置为null。但是,使用cifilter?.setValue("null", forKey: kCIImageColorSpace)没有得到任何结果(应用崩溃)。我阅读了文档:https://developer.apple.com/documentation/coreimage/kciimagecolorspace,发现必须将NSNull对象作为值进行指定。然而,cifilter?.setValue(NSNull(), forKey kCIImageColorSpace)也导致了崩溃,并出现以下错误信息:"Class is not key value coding compliant for the key CIImageColorSpace"。请问正确的命令是什么?

感谢@Amit的编辑。 - user8387109
1个回答

5
创建CIContext时需要设置颜色空间,而不是在CIFilter中设置。这就是我所做的:
[CIContext contextWithOptions:@{kCIContextWorkingColorSpace : [NSNull null]}];

您应该跟随他们在建议结尾发布的链接:使用Core Image Context构建自己的工作流程

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接