0
我遇到了最新的重構問題。每次我嘗試從過濾器中獲取已處理的UIImage時,都是零。我已經使用useNextFrameForImageCapture
,但它仍然不起作用。 這是我的代碼片段:新的GPUImage無法處理圖像
self.imageView = [[GPUImageView alloc] initWithFrame:CGRectMake(0,
0,
self.view.frame.size.width,
self.view.frame.size.height)];
staticPicture = [[GPUImagePicture alloc] initWithImage:img
smoothlyScaleOutput:YES];
filter = [[GPUImageToneCurveFilter alloc] initWithACV:@"cool"];
[staticPicture addTarget:filter];
[filter addTarget:self.imageView];
GPUImageRotationMode imageViewRotationMode = kGPUImageNoRotation;
switch (staticPictureOriginalOrientation) {
case UIImageOrientationLeft:
imageViewRotationMode = kGPUImageRotateLeft;
break;
case UIImageOrientationRight:
imageViewRotationMode = kGPUImageRotateRight;
break;
case UIImageOrientationDown:
imageViewRotationMode = kGPUImageRotate180;
break;
default:
imageViewRotationMode = kGPUImageNoRotation;
break;
}
// seems like atIndex is ignored by GPUImageView...
[self.imageView setInputRotation:imageViewRotationMode atIndex:0];
[staticPicture useNextFrameForImageCapture];
[staticPicture processImage];
UIImage *processedImage = [filter imageFromCurrentFramebufferWithOrientation:staticPictureOriginalOrientation];
processedImage始終爲零。將不勝感激任何幫助!