ios - GPUImagePicture 与 GPUImageView 目标?

标签 ios objective-c gpuimage

我正在尝试将 GPUImagePicture 的输出发送到 GPUImageView

这或多或少是我的代码:

GPUImageView *backgroundImageView = [[GPUImageView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
UIImage *image = [UIImage imageNamed:@"photo"]; //The image is not nil
GPUImagePicture *imageInput = [[GPUImagePicture alloc] initWithImage:image];

[imageInput addTarget:backgroundImageView];
[self.view addSubview:backgroundImageView];

问题是 backgroundImageView 似乎没有渲染图像...可能发生了什么?

最佳答案

设置过滤器(或显示)链后,您需要

[imageInput processImage];

将图像传播到过滤器链并使其显示。

关于ios - GPUImagePicture 与 GPUImageView 目标?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22303101/

相关文章:

ios - 用于存储自定义对象的 Userdefault 编码器类的数据

objective-c - 如何让我的 MPMoviePlayerController 横向播放?

ios - 按下发送按钮后,MFMessageComposeViewController 消息消失且无法发送(iOS 7)

ios - 如何使用 GPUImageHarrisCornerDetectionFilter 获取角点

objective-c - 如何使用GPUImage实现instagram lux效果?

ios - GPUImage Lookup Filter - 创建大于 512² 颜色的颜色深度

ios - 需要 iBeacon locationManager :didEnterRegion to trigger at near physical contact when backgrounded

iphone - 如何在不变形图像的情况下旋转UIImageView?

ios - 即使找到字符串后也要遍历整个数组

ios - 如何使用转换点 :toView for convert from view coordinate to window coordinate after rotation