[英]How to apply Cool and warm tone CIFilter in iOS?
I am working on Video
based Application
in Swift iOS
. 我正在Swift iOS
基于Video
的Application
上工作。 Where I am using AVPlayer
to play the Video
and setting CIFilters
on Video
using AVVideoComposition
. 当我使用AVPlayer
播放的Video
和设置CIFilters
对Video
使用AVVideoComposition
。 I have to apply Cool and warm tone filter effects
on my Videos
(please see the below images). 我要申请Cool and warm tone filter effects
对我的Videos
(请参阅下面的图像)。
I have tried all the Core Image Filters
mentioned in below Apple doc
, but none of them looks like Cool and warm tone filter effect
. 我已经尝试了下面Apple doc
提到的所有Core Image Filters
,但它们看起来都不像Cool and warm tone filter effect
。
https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html
Can anyone have worked on the same? 任何人都可以从事相同的工作吗? Please suggest me. 请给我建议。
It seems like the CITemperatureAndTint
filter is what you are looking for. 看起来CITemperatureAndTint
过滤器正是您想要的。 I frankly don't know exactly how the parameters work, but maybe you can check out this or this related question. 坦白地说,我不确切知道这些参数是如何工作的,但是也许您可以检查一下这个或这个相关的问题。
Thanks @Frank Schlegel for direct me to CITemperatureAndTint
Filter with inputNeutral
and inputTargetNeutral
. 感谢@Frank Schlegel将我CITemperatureAndTint
到具有inputNeutral
和inputTargetNeutral
CITemperatureAndTint
过滤器。 Please see the below Core Image Filter Parameter to get Warm and Cold tone effect : 请查看下面的核心图像滤镜参数以获取暖色调和冷色调效果:
filter = CIFilter(name: "CITemperatureAndTint")!
//cold //冷
filter.setValue(CIVector(x: 16000, y: 1000), forKey: "inputNeutral")
filter.setValue(CIVector(x: 1000, y: 500), forKey: "inputTargetNeutral")
//warm //暖
filter.setValue(CIVector(x: 6500, y: 500), forKey: "inputNeutral")
filter.setValue(CIVector(x: 1000, y: 630), forKey: "inputTargetNeutral")
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.