Search code examples
iosobjective-cgpuimage

GPUImagePicture with GPUImageView target?


I'm trying to send the output of GPUImagePicture to a GPUImageView,

This is more or less my code:

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];

The problem is that the backgroundImageView doesn't seem to be rendering the image... what could be going on?


Solution

  • After you've set up your filter (or display) chain, you need

    [imageInput processImage];
    

    to propagate the image down the filter chain and get it to display.