How to apply Cool and warm tone CIFilter in iOS?

前端 未结 2 936
醉酒成梦
醉酒成梦 2021-01-29 08:05

I am working on Video based Application in Swift iOS. Where I am using AVPlayer to play the Video and setting

相关标签:
2条回答
  • 2021-01-29 08:38

    It seems like the CITemperatureAndTint filter is what you are looking for. I frankly don't know exactly how the parameters work, but maybe you can check out this or this related question.

    0 讨论(0)
  • 2021-01-29 08:49

    Thanks @Frank Schlegel for direct me to CITemperatureAndTint Filter with inputNeutral and inputTargetNeutral. 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")
    
    0 讨论(0)
提交回复
热议问题