在图像上应用 GPUImage 过滤器时,我遇到了一个奇怪的问题。我正在尝试在图像上应用不同的过滤器,但在应用 10-15 个过滤器后,它会给我内存警告,然后崩溃。这是代码:
sourcePicture = [[GPUImagePicture alloc] initWithImage:self.m_imageView.image smoothlyScaleOutput:YES];
GPUImageBrightnessFilter *bright=[[GPUImageBrightnessFilter alloc]init];
[bright setBrightness:0.4];
GPUImageFilter *sepiaFilter = bright;
[sepiaFilter prepareForImageCapture];
[sepiaFilter forceProcessingAtSize:CGSizeMake(640.0, 480.0)]; // This is now needed to make the filter run at the smaller output size
[sourcePicture addTarget:sepiaFilter];
[sourcePicture processImage];
UIImage *sep=[sepiaFilter imageFromCurrentlyProcessedOutputWithOrientation:3];
self.m_imageView.image=sep;
[sourcePicture removeAllTargets];
如果有人遇到同样的问题,请提出建议。谢谢