After capturing a fullscreen image, I need to crop the original image based on an crop overlay which essentially is just a CGRect.
This is how it looks like
I understand that crop filter's region values should be between 0 to 1. This is the piece of code that is supposed to do the cropping
- (UIImage *)crop:(UIImage *)source
{
CGRect cropRect = CGRectMake(26, 75, 710, 710);
// This is where the magic should happen to convert the rect to an OpenGL units
CGRect cropRegion = CGRectMake(x, y, width, height);
cropFilter = [[GPUImageCropFilter alloc] initWithCropRegion:cropRegion];
return [cropFilter imageByFilteringImage:source];
}