如何在iOS中应用Cool and warm tone CIFilter?

问题描述 投票:-1回答:2

我正在VideoApplication Swift iOS工作。我在哪里使用AVPlayerVideo并使用CIFiltersVideo上设置AVVideoComposition。我必须在我的Cool and warm tone filter effects上使用Videos(请参见下图)。

enter image description here

enter image description here

我已经尝试了下面Core Image Filters中提到的所有Apple doc,但它们都不像Cool and warm tone filter effect

https://developer.apple.com/library/archive/documentation/GraphicsImaging/Reference/CoreImageFilterReference/index.html

任何人都可以这样做吗?请建议我。

ios swift core-image cifilter
2个回答
1
投票

好像CITemperatureAndTint filter就是你要找的东西。我坦率地不知道参数是如何工作的,但也许你可以查看thisthis相关的问题。


1
投票

感谢@Frank Schlegel指导CITemperatureAndTint使用inputNeutralinputTargetNeutral过滤器。请参阅以下核心图像滤镜参数以获得暖色调和冷色调效果:

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")
© www.soinside.com 2019 - 2024. All rights reserved.