Skip to content

Commit

Permalink
fix blur size property removed from gpuimage.
Browse files Browse the repository at this point in the history
gpuimage has removed blurSize property, I just change it to the new one
in order to work with the last stable gpuimage release, 0.1.2. See the
issue reported here:
dmitric#45.
  • Loading branch information
nebiros committed Dec 19, 2013
1 parent 098806d commit 08ad0e1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Classes/DLCImagePickerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ -(IBAction) toggleBlur:(UIButton*)blurButton {
blurFilter = [[GPUImageGaussianSelectiveBlurFilter alloc] init];
[(GPUImageGaussianSelectiveBlurFilter*)blurFilter setExcludeCircleRadius:80.0/320.0];
[(GPUImageGaussianSelectiveBlurFilter*)blurFilter setExcludeCirclePoint:CGPointMake(0.5f, 0.5f)];
[(GPUImageGaussianSelectiveBlurFilter*)blurFilter setBlurSize:kStaticBlurSize];
[(GPUImageGaussianSelectiveBlurFilter*)blurFilter setBlurRadiusInPixels:kStaticBlurSize];
[(GPUImageGaussianSelectiveBlurFilter*)blurFilter setAspectRatio:1.0f];
}
hasBlur = YES;
Expand Down Expand Up @@ -518,20 +518,20 @@ -(IBAction) handlePan:(UIGestureRecognizer *) sender {

if ([sender state] == UIGestureRecognizerStateBegan) {
[self showBlurOverlay:YES];
[gpu setBlurSize:0.0f];
[gpu setBlurRadiusInPixels:0.0f];
if (isStatic) {
[staticPicture processImage];
}
}

if ([sender state] == UIGestureRecognizerStateBegan || [sender state] == UIGestureRecognizerStateChanged) {
[gpu setBlurSize:0.0f];
[gpu setBlurRadiusInPixels:0.0f];
[self.blurOverlayView setCircleCenter:tapPoint];
[gpu setExcludeCirclePoint:CGPointMake(tapPoint.x/320.0f, tapPoint.y/320.0f)];
}

if([sender state] == UIGestureRecognizerStateEnded){
[gpu setBlurSize:kStaticBlurSize];
[gpu setBlurRadiusInPixels:kStaticBlurSize];
[self showBlurOverlay:NO];
if (isStatic) {
[staticPicture processImage];
Expand Down Expand Up @@ -585,14 +585,14 @@ -(IBAction) handlePinch:(UIPinchGestureRecognizer *) sender {

if ([sender state] == UIGestureRecognizerStateBegan) {
[self showBlurOverlay:YES];
[gpu setBlurSize:0.0f];
[gpu setBlurRadiusInPixels:0.0f];
if (isStatic) {
[staticPicture processImage];
}
}

if ([sender state] == UIGestureRecognizerStateBegan || [sender state] == UIGestureRecognizerStateChanged) {
[gpu setBlurSize:0.0f];
[gpu setBlurRadiusInPixels:0.0f];
[gpu setExcludeCirclePoint:CGPointMake(midpoint.x/320.0f, midpoint.y/320.0f)];
self.blurOverlayView.circleCenter = CGPointMake(midpoint.x, midpoint.y);
CGFloat radius = MAX(MIN(sender.scale*[gpu excludeCircleRadius], 0.6f), 0.15f);
Expand All @@ -602,7 +602,7 @@ -(IBAction) handlePinch:(UIPinchGestureRecognizer *) sender {
}

if ([sender state] == UIGestureRecognizerStateEnded) {
[gpu setBlurSize:kStaticBlurSize];
[gpu setBlurRadiusInPixels:kStaticBlurSize];
[self showBlurOverlay:NO];
if (isStatic) {
[staticPicture processImage];
Expand Down

0 comments on commit 08ad0e1

Please sign in to comment.