我正在Video
的Application
Swift iOS
工作。我在哪里使用AVPlayer
玩Video
并使用CIFilters
在Video
上设置AVVideoComposition
。我必须在我的Cool and warm tone filter effects
上使用Videos
(请参见下图)。
我已经尝试了下面Core Image Filters
中提到的所有Apple doc
,但它们都不像Cool and warm tone filter effect
。
任何人都可以这样做吗?请建议我。
好像CITemperatureAndTint
filter就是你要找的东西。我坦率地不知道参数是如何工作的,但也许你可以查看this或this相关的问题。
感谢@Frank Schlegel指导CITemperatureAndTint
使用inputNeutral
和inputTargetNeutral
过滤器。请参阅以下核心图像滤镜参数以获得暖色调和冷色调效果:
filter = CIFilter(name: "CITemperatureAndTint")!
//冷
filter.setValue(CIVector(x: 16000, y: 1000), forKey: "inputNeutral")
filter.setValue(CIVector(x: 1000, y: 500), forKey: "inputTargetNeutral")
//暖
filter.setValue(CIVector(x: 6500, y: 500), forKey: "inputNeutral")
filter.setValue(CIVector(x: 1000, y: 630), forKey: "inputTargetNeutral")