I have the following block of code that utilizes the GPUImage2 library to filter video in real time. The idea is to be able to cycle these filters based on button clicks. But only one filter will be applied and whenever I try and cycle to the next filter it does not change. Here is my function:
func filterToggle() {
switch(filterSelected) {
case 0:
let sketch = SketchFilter()
camera! --> sketch --> renderView
break;
case 1:
let toon = ToonFilter()
camera! --> toon --> renderView
break;
default:
break;
}
camera?.startCapture()
}
Thank you for any help!