我正在使用 GPU 图像开源框架来实现图像效果。问题是当我尝试在图像上定期应用过滤器时,应用程序会给我一个内存警告然后崩溃。
这是代码:
sourcePicture = [[GPUImagePicture alloc] initWithImage:[self scaleAndRotateImage:sourceImage] smoothlyScaleOutput:YES];
GPUImageGaussianBlurFilter *bright=[[GPUImageGaussianBlurFilter alloc]init];
[bright setBlurSize:1.0];
GPUImageFilter *sepiaFilter = bright;
[bright release];
[sepiaFilter prepareForImageCapture];
[sepiaFilter forceProcessingAtSize:self.m_imageView.image.size]; // This is now needed to make the filter run at the smaller output size
[sourcePicture addTarget:sepiaFilter];
[sourcePicture processImage];
UIImage *sep=[sepiaFilter imageFromCurrentlyProcessedOutput];
self.m_imageView.image=sep;
[sourcePicture release];
[sepiaFilter release];
请帮助我摆脱这个问题。谢谢