我曾使用GPUImage框架(某个旧版本)来混合两张图片(为某张图片添加边框覆盖物)。但是,当我升级到最新的框架版本后,在应用此类混合时,我得到了一张空的黑色图像。
我正在使用以下方法:
- (void)addBorder {
if (currentBorder != kBorderInitialValue) {
GPUImageAlphaBlendFilter *blendFilter = [[GPUImageAlphaBlendFilter alloc] init];
GPUImagePicture *imageToProcess = [[GPUImagePicture alloc] initWithImage:self.imageToWorkWithView.image];
GPUImagePicture *border = [[GPUImagePicture alloc] initWithImage:self.imageBorder];
blendFilter.mix = 1.0f;
[imageToProcess addTarget:blendFilter];
[border addTarget:blendFilter];
[imageToProcess processImage];
self.imageToWorkWithView.image = [blendFilter imageFromCurrentlyProcessedOutput];
[blendFilter release];
[imageToProcess release];
[border release];
}
}
什么是问题?
processImage
方法的实时GPUImageStillCamera
中使用GPUImageAlphaBlendFilter
的资源吗?我在这里提出了我的问题:http://stackoverflow.com/questions/16384813/gpuimagealphablendfilter-realtime-processing-from-gpuimagestillcamera-source - Can PoyrazoğluimageFromCurrentlyProcessedOutput
在最新的guimage和ios8中出现错误。我也尝试使用了imageFromCurrentFramebufferWithOrientation:0
,但仍然出现错误。 - Rahul DadhichimageFromCurrentlyProcessedOutput
这个东西已经不存在了。我使用这个答案中的代码也遇到了崩溃问题。你最终是如何解决的? - Chris Harrison