我在一张图片上使用了 2 个滤镜。问题很容易理解,如果我移动一个滑块,过滤器将正常应用,但当我移动另一个滑块时,图片将重置为原始_tempImage
. 我尝试过替换 _justNowImage.image = quickFilteredImage;
,_tempImage = quickFilteredImage;
但结果是过滤器变得疯狂。
谢谢
- (IBAction)sharpenSliderChanged:(id)sender
{
GPUImageSharpenFilter *sharpenFilter = [[GPUImageSharpenFilter alloc] init];
[sharpenFilter setSharpness:sharpenSlider.value];
UIImage *quickFilteredImage = [sharpenFilter imageByFilteringImage: _tempImage];
_justNowImage.image = quickFilteredImage;
}
- (IBAction)exposureSliderChanged:(id)sender
{
GPUImageExposureFilter *exposureFilter = [[GPUImageExposureFilter alloc] init];
[exposureFilter setExposure:exposureSlider.value];
UIImage *quickFilteredImage = [exposureFilter imageByFilteringImage: _tempImage];
_justNowImage.image = quickFilteredImage;
}