diff --git a/Classes/BlurOverlayView.h b/Classes/DLCBlurOverlayView.h similarity index 79% rename from Classes/BlurOverlayView.h rename to Classes/DLCBlurOverlayView.h index 45e09e2..13c8906 100644 --- a/Classes/BlurOverlayView.h +++ b/Classes/DLCBlurOverlayView.h @@ -1,5 +1,5 @@ // -// BlurOverlayView.h +// DLCBlurOverlayView.h // Backspaces // // Created by Dmitri Cherniak on 11/18/12. @@ -8,7 +8,7 @@ #import -@interface BlurOverlayView : UIView +@interface DLCBlurOverlayView : UIView @property (nonatomic, assign) CGFloat radius; @property (nonatomic, assign) CGPoint circleCenter; diff --git a/Classes/BlurOverlayView.m b/Classes/DLCBlurOverlayView.m similarity index 95% rename from Classes/BlurOverlayView.m rename to Classes/DLCBlurOverlayView.m index 3ebff16..86cd50c 100644 --- a/Classes/BlurOverlayView.m +++ b/Classes/DLCBlurOverlayView.m @@ -1,14 +1,14 @@ // -// BlurOverlayView.m +// DLCBlurOverlayView.m // Backspaces // // Created by Dmitri Cherniak on 11/18/12. // Copyright (c) 2012 DLC Inc. All rights reserved. // -#import "BlurOverlayView.h" +#import "DLCBlurOverlayView.h" -@implementation BlurOverlayView { +@implementation DLCBlurOverlayView { CGRect holeRect; } diff --git a/Classes/GrayscaleContrastFilter.h b/Classes/DLCGrayscaleContrastFilter.h similarity index 86% rename from Classes/GrayscaleContrastFilter.h rename to Classes/DLCGrayscaleContrastFilter.h index aee69cc..65fdba7 100644 --- a/Classes/GrayscaleContrastFilter.h +++ b/Classes/DLCGrayscaleContrastFilter.h @@ -4,7 +4,7 @@ extern NSString *const kGrayscaleContrastFragmentShaderString; /** Converts an image to grayscale (a slightly faster implementation of the saturation filter, without the ability to vary the color contribution) */ -@interface GrayscaleContrastFilter : GPUImageFilter +@interface DLCGrayscaleContrastFilter : GPUImageFilter { GLint intensityUniform; GLint slopeUniform; diff --git a/Classes/GrayscaleContrastFilter.m b/Classes/DLCGrayscaleContrastFilter.m similarity index 94% rename from Classes/GrayscaleContrastFilter.m rename to Classes/DLCGrayscaleContrastFilter.m index 2b9fb47..e6e5cff 100644 --- a/Classes/GrayscaleContrastFilter.m +++ b/Classes/DLCGrayscaleContrastFilter.m @@ -1,6 +1,6 @@ -#import "GrayscaleContrastFilter.h" +#import "DLCGrayscaleContrastFilter.h" -@implementation GrayscaleContrastFilter +@implementation DLCGrayscaleContrastFilter NSString *const kGrayscaleContrastFragmentShaderString = SHADER_STRING ( diff --git a/Classes/DLCImagePickerController.h b/Classes/DLCImagePickerController.h index 5875b35..dc1d256 100644 --- a/Classes/DLCImagePickerController.h +++ b/Classes/DLCImagePickerController.h @@ -8,7 +8,7 @@ #import #import "GPUImage.h" -#import "BlurOverlayView.h" +#import "DLCBlurOverlayView.h" @class DLCImagePickerController; @@ -18,15 +18,7 @@ - (void)imagePickerControllerDidCancel:(DLCImagePickerController *)picker; @end -@interface DLCImagePickerController : UIViewController { - GPUImageStillCamera *stillCamera; - GPUImageOutput *filter; - GPUImageOutput *blurFilter; - GPUImageCropFilter *cropFilter; - GPUImagePicture *staticPicture; - UIImageOrientation staticPictureOriginalOrientation; - -} +@interface DLCImagePickerController : UIViewController @property (nonatomic, weak) IBOutlet GPUImageView *imageView; @property (nonatomic, weak) id delegate; @@ -44,9 +36,10 @@ @property (nonatomic, weak) IBOutlet UIImageView *filtersBackgroundImageView; @property (nonatomic, weak) IBOutlet UIView *photoBar; @property (nonatomic, weak) IBOutlet UIView *topBar; -@property (nonatomic, strong) BlurOverlayView *blurOverlayView; +@property (nonatomic, strong) DLCBlurOverlayView *blurOverlayView; @property (nonatomic, strong) UIImageView *focusView; @property (nonatomic, assign) CGFloat outputJPEGQuality; +@property (nonatomic, assign) CGSize requestedImageSize; @end diff --git a/Classes/DLCImagePickerController.m b/Classes/DLCImagePickerController.m index e5f73e7..d72ab85 100644 --- a/Classes/DLCImagePickerController.m +++ b/Classes/DLCImagePickerController.m @@ -7,14 +7,21 @@ // #import "DLCImagePickerController.h" -#import "GrayscaleContrastFilter.h" +#import "DLCGrayscaleContrastFilter.h" #define kStaticBlurSize 2.0f @implementation DLCImagePickerController { + GPUImageStillCamera *stillCamera; + GPUImageOutput *filter; + GPUImageOutput *blurFilter; + GPUImageCropFilter *cropFilter; + GPUImagePicture *staticPicture; + UIImageOrientation staticPictureOriginalOrientation; BOOL isStatic; BOOL hasBlur; int selectedFilter; + dispatch_once_t showLibraryOnceToken; } @synthesize delegate, @@ -32,20 +39,36 @@ @implementation DLCImagePickerController { photoBar, topBar, blurOverlayView, - outputJPEGQuality; + outputJPEGQuality, + requestedImageSize; --(id) init { - self = [super initWithNibName:@"DLCImagePicker" bundle:nil]; - +-(void) sharedInit { + outputJPEGQuality = 1.0; + requestedImageSize = CGSizeZero; +} + +-(id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { + self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { - self.outputJPEGQuality = 1.0; + [self sharedInit]; } - return self; } -- (void)viewDidLoad -{ +-(id) initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self sharedInit]; + } + return self; +} + +-(id) init { + return [self initWithNibName:@"DLCImagePicker" bundle:nil]; +} + +-(void)viewDidLoad { + [super viewDidLoad]; self.wantsFullScreenLayout = YES; //set background color @@ -67,9 +90,10 @@ - (void)viewDidLoad self.focusView.alpha = 0; - self.blurOverlayView = [[BlurOverlayView alloc] initWithFrame:CGRectMake(0, 0, - self.imageView.frame.size.width, - self.imageView.frame.size.height)]; + self.blurOverlayView = [[DLCBlurOverlayView alloc] initWithFrame:CGRectMake(0, 0, + self.imageView.frame.size.width, + self.imageView.frame.size.height)]; + self.blurOverlayView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.blurOverlayView.alpha = 0; [self.imageView addSubview:self.blurOverlayView]; @@ -92,6 +116,15 @@ -(void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } +-(void) viewDidAppear:(BOOL)animated { + [super viewDidAppear:animated]; + if (![UIImagePickerController isSourceTypeAvailable: UIImagePickerControllerSourceTypeCamera]) { + dispatch_once(&showLibraryOnceToken, ^{ + [self switchToLibrary:nil]; + }); + } +} + -(void) loadFilters { for(int i = 0; i < 10; i++) { UIButton * button = [UIButton buttonWithType:UIButtonTypeCustom]; @@ -144,9 +177,14 @@ -(void) setUpCamera { [self prepareFilter]; }); } else { - // No camera - NSLog(@"No camera"); runOnMainQueueWithoutDeadlocking(^{ + // No camera awailable, hide camera related buttons and show the image picker + self.cameraToggleButton.hidden = YES; + self.photoCaptureButton.hidden = YES; + self.flashToggleButton.hidden = YES; + // Show the library picker +// [self switchToLibrary:nil]; +// [self performSelector:@selector(switchToLibrary:) withObject:nil afterDelay:0.5]; [self prepareFilter]; }); } @@ -182,7 +220,7 @@ -(void) setFilter:(int) index { filter = [[GPUImageToneCurveFilter alloc] initWithACV:@"02"]; } break; case 4: { - filter = [[GrayscaleContrastFilter alloc] init]; + filter = [[DLCGrayscaleContrastFilter alloc] init]; } break; case 5: { filter = [[GPUImageToneCurveFilter alloc] initWithACV:@"17"]; @@ -236,11 +274,6 @@ -(void) prepareLiveFilter { -(void) prepareStaticFilter { - if (!staticPicture) { - // TODO: fix this hack - [self performSelector:@selector(switchToLibrary:) withObject:nil afterDelay:0.5]; - } - [staticPicture addTarget:filter]; // blur is terminal filter @@ -272,7 +305,7 @@ -(void) prepareStaticFilter { [self.imageView setInputRotation:imageViewRotationMode atIndex:0]; - [staticPicture processImage]; + [staticPicture processImage]; } -(void) removeAllTargets { @@ -324,6 +357,9 @@ -(IBAction) toggleBlur:(UIButton*)blurButton { [(GPUImageGaussianSelectiveBlurFilter*)blurFilter setAspectRatio:1.0f]; } hasBlur = YES; + CGPoint excludePoint = [(GPUImageGaussianSelectiveBlurFilter*)blurFilter excludeCirclePoint]; + CGSize frameSize = self.blurOverlayView.frame.size; + self.blurOverlayView.circleCenter = CGPointMake(excludePoint.x * frameSize.width, excludePoint.y * frameSize.height); [self.blurToggleButton setSelected:YES]; [self flashBlurOverlay]; } @@ -362,23 +398,53 @@ -(void) prepareForCapture { -(void)captureImage { - UIImage *img = [cropFilter imageFromCurrentlyProcessedOutput]; - [stillCamera.inputCamera unlockForConfiguration]; - [stillCamera stopCameraCapture]; - [self removeAllTargets]; - staticPicture = [[GPUImagePicture alloc] initWithImage:img - smoothlyScaleOutput:YES]; + void (^completion)(UIImage *, NSError *) = ^(UIImage *img, NSError *error) { + + [stillCamera.inputCamera unlockForConfiguration]; + [stillCamera stopCameraCapture]; + [self removeAllTargets]; + + staticPicture = [[GPUImagePicture alloc] initWithImage:img smoothlyScaleOutput:NO]; + staticPictureOriginalOrientation = img.imageOrientation; + + [self prepareFilter]; + [self.retakeButton setHidden:NO]; + [self.photoCaptureButton setTitle:@"Done" forState:UIControlStateNormal]; + [self.photoCaptureButton setImage:nil forState:UIControlStateNormal]; + [self.photoCaptureButton setEnabled:YES]; + if(![self.filtersToggleButton isSelected]){ + [self showFilters]; + } + }; - staticPictureOriginalOrientation = img.imageOrientation; - [self prepareFilter]; - [self.retakeButton setHidden:NO]; - [self.photoCaptureButton setTitle:@"Done" forState:UIControlStateNormal]; - [self.photoCaptureButton setImage:nil forState:UIControlStateNormal]; - [self.photoCaptureButton setEnabled:YES]; - if(![self.filtersToggleButton isSelected]){ - [self showFilters]; + AVCaptureDevicePosition currentCameraPosition = stillCamera.inputCamera.position; + Class contextClass = NSClassFromString(@"GPUImageContext") ?: NSClassFromString(@"GPUImageOpenGLESContext"); + if ((currentCameraPosition != AVCaptureDevicePositionFront) || (![contextClass supportsFastTextureUpload])) { + // Image full-resolution capture is currently possible just on the final (destination filter), so + // create a new paralel chain, that crops and resizes our image + [self removeAllTargets]; + + GPUImageCropFilter *captureCrop = [[GPUImageCropFilter alloc] initWithCropRegion:cropFilter.cropRegion]; + [stillCamera addTarget:captureCrop]; + GPUImageFilter *finalFilter = captureCrop; + + if (!CGSizeEqualToSize(requestedImageSize, CGSizeZero)) { + GPUImageFilter *captureResize = [[GPUImageFilter alloc] init]; + [captureResize forceProcessingAtSize:requestedImageSize]; + [captureCrop addTarget:captureResize]; + finalFilter = captureResize; + } + + [finalFilter prepareForImageCapture]; + + [stillCamera capturePhotoAsImageProcessedUpToFilter:finalFilter withCompletionHandler:completion]; + } else { + // A workaround inside capturePhotoProcessedUpToFilter:withImageOnGPUHandler: would cause the above method to fail, + // so we just grap the current crop filter output as an aproximation (the size won't match trough) + UIImage *img = [cropFilter imageFromCurrentlyProcessedOutput]; + completion(img, nil); } } @@ -560,7 +626,7 @@ -(void) showFilters { self.filtersBackgroundImageView.hidden = NO; [UIView animateWithDuration:0.10 delay:0.05 - options: UIViewAnimationCurveEaseOut + options: UIViewAnimationOptionCurveEaseOut animations:^{ self.imageView.frame = imageRect; self.filterScrollView.frame = sliderScrollFrame; @@ -583,7 +649,7 @@ -(void) hideFilters { [UIView animateWithDuration:0.10 delay:0.05 - options: UIViewAnimationCurveEaseOut + options: UIViewAnimationOptionCurveEaseOut animations:^{ self.imageView.frame = imageRect; self.filterScrollView.frame = sliderScrollFrame; @@ -670,6 +736,7 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking [self.cameraToggleButton setEnabled:NO]; [self.flashToggleButton setEnabled:NO]; [self prepareStaticFilter]; + [self.photoCaptureButton setHidden:NO]; [self.photoCaptureButton setTitle:@"Done" forState:UIControlStateNormal]; [self.photoCaptureButton setImage:nil forState:UIControlStateNormal]; [self.photoCaptureButton setEnabled:YES]; @@ -681,12 +748,8 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking } - (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker { - if (isStatic) { - // TODO: fix this hack - [self dismissViewControllerAnimated:NO completion:nil]; - [self.delegate imagePickerControllerDidCancel:self]; - } else { - [self dismissViewControllerAnimated:YES completion:nil]; + [self dismissViewControllerAnimated:YES completion:nil]; + if (!isStatic) { [self retakePhoto:nil]; } } diff --git a/DLCImagePickerController.podspec b/DLCImagePickerController.podspec new file mode 100644 index 0000000..7c97329 --- /dev/null +++ b/DLCImagePickerController.podspec @@ -0,0 +1,34 @@ +Pod::Spec.new do |s| + s.name = "DLCImagePickerController" + s.version = "0.0.1" + s.summary = "ImagePickerController with live filters, radial blur and more. Brought to you by the fine ladies and gents at Backspaces." + s.description = <<-DESC + DLCImagePickerController is a fast, beautiful and fun way to filter and capture your photos with OpenGL and your iPhone. + The majority of the praise should be directed towards BradLarson for his GPUImage library. + DESC + s.homepage = "www.backspac.es" + s.license = 'BSD' + s.author = { "Dmitri Cherniak" => "dmitric@gmail.com" } + s.source = { :git => "https://github.com/gobackspaces/DLCImagePickerController.git", :tag => "0.0.1" } + s.platform = :ios, '5.0' + s.requires_arc = true + s.framework = 'AssetsLibrary' + + s.subspec 'Core' do |sp| + sp.source_files = 'Classes' + sp.resources = "Images/{UI,Overlays}/*.png" + sp.dependency 'GPUImage' + end + + s.subspec 'Filters' do |sp| + sp.resources = "Resources/Filters/*.acv" + end + + s.subspec 'UI' do |sp| + sp.resources = "Resources/*.xib" + end + + s.subspec 'FilterSamples' do |sp| + sp.resources = "Images/FilterSamples/*.jpg" + end +end \ No newline at end of file diff --git a/DLCImagePickerController.xcodeproj/project.pbxproj b/DLCImagePickerController.xcodeproj/project.pbxproj index 5d4c0b6..09203f4 100644 --- a/DLCImagePickerController.xcodeproj/project.pbxproj +++ b/DLCImagePickerController.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 6A0D0A01165A1CBE0028E1B6 /* BlurOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D0A00165A1CBE0028E1B6 /* BlurOverlayView.m */; }; + 6A0D0A01165A1CBE0028E1B6 /* DLCBlurOverlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6A0D0A00165A1CBE0028E1B6 /* DLCBlurOverlayView.m */; }; 6A0D0A0F165A1FFC0028E1B6 /* focus-crosshair.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D0A0D165A1FFC0028E1B6 /* focus-crosshair.png */; }; 6A0D0A10165A1FFC0028E1B6 /* focus-crosshair@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D0A0E165A1FFC0028E1B6 /* focus-crosshair@2x.png */; }; 6A0D0A28165A218F0028E1B6 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 6A0D0A27165A218F0028E1B6 /* Default-568h@2x.png */; }; @@ -86,7 +86,7 @@ 6A5D9AAA15E0259A001FAD14 /* DLCImagePicker.xib in Resources */ = {isa = PBXBuildFile; fileRef = 6A5D9AA915E0259A001FAD14 /* DLCImagePicker.xib */; }; 7D0E5AB315E203FA009D19C9 /* purple-green.acv in Resources */ = {isa = PBXBuildFile; fileRef = 7D0E5AB115E203FA009D19C9 /* purple-green.acv */; }; 7D0E5AB415E203FA009D19C9 /* yellow-red.acv in Resources */ = {isa = PBXBuildFile; fileRef = 7D0E5AB215E203FA009D19C9 /* yellow-red.acv */; }; - 7D0E5AB815E209AD009D19C9 /* GrayscaleContrastFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0E5AB715E209AD009D19C9 /* GrayscaleContrastFilter.m */; }; + 7D0E5AB815E209AD009D19C9 /* DLCGrayscaleContrastFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 7D0E5AB715E209AD009D19C9 /* DLCGrayscaleContrastFilter.m */; }; 7D1E64B915E1FA2F005A9E09 /* crossprocess.acv in Resources */ = {isa = PBXBuildFile; fileRef = 7D1E64B715E1FA2F005A9E09 /* crossprocess.acv */; }; 7DEB4DC615E063420078BFAD /* sample1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 7DEB4DC515E063420078BFAD /* sample1.jpg */; }; 7DFAE1BA15E22A9F00C8236F /* aqua.acv in Resources */ = {isa = PBXBuildFile; fileRef = 7DFAE1B915E22A9F00C8236F /* aqua.acv */; }; @@ -117,8 +117,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 6A0D09FF165A1CBE0028E1B6 /* BlurOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlurOverlayView.h; sourceTree = ""; }; - 6A0D0A00165A1CBE0028E1B6 /* BlurOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlurOverlayView.m; sourceTree = ""; }; + 6A0D09FF165A1CBE0028E1B6 /* DLCBlurOverlayView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLCBlurOverlayView.h; sourceTree = ""; }; + 6A0D0A00165A1CBE0028E1B6 /* DLCBlurOverlayView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLCBlurOverlayView.m; sourceTree = ""; }; 6A0D0A0D165A1FFC0028E1B6 /* focus-crosshair.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "focus-crosshair.png"; sourceTree = ""; }; 6A0D0A0E165A1FFC0028E1B6 /* focus-crosshair@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "focus-crosshair@2x.png"; sourceTree = ""; }; 6A0D0A27165A218F0028E1B6 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "Default-568h@2x.png"; path = "../Default-568h@2x.png"; sourceTree = ""; }; @@ -203,8 +203,8 @@ 6A5D9AA915E0259A001FAD14 /* DLCImagePicker.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = DLCImagePicker.xib; sourceTree = ""; }; 7D0E5AB115E203FA009D19C9 /* purple-green.acv */ = {isa = PBXFileReference; lastKnownFileType = file; name = "purple-green.acv"; path = "Filters/purple-green.acv"; sourceTree = ""; }; 7D0E5AB215E203FA009D19C9 /* yellow-red.acv */ = {isa = PBXFileReference; lastKnownFileType = file; name = "yellow-red.acv"; path = "Filters/yellow-red.acv"; sourceTree = ""; }; - 7D0E5AB615E2099C009D19C9 /* GrayscaleContrastFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrayscaleContrastFilter.h; sourceTree = ""; }; - 7D0E5AB715E209AD009D19C9 /* GrayscaleContrastFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrayscaleContrastFilter.m; sourceTree = ""; }; + 7D0E5AB615E2099C009D19C9 /* DLCGrayscaleContrastFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DLCGrayscaleContrastFilter.h; sourceTree = ""; }; + 7D0E5AB715E209AD009D19C9 /* DLCGrayscaleContrastFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DLCGrayscaleContrastFilter.m; sourceTree = ""; }; 7D1E64B715E1FA2F005A9E09 /* crossprocess.acv */ = {isa = PBXFileReference; lastKnownFileType = file; name = crossprocess.acv; path = Filters/crossprocess.acv; sourceTree = ""; }; 7DEB4DC515E063420078BFAD /* sample1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = sample1.jpg; path = Samples/sample1.jpg; sourceTree = ""; }; 7DFAE1B915E22A9F00C8236F /* aqua.acv */ = {isa = PBXFileReference; lastKnownFileType = file; name = aqua.acv; path = Filters/aqua.acv; sourceTree = ""; }; @@ -269,6 +269,7 @@ 6A5D9A1115E0152D001FAD14 /* Products */, ); sourceTree = ""; + usesTabs = 0; }; 6A5D9A1115E0152D001FAD14 /* Products */ = { isa = PBXGroup; @@ -329,13 +330,9 @@ 6A5D9A8515E02429001FAD14 /* Classes */ = { isa = PBXGroup; children = ( - 6A0D09FF165A1CBE0028E1B6 /* BlurOverlayView.h */, - 6A0D0A00165A1CBE0028E1B6 /* BlurOverlayView.m */, - 7D0E5AB515E20987009D19C9 /* Filters */, + D2506222176226B4009DAE39 /* DLCImagePickerViewController */, 6A5D9A8915E02504001FAD14 /* PhotoViewController.h */, 6A5D9A8A15E02504001FAD14 /* PhotoViewController.m */, - 6A5D9A8615E02429001FAD14 /* DLCImagePickerController.h */, - 6A5D9A8715E02429001FAD14 /* DLCImagePickerController.m */, ); path = Classes; sourceTree = ""; @@ -413,8 +410,8 @@ 7D0E5AB515E20987009D19C9 /* Filters */ = { isa = PBXGroup; children = ( - 7D0E5AB615E2099C009D19C9 /* GrayscaleContrastFilter.h */, - 7D0E5AB715E209AD009D19C9 /* GrayscaleContrastFilter.m */, + 7D0E5AB615E2099C009D19C9 /* DLCGrayscaleContrastFilter.h */, + 7D0E5AB715E209AD009D19C9 /* DLCGrayscaleContrastFilter.m */, ); name = Filters; sourceTree = ""; @@ -441,6 +438,18 @@ name = Samples; sourceTree = ""; }; + D2506222176226B4009DAE39 /* DLCImagePickerViewController */ = { + isa = PBXGroup; + children = ( + 6A5D9A8615E02429001FAD14 /* DLCImagePickerController.h */, + 6A5D9A8715E02429001FAD14 /* DLCImagePickerController.m */, + 6A0D09FF165A1CBE0028E1B6 /* DLCBlurOverlayView.h */, + 6A0D0A00165A1CBE0028E1B6 /* DLCBlurOverlayView.m */, + 7D0E5AB515E20987009D19C9 /* Filters */, + ); + name = DLCImagePickerViewController; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -468,7 +477,7 @@ 6A5D9A0715E0152D001FAD14 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0460; ORGANIZATIONNAME = "Backspaces Inc"; }; buildConfigurationList = 6A5D9A0A15E0152D001FAD14 /* Build configuration list for PBXProject "DLCImagePickerController" */; @@ -597,8 +606,8 @@ 6A5D9A2515E0152E001FAD14 /* AppDelegate.m in Sources */, 6A5D9A8815E02429001FAD14 /* DLCImagePickerController.m in Sources */, 6A5D9A8B15E02504001FAD14 /* PhotoViewController.m in Sources */, - 7D0E5AB815E209AD009D19C9 /* GrayscaleContrastFilter.m in Sources */, - 6A0D0A01165A1CBE0028E1B6 /* BlurOverlayView.m in Sources */, + 7D0E5AB815E209AD009D19C9 /* DLCGrayscaleContrastFilter.m in Sources */, + 6A0D0A01165A1CBE0028E1B6 /* DLCBlurOverlayView.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -630,6 +639,10 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; GCC_C_LANGUAGE_STANDARD = gnu99; @@ -656,6 +669,10 @@ ALWAYS_SEARCH_USER_PATHS = NO; ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = YES; GCC_C_LANGUAGE_STANDARD = gnu99; diff --git a/GPUImage b/GPUImage index 56cec4d..a29f15a 160000 --- a/GPUImage +++ b/GPUImage @@ -1 +1 @@ -Subproject commit 56cec4d61714549220c627da67c19a6a4e2a1d45 +Subproject commit a29f15a72528e152892f6245abb2f37271fa5a70 diff --git a/Resources/DLCImagePicker.xib b/Resources/DLCImagePicker.xib index 4720860..8f96625 100644 --- a/Resources/DLCImagePicker.xib +++ b/Resources/DLCImagePicker.xib @@ -1,14 +1,14 @@ - 1536 - 12C60 - 2843 - 1187.34 - 625.00 + 1552 + 12E55 + 3084 + 1187.39 + 626.00 com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 1929 + 2083 IBProxyObject @@ -138,6 +138,7 @@ {{263, 3}, {65, 37}} + _NS:9 NO IBCocoaTouchFramework @@ -779,17 +780,60 @@ DLCImagePickerController UIViewController - - handlePinch: - UIPinchGestureRecognizer - - - handlePinch: - + + id + UIGestureRecognizer + UIPinchGestureRecognizer + UITapGestureRecognizer + UIButton + id + id + UIButton + UIButton + UIButton + + + + cancel: + id + + + handlePan: + UIGestureRecognizer + + handlePinch: UIPinchGestureRecognizer - + + handleTapToFocus: + UITapGestureRecognizer + + + retakePhoto: + UIButton + + + switchToLibrary: + id + + + takePhoto: + id + + + toggleBlur: + UIButton + + + toggleFilters: + UIButton + + + toggleFlash: + UIButton + + UIButton UIButton @@ -892,6 +936,6 @@ {48, 24} {28, 28} - 1929 + 2083