How to apply Cool and warm tone CIFilter in iOS?

前端 未结 2 960
醉酒成梦
醉酒成梦 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: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")
    

提交回复
热议问题