在圖像上應用GPUImage過濾器時,我遇到了一個奇怪的問題。我試圖對圖像應用不同的過濾器,但應用10-15個過濾器後,它會給我提示內存,然後崩潰。 這裏是代碼:GPUImage內存警告
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];
如果有人經歷過同樣的問題,請建議。謝謝
這個應用程序使用ARC嗎? – propstm
不,這個程序沒有ARC。 – Superdev