GPUImage
GPUImage copied to clipboard
forceProcessingAtSize separated preview
Is there a way to preview a separated frame size from the one that will be saved?
I've tried the following, with no luck:
- (void)viewDidLoad
{
[super viewDidLoad];
stillCamera = [[GPUImageStillCamera alloc] init];
filter = [[GPUImageCustomFilter alloc] init];
[filter forceProcessingAtSize:CGSizeMake(640, 960)];
GPUImageRotationFilter *rotationFilter = [[GPUImageRotationFilter alloc] initWithRotation:kGPUImageRotateRight];
[filter prepareForImageCapture];
[stillCamera addTarget:rotationFilter];
GPUImageView *filterView = (GPUImageView *)self.view;
[rotationFilter addTarget:filter];
[filter addTarget:filterView];
[stillCamera startCameraCapture];
}
and on the takePhoto method:
- (IBAction)takePhoto:(id)sender;
{
[filter forceProcessingAtSize:CGSizeMake(1500, 2000)];
[stillCamera capturePhotoProcessedUpToFilter:filter withCompletionHandler:^(UIImage *anImage, NSError *error){
[[NSNotificationCenter defaultCenter] postNotificationName:@"photoWasShooted" object:nil userInfo:[NSDictionary dictionaryWithObject:anImage forKey:@"shoot"]];
[self dismissModalViewControllerAnimated:TRUE];
}];
}
Ok,
Solved the issue, using a separated filter for the takePhoto method as follow:
- (IBAction)takePhoto:(id)sender;
{
[stillCamera removeAllTargets];
GPUImageCustomFilter *fullSizeFilter = [[GPUImageCustomFilter alloc] init];
[fullSizeFilter forceProcessingAtSize:CGSizeMake(1500, 2000)];
[stillCamera capturePhotoProcessedUpToFilter:fullSizeFilter withCompletionHandler:^(UIImage *anImage, NSError *error){
[[NSNotificationCenter defaultCenter] postNotificationName:@"photoWasShooted" object:nil userInfo:[NSDictionary dictionaryWithObject:anImage forKey:@"shoot"]];
[self dismissModalViewControllerAnimated:TRUE];
}];
}