I have a problem with understanding GPUImage. Specifically, I can't figure out how to use GPUImageLookupFilter. I have several examples of usage in GPUImageAmatorkaFilter for example. But LookupFilter used there within GPUImageFilterGroup which I didn't understood yet either. I wonder whether I can use LookupFilter alone.
I've tried this:
GPUImageLookupFilter *lookup = [[GPUImageLookupFilter alloc] init];
UIImage *image = [UIImage imageNamed:@"amatorka.png"];
GPUImagePicture *lookupImageSource = [[GPUImagePicture alloc] initWithImage:image];
[lookupImageSource addTarget: lookup atTextureLocation: 1];
[lookupImageSource processImage];
GPUImagePicture *inputImg = [[GPUImagePicture alloc] initWithImage:inputImage];
[inputImg addTarget:lookup atTextureLocation: 1];
[inputImg processImage];
UIImage *quickFilteredImage = [lookup imageFromCurrentlyProcessedOutput];
But it doesn't work, it crashes like this:
Assertion failure in -[GPUImageLookupFilter createFilterFBOofSize:], PathToSource/GPUImageFilter.m:369
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Incomplete filter FBO: 36054'
I definitely need to initialize something else, but ... . So, can anyone help me to make this small piece of code work? Thanks in advance.