├── .cocoadocs.yml ├── .gitignore ├── .travis.yml ├── ImageFilters.podspec ├── ImageFilters ├── CIBlueMoodFilter.h ├── CIBlueMoodFilter.m ├── CIFilter+Filter.h ├── CIFilter+Filter.m ├── CIImage+Filter.h ├── CIImage+Filter.m ├── ImageFilter.h ├── ImageFilter.m ├── ImageFilterCache.h ├── ImageFilterCache.m ├── Images │ ├── crossprocess.png │ ├── crossprocess@2x.png │ ├── magichour.png │ ├── magichour@2x.png │ ├── toycamera.png │ └── toycamera@2x.png ├── NGFilterConstructor.h ├── NGFilterConstructor.m ├── NGFilterStore.h ├── NGFilterStore.m ├── Platforms.h ├── UIImage+Filter.h ├── UIImage+Filter.m └── examples │ ├── Mac │ ├── ImageFilterExample.xcodeproj │ │ └── project.pbxproj │ ├── ImageFilterExample │ │ ├── Base.lproj │ │ │ └── MainMenu.xib │ │ ├── ImageFilterExample-Info.plist │ │ ├── ImageFilterExample-Prefix.pch │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ ├── NGAppDelegate.h │ │ ├── NGAppDelegate.m │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ └── ImageFilterExampleTests │ │ ├── ImageFilterExampleTests-Info.plist │ │ ├── ImageFilterExampleTests.m │ │ └── en.lproj │ │ └── InfoPlist.strings │ ├── iOS │ ├── ImageFilterExample.xcodeproj │ │ └── project.pbxproj │ ├── ImageFilterExample │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── AppDelegate.xib │ │ ├── ImageFilterExample-Info.plist │ │ ├── ImageFilterExample-Prefix.pch │ │ ├── Images │ │ │ ├── Default-568h@2x.png │ │ │ ├── north-park_sunflower.png │ │ │ ├── north-park_sunflower@2x.png │ │ │ └── north-park_sunflower_flipped.png │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ ├── ViewController.xib │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ ├── ImageFilterExampleTests │ │ ├── ImageFilterExampleTests.m │ │ └── Info.plist │ └── Podfile │ ├── iOS_Touch_Response │ ├── CoreFilter │ │ ├── Base.lproj │ │ │ └── Main.storyboard │ │ ├── CoreFilter-Info.plist │ │ ├── CoreFilter-Prefix.pch │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── LaunchImage.launchimage │ │ │ │ └── Contents.json │ │ ├── NGAppDelegate.h │ │ ├── NGAppDelegate.m │ │ ├── NGFilter.h │ │ ├── NGFilter.m │ │ ├── NGLayer.h │ │ ├── NGLayer.m │ │ ├── NGViewController.h │ │ ├── NGViewController.m │ │ ├── chung.jpg │ │ ├── en.lproj │ │ │ └── InfoPlist.strings │ │ └── main.m │ ├── CoreFilterTests │ │ ├── CoreFilterTests-Info.plist │ │ ├── CoreFilterTests.m │ │ └── en.lproj │ │ │ └── InfoPlist.strings │ └── ImageFilterExample.xcodeproj │ │ └── project.pbxproj │ ├── north-park_sunflower.png │ └── north-park_sunflower@2x.png ├── LICENSE ├── README.md └── Rakefile /.cocoadocs.yml: -------------------------------------------------------------------------------- 1 | highlight-color: "#F89915" 2 | highlight-dark-color: "#E23B1B" 3 | darker-color: "#D8A688" 4 | darker-dark-color: "#E93D1C" 5 | background-color: "#E9DFDB" 6 | alt-link-color: "#E23B1B" 7 | warning-color: "#E23B1B" 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | xcuserdata 3 | *.lock 4 | *.xcworkspace 5 | ImageFilters/examples/*/*/*.xcodeproj/xcuserdata/* 6 | ImageFilters/examples/iOS/Pods/ 7 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | before_install: 3 | - gem install cocoapods --no-rdoc --no-ri --no-document --quiet 4 | - gem install xcpretty --no-rdoc --no-ri --no-document --quiet 5 | - cd Tests && pod install && cd $TRAVIS_BUILD_DIR 6 | script: rake test 7 | 8 | -------------------------------------------------------------------------------- /ImageFilters.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint ImageFilters.podspec' to ensure this is a 3 | # valid spec and remove all comments before submitting the spec. 4 | # 5 | # Any lines starting with a # are optional, but encouraged 6 | # 7 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 8 | # 9 | 10 | Pod::Spec.new do |s| 11 | s.name = "ImageFilters" 12 | s.version = "0.3.0" 13 | s.summary = "High-level image/photo filtering on iOS & Mac" 14 | s.homepage = "https://github.com/jameswomack/iOS-Image-Filters" 15 | s.license = 'MIT' 16 | s.author = { "James Womack" => "jwomack@netflix.com" } 17 | s.source = { :git => "https://github.com/jameswomack/iOS-Image-Filters.git", :tag => s.version.to_s } 18 | s.social_media_url = 'https://twitter.com/james_womack' 19 | 20 | s.platform = :ios, '7.0' 21 | s.requires_arc = true 22 | 23 | s.source_files = 'ImageFilters/*.[hm]' 24 | s.public_header_files = 'ImageFilters/*.h' 25 | 26 | s.resources = ["ImageFilters/Images/*.png"] 27 | 28 | s.frameworks = 'UIKit', 'Accelerate', 'CoreImage' 29 | end 30 | -------------------------------------------------------------------------------- /ImageFilters/CIBlueMoodFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CIBlueMoodFilter.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import "Platforms.h" 9 | 10 | @interface CIBlueMoodFilter : CIFilter 11 | #if isDesktop 12 | 13 | #endif 14 | 15 | - (CIFilter *)filterWithName:(NSString *)name; 16 | 17 | @property (nonatomic, readwrite) CIImage *inputImage; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ImageFilters/CIBlueMoodFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CIBlueMoodFilter.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import "CIBlueMoodFilter.h" 9 | #import "UIImage+Filter.h" 10 | #import "CIImage+Filter.h" 11 | #import "ImageFilter.h" 12 | 13 | @implementation CIBlueMoodFilter 14 | 15 | - (CIImage *)outputImage { 16 | CIImage *image = [self valueForKey:kCIInputImageKey]; 17 | NGImage *uiImage = [image UIImage]; 18 | uiImage = [uiImage filter:@"CIFalseColor" 19 | params:@{@"inputColor0":[CIColor colorWithRed:.0 green:.0 blue:1.0 alpha:1.0], @"inputColor1": [CIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]}]; 20 | 21 | CIImage *ciImage = uiImage.ng_CIImage; 22 | return ciImage; 23 | } 24 | 25 | - (CIFilter *)filterWithName:(NSString *)__unused name { 26 | return self.class.new; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /ImageFilters/CIFilter+Filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CIFilter+Filter.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "Platforms.h" 9 | 10 | @interface CIFilter (Filter) 11 | + (CIFilter *)withName:(NSString *)name andImage:(NGImage *)image; 12 | + (CIFilter *)withName:(NSString *)name andCIImage:(CIImage *)image; 13 | - (NSDictionary*)editableAttributes; 14 | #if isDesktop 15 | - (CIImage *)outputImage; 16 | #else 17 | + (void)registerFilterName:(NSString *)name 18 | constructor:(id)anObject 19 | classAttributes:(NSDictionary *)attributes; 20 | #endif 21 | @end 22 | -------------------------------------------------------------------------------- /ImageFilters/CIFilter+Filter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CIFilter+Filter.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "CIFilter+Filter.h" 9 | #import "UIImage+Filter.h" 10 | #import "NGFilterStore.h" 11 | #import 12 | 13 | #define UNEDITABLE_KEYS @"CIAttributeFilterCategories",@"CIAttributeFilterDisplayName",@"inputImage",@"outputImage" 14 | 15 | @implementation CIFilter (Filter) 16 | 17 | + (CIFilter *)withName:(NSString *)name andImage:(NGImage *)image { 18 | CIFilter *filter = [self filterWithName:name]; 19 | 20 | CIImage *ciImage = image.ng_CIImage; 21 | 22 | [filter setValue:ciImage forKey:kCIInputImageKey]; 23 | return filter; 24 | } 25 | 26 | + (CIFilter *)withName:(NSString *)name andCIImage:(CIImage *)image { 27 | CIFilter *filter = [self filterWithName:name]; 28 | [filter setValue:image forKey:kCIInputImageKey]; 29 | return filter; 30 | } 31 | 32 | - (NSDictionary*)editableAttributes 33 | { 34 | NSSet *uneditableAttributes = [NSSet setWithObjects:UNEDITABLE_KEYS,nil]; 35 | 36 | NSMutableDictionary *editableAttributes = self.attributes.mutableCopy; 37 | 38 | for (NSString *key in self.attributes) { 39 | if ([uneditableAttributes containsObject:key] 40 | || ![self.attributes[key] isKindOfClass:NSDictionary.class]) 41 | [editableAttributes removeObjectForKey:key]; 42 | } 43 | 44 | return editableAttributes; 45 | } 46 | 47 | #if isDesktop 48 | - (CIImage *)outputImage { 49 | return [self valueForKey:kCIOutputImageKey]; 50 | } 51 | #else 52 | 53 | void swizzle(Class class, SEL originalSelector, SEL swizzledSelector); 54 | void swizzle(Class class, SEL originalSelector, SEL swizzledSelector) { 55 | Method originalMethod = class_getClassMethod(class, originalSelector); 56 | Method swizzledMethod = class_getClassMethod(class, swizzledSelector); 57 | 58 | BOOL didAddMethod = 59 | class_addMethod(class, 60 | originalSelector, 61 | method_getImplementation(swizzledMethod), 62 | method_getTypeEncoding(swizzledMethod)); 63 | 64 | if (didAddMethod) { 65 | class_replaceMethod(class, 66 | swizzledSelector, 67 | method_getImplementation(originalMethod), 68 | method_getTypeEncoding(originalMethod)); 69 | } else { 70 | method_exchangeImplementations(originalMethod, swizzledMethod); 71 | } 72 | } 73 | 74 | + (void)load { 75 | static dispatch_once_t onceToken; 76 | dispatch_once(&onceToken, ^{ 77 | Class class = object_getClass((id)self); 78 | 79 | swizzle(class, @selector(filterWithName:), @selector(Filter_filterWithName:)); 80 | }); 81 | } 82 | 83 | + (CIFilter *)Filter_filterWithName:(NSString *)name { 84 | CIFilter *filter = nil; 85 | 86 | if (!(filter = [self Filter_filterWithName:name])) { 87 | filter = [NGFilterStore filterWithName:name]; 88 | } 89 | 90 | return filter; 91 | } 92 | 93 | + (void)registerFilterName:(NSString *)name 94 | constructor:(id)anObject 95 | classAttributes:(NSDictionary *)attributes { 96 | return [NGFilterStore registerFilterName:name constructor:anObject classAttributes:attributes];; 97 | } 98 | #endif 99 | 100 | @end 101 | -------------------------------------------------------------------------------- /ImageFilters/CIImage+Filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // CIImage+Filter.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "Platforms.h" 9 | 10 | @interface CIImage (Filter) 11 | - (NGImage *)UIImage; 12 | - (NGImage *)UIImageFromExtent:(CGRect)extent; 13 | - (CIImage *)croppedForRadius:(float)radius; 14 | - (CIImage*)ng_imageByClampingToExtent; 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/CIImage+Filter.m: -------------------------------------------------------------------------------- 1 | // 2 | // CIImage+Filter.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "Platforms.h" 9 | #import "CIImage+Filter.h" 10 | #import "CIFilter+Filter.h" 11 | 12 | @implementation CIImage (Filter) 13 | 14 | - (NGImage *)UIImage { 15 | return [self UIImageFromExtent:self.extent]; 16 | } 17 | 18 | - (NGImage *)UIImageFromExtent:(CGRect)extent { 19 | CGImageRef cgImage; 20 | NGImage *image; 21 | CIImage *ciImage = self; 22 | 23 | #if isDesktop 24 | BOOL infinite = CGRectIsInfinite(self.extent); 25 | if(infinite) { 26 | CIVector *inputRectangle = [CIVector vectorWithCGRect:extent]; 27 | ciImage = [CIFilter filterWithName:@"CICrop" keysAndValues:kCIInputImageKey, ciImage, @"inputRectangle", inputRectangle, nil].outputImage; 28 | } 29 | NSBitmapImageRep *rep = [NSBitmapImageRep.alloc initWithCIImage:ciImage]; 30 | cgImage = rep.CGImage; 31 | image = [[NGImage alloc] initWithCGImage:cgImage size:extent.size]; 32 | 33 | #else 34 | CIContext *context = [CIContext contextWithOptions:@{kCIContextUseSoftwareRenderer: @NO}]; 35 | cgImage = [context createCGImage:ciImage fromRect:extent]; 36 | image = [NGImage imageWithCGImage:cgImage scale:UIScreen.mainScreen.scale orientation:UIImageOrientationUp]; 37 | CGImageRelease(cgImage); 38 | 39 | #endif 40 | 41 | return image; 42 | } 43 | 44 | - (CIImage *)croppedForRadius:(float)radius { 45 | CIImage *image = [self ng_imageByClampingToExtent]; 46 | 47 | CGRect extent = image.extent; 48 | 49 | CGRect cropRect = (CGRect){ 50 | .origin.x = extent.origin.x + radius, 51 | .origin.y = extent.origin.y + radius, 52 | .size.width = extent.size.width - radius*2, 53 | .size.height = extent.size.height - radius*2 54 | }; 55 | 56 | return [image imageByCroppingToRect:cropRect]; 57 | } 58 | 59 | - (CIImage*)ng_imageByClampingToExtent { 60 | CGAffineTransform transform = CGAffineTransformIdentity; 61 | CIFilter *clamp = [CIFilter filterWithName:@"CIAffineClamp"]; 62 | [clamp setValue:[NSValue valueWithBytes:&transform 63 | objCType:@encode(CGAffineTransform)] 64 | forKey:@"inputTransform"]; 65 | [clamp setValue:self forKey:kCIInputImageKey]; 66 | return [clamp valueForKey:kCIOutputImageKey]; 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /ImageFilters/ImageFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilter.h 3 | // 4 | // Created by James Womack on 08/23/11. 5 | // Copyright 2011 Cirrostratus Co. 6 | // 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import 11 | #import "Platforms.h" 12 | 13 | 14 | typedef enum { 15 | IFResizeCrop, // analogous to UIViewContentModeScaleAspectFill, i.e. "best fit" with no space around. 16 | IFResizeCropStart, 17 | IFResizeCropEnd, 18 | IFResizeScale // analogous to UIViewContentModeScaleAspectFit, i.e. scale down to fit, leaving space around if necessary. 19 | } IFResizingMethod; 20 | 21 | @protocol NGFilterProtocol 22 | 23 | /* Filters */ 24 | @optional 25 | - (NGImage *)sharpify; 26 | - (NGImage*)sepia; 27 | - (NGImage*)invert; 28 | - (NGImage*)vibrant:(float)amount; 29 | - (NGImage*)colorize:(float)amount; 30 | - (NGImage*)brightness:(float)amount; 31 | - (NGImage*)exposure:(float)amount; 32 | - (NGImage*)contrast:(float)amount; 33 | - (NGImage*)edges:(float)amount; 34 | - (NGImage*)gamma:(float)amount; 35 | - (NGImage*)blueMood; 36 | - (NGImage*)erode; 37 | - (NGImage*)sunkissed; 38 | - (NGImage*)blackAndWhite; 39 | - (NGImage*)crossProcess; 40 | - (NGImage*)polarize; 41 | - (NGImage*)magichour; 42 | - (NGImage*)toycamera; 43 | - (NGImage*)envy; 44 | - (NGImage*)equalization; 45 | - (NGImage*)blur:(float)amount; 46 | - (NGImage*)posterize:(float)amount; 47 | - (NGImage*)sharpen:(float)amount; 48 | - (NGImage*)unsharpMaskWithRadius:(float)radius andIntensity:(float)intensity; 49 | - (NGImage*)gloomWithRadius:(float)radius andIntensity:(float)intensit; 50 | - (NGImage*)bloomWithRadius:(float)radius andIntensity:(float)intensity; 51 | - (NGImage *)filter:(NSString *)filterName params:(NSDictionary *)theParams; 52 | - (NGImage *)imageToFitSize:(CGSize)fitSize method:(IFResizingMethod)resizeMethod; 53 | 54 | @end 55 | 56 | @class ImageFilter; 57 | 58 | @interface NGImage (ImageFilter) 59 | 60 | @property (strong, nonatomic, readonly) ImageFilter* filter; 61 | 62 | @end 63 | 64 | @interface ImageFilter : NSObject 65 | 66 | @property (weak, nonatomic) NGImage* image; 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /ImageFilters/ImageFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilter.m 3 | // 4 | // Created by James Womack on 08/23/11. 5 | // Copyright 2011 Cirrostratus Co. 6 | // 7 | // Licensed under the MIT License. 8 | // 9 | 10 | #import "ImageFilter.h" 11 | #import "UIImage+Filter.h" 12 | #import "CIFilter+Filter.h" 13 | #import "CIImage+Filter.h" 14 | #import "CIBlueMoodFilter.h" 15 | #import 16 | #import 17 | #import 18 | 19 | #ifndef Img 20 | #define Img(name) [NGImage imageNamed:name] 21 | #endif 22 | 23 | @implementation NGImage (ImageFilter) 24 | 25 | @dynamic filter; 26 | 27 | - (ImageFilter*)filter { 28 | ImageFilter *filter = ImageFilter.new; 29 | filter.image = self; 30 | return filter; 31 | } 32 | 33 | - (NSMethodSignature *)methodSignatureForSelector:(SEL)sel { 34 | return [self.filter methodSignatureForSelector:sel]; 35 | } 36 | 37 | - (BOOL)respondsToSelector:(SEL)aSelector { 38 | return [self.filter respondsToSelector:aSelector]; 39 | } 40 | 41 | - (void)forwardInvocation:(NSInvocation *)invocation { 42 | [invocation invokeWithTarget:self.filter]; 43 | } 44 | 45 | - (NGImage *)imageToFitSize:(CGSize)fitSize method:(IFResizingMethod)resizeMethod { 46 | float imageScaleFactor = 1.0; 47 | 48 | if ([self respondsToSelector:@selector(scale)]) { 49 | imageScaleFactor = [self scale]; 50 | } 51 | 52 | float sourceWidth = [self size].width * imageScaleFactor; 53 | float sourceHeight = [self size].height * imageScaleFactor; 54 | float targetWidth = fitSize.width; 55 | float targetHeight = fitSize.height; 56 | BOOL cropping = !(resizeMethod == IFResizeScale); 57 | 58 | // Calculate aspect ratios 59 | float sourceRatio = sourceWidth / sourceHeight; 60 | float targetRatio = targetWidth / targetHeight; 61 | 62 | // Determine what side of the source image to use for proportional scaling 63 | BOOL scaleWidth = (sourceRatio <= targetRatio); 64 | // Deal with the case of just scaling proportionally to fit, without cropping 65 | scaleWidth = (cropping) ? scaleWidth : !scaleWidth; 66 | 67 | // Proportionally scale source image 68 | float scalingFactor, scaledWidth, scaledHeight; 69 | if (scaleWidth) { 70 | scalingFactor = 1.0 / sourceRatio; 71 | scaledWidth = targetWidth; 72 | scaledHeight = round(targetWidth * scalingFactor); 73 | } else { 74 | scalingFactor = sourceRatio; 75 | scaledWidth = round(targetHeight * scalingFactor); 76 | scaledHeight = targetHeight; 77 | } 78 | float scaleFactor = scaledHeight / sourceHeight; 79 | 80 | // Calculate compositing rectangles 81 | CGRect sourceRect, destRect; 82 | if (cropping) { 83 | destRect = CGRectMake(0, 0, targetWidth, targetHeight); 84 | float destX = 0.0f; 85 | float destY = 0.0f; 86 | if (resizeMethod == IFResizeCrop) { 87 | // Crop center 88 | destX = round((scaledWidth - targetWidth) / 2.0); 89 | destY = round((scaledHeight - targetHeight) / 2.0); 90 | } else if (resizeMethod == IFResizeCropStart) { 91 | // Crop top or left (prefer top) 92 | if (scaleWidth) { 93 | // Crop top 94 | destX = 0.0; 95 | destY = 0.0; 96 | } else { 97 | // Crop left 98 | destX = 0.0; 99 | destY = round((scaledHeight - targetHeight) / 2.0); 100 | } 101 | } else if (resizeMethod == IFResizeCropEnd) { 102 | // Crop bottom or right 103 | if (scaleWidth) { 104 | // Crop bottom 105 | destX = round((scaledWidth - targetWidth) / 2.0); 106 | destY = round(scaledHeight - targetHeight); 107 | } else { 108 | // Crop right 109 | destX = round(scaledWidth - targetWidth); 110 | destY = round((scaledHeight - targetHeight) / 2.0); 111 | } 112 | } 113 | sourceRect = CGRectMake(destX / scaleFactor, destY / scaleFactor, 114 | targetWidth / scaleFactor, targetHeight / scaleFactor); 115 | } else { 116 | sourceRect = CGRectMake(0, 0, sourceWidth, sourceHeight); 117 | destRect = CGRectMake(0, 0, scaledWidth, scaledHeight); 118 | } 119 | 120 | // Create appropriately modified image. 121 | NGImage *img = nil; 122 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= 40000 123 | if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 4.0) { 124 | UIGraphicsBeginImageContextWithOptions(destRect.size, NO, 0.0); // 0.0 for scale means "correct scale for device's main screen". 125 | CGImageRef sourceImg = CGImageCreateWithImageInRect([self CGImage], sourceRect); // cropping happens here. 126 | img = [NGImage imageWithCGImage:sourceImg scale:.0 orientation:self.imageOrientation]; // create cropped NGImage. 127 | [img drawInRect:destRect]; // the actual scaling happens here, and orientation is taken care of automatically. 128 | CGImageRelease(sourceImg); 129 | img = UIGraphicsGetImageFromCurrentImageContext(); 130 | UIGraphicsEndImageContext(); 131 | } 132 | #endif 133 | if (!img) { 134 | // Try older method. 135 | CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); 136 | CGContextRef context = CGBitmapContextCreate(NULL, fitSize.width, fitSize.height, 8, (fitSize.width * 4), colorSpace, (CGBitmapInfo)kCGImageAlphaPremultipliedLast); 137 | CGImageRef sourceImg = CGImageCreateWithImageInRect([self CGImage], sourceRect); 138 | CGContextDrawImage(context, destRect, sourceImg); 139 | CGImageRelease(sourceImg); 140 | CGImageRef finalImage = CGBitmapContextCreateImage(context); 141 | CGContextRelease(context); 142 | CGColorSpaceRelease(colorSpace); 143 | img = [NGImage imageWithCGImage:finalImage]; 144 | CGImageRelease(finalImage); 145 | } 146 | 147 | return img; 148 | } 149 | 150 | @end 151 | 152 | @implementation ImageFilter 153 | 154 | + (void)initialize { 155 | id constructor = CIBlueMoodFilter.new; 156 | [CIFilter registerFilterName:@"CIBlueMood" 157 | constructor:constructor 158 | classAttributes:@{kCIAttributeFilterDisplayName:@"Blue Mood Filter", 159 | kCIAttributeFilterCategories:@[kCICategoryStylize,kCICategoryStillImage]}]; 160 | } 161 | 162 | - (NGImage*)sepia { 163 | return [self.image filter:@"CISepiaTone" params:@{@"inputIntensity": @0.9f}]; 164 | } 165 | 166 | - (NGImage*)blueMood { 167 | return [self.image filter:@"CIBlueMood" 168 | params:@{}]; 169 | } 170 | 171 | - (NGImage *)colorMatrix:(NSArray *)colorMatrix { 172 | CGFloat redVector[4] = { [colorMatrix[0] floatValue], 0.0f, 0.0f, 0.0f }; 173 | CGFloat greenVector[4] = { 0.0f, [colorMatrix[1] floatValue], 0.0f, 0.0f }; 174 | CGFloat blueVector[4] = { 0.0f, 0.0f, [colorMatrix[2] floatValue], 0.0f }; 175 | CGFloat alphaVector[4] = { 0.0f, 0.0f, 0.0f, [colorMatrix[3] floatValue] }; 176 | CGFloat bias = [colorMatrix[4] floatValue]; 177 | CGFloat biasVector[4] = { bias, bias, bias, 0.0f }; 178 | 179 | 180 | return [self.image filter:@"CIColorMatrix" 181 | params:@{@"inputRVector": [CIVector vectorWithValues:redVector count:4], 182 | @"inputGVector": [CIVector vectorWithValues:greenVector count:4], 183 | @"inputBVector": [CIVector vectorWithValues:blueVector count:4], 184 | @"inputAVector": [CIVector vectorWithValues:alphaVector count:4], 185 | @"inputBiasVector":[CIVector vectorWithValues:biasVector count:4]}]; 186 | } 187 | 188 | - (NGImage*)sunkissed { 189 | NGImage *img = [self colorMatrix:@[@1.f,@.6f,@.3f,@1.f,@.2f]]; 190 | 191 | return [img filter:@"CIColorControls" 192 | params:@{@"inputBrightness": @.4f, @"inputContrast": @3.0f}]; 193 | } 194 | 195 | - (NGImage*)polarize { 196 | NGImage *img = [self colorMatrix:@[@1.f,@.5f,@1.f,@1.f,@.2f]]; 197 | 198 | return [img filter:@"CIColorControls" params:@{@"inputBrightness": @.4f, @"inputContrast": @3.0f}]; 199 | } 200 | 201 | - (NGImage*)envy { 202 | return [self.image filter:@"CIFalseColor" 203 | params:@{@"inputColor0": [CIColor colorWithRed:.0 green:1.0 blue:.0 alpha:1.0], @"inputColor1": [CIColor colorWithRed:1.0 green:1.0 blue:1.0 alpha:1.0]}]; 204 | } 205 | 206 | - (NGImage*)invert { 207 | return [self.image filter:@"CIColorInvert" params:nil]; 208 | } 209 | 210 | - (NGImage*)colorize:(float)amount { 211 | return [self.image filter:@"CIColorMonochrome" params:@{@"inputIntensity": @(amount)}]; 212 | } 213 | 214 | - (NGImage*)exposure:(float)amount { 215 | return [self.image filter:@"CIExposureAdjust" params:@{@"inputEV": @(amount)}]; 216 | } 217 | 218 | - (NGImage*)edges:(float)amount { 219 | return [self.image filter:@"CIEdges" params:@{@"inputIntensity": @(amount)}]; 220 | } 221 | 222 | 223 | - (NGImage*)brightness:(float)amount { 224 | return [self.image filter:@"CIColorControls" 225 | params:@{@"inputBrightness": @(amount), @"inputContrast": @1.05f}]; 226 | } 227 | 228 | - (NGImage*)brightness:(float)brightness andConstrast:(float)contrast { 229 | return [self.image filter:@"CIColorControls" 230 | params:@{@"inputBrightness": @(brightness), @"inputContrast": @(contrast)}]; 231 | } 232 | 233 | static unsigned char morphological_kernel[9] = { 234 | 1, 1, 1, 235 | 1, 1, 1, 236 | 1, 1, 1 237 | }; 238 | 239 | - (NGImage *)equalization { 240 | const size_t width = self.image.size.width; 241 | const size_t height = self.image.size.height; 242 | const size_t bytesPerRow = width * 4; 243 | 244 | CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); 245 | CGContextRef bmContext = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, space, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); 246 | CGColorSpaceRelease(space); 247 | if (!bmContext) 248 | return nil; 249 | 250 | CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = width, .size.height = height}, self.image.CGImage); 251 | 252 | UInt8* data = (UInt8*)CGBitmapContextGetData(bmContext); 253 | if (!data) { 254 | CGContextRelease(bmContext); 255 | return nil; 256 | } 257 | 258 | const size_t n = sizeof(UInt8) * width * height * 4; 259 | void* outt = malloc(n); 260 | vImage_Buffer src = {data, height, width, bytesPerRow}; 261 | vImage_Buffer dest = {outt, height, width, bytesPerRow}; 262 | vImageDilate_ARGB8888(&src, &dest, 0, 0, morphological_kernel, 3, 3, kvImageCopyInPlace); 263 | 264 | memcpy(data, outt, n); 265 | 266 | free(outt); 267 | 268 | CGImageRef dilatedImageRef = CGBitmapContextCreateImage(bmContext); 269 | NGImage* dilated = [NGImage imageWithCGImage:dilatedImageRef]; 270 | 271 | CGImageRelease(dilatedImageRef); 272 | CGContextRelease(bmContext); 273 | 274 | return dilated; 275 | } 276 | 277 | - (NGImage *)erode { 278 | const size_t width = self.image.size.width; 279 | const size_t height = self.image.size.height; 280 | const size_t bytesPerRow = width * 4; 281 | 282 | CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); 283 | CGContextRef bmContext = CGBitmapContextCreate(NULL, width, height, 8, bytesPerRow, space, kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedFirst); 284 | CGColorSpaceRelease(space); 285 | if (!bmContext) 286 | return nil; 287 | 288 | CGContextDrawImage(bmContext, (CGRect){.origin.x = 0.0f, .origin.y = 0.0f, .size.width = width, .size.height = height}, self.image.CGImage); 289 | 290 | UInt8* data = (UInt8*)CGBitmapContextGetData(bmContext); 291 | if (!data) { 292 | CGContextRelease(bmContext); 293 | return nil; 294 | } 295 | 296 | const size_t n = sizeof(UInt8) * width * height * 4; 297 | void* outt = malloc(n); 298 | vImage_Buffer src = {data, height, width, bytesPerRow}; 299 | vImage_Buffer dest = {outt, height, width, bytesPerRow}; 300 | 301 | vImageErode_ARGB8888(&src, &dest, 0, 0, morphological_kernel, 3, 3, kvImageCopyInPlace); 302 | 303 | memcpy(data, outt, n); 304 | 305 | free(outt); 306 | 307 | CGImageRef erodedImageRef = CGBitmapContextCreateImage(bmContext); 308 | NGImage* eroded = [NGImage imageWithCGImage:erodedImageRef]; 309 | 310 | CGImageRelease(erodedImageRef); 311 | CGContextRelease(bmContext); 312 | 313 | return eroded; 314 | } 315 | 316 | - (NGImage*)vibrant:(float)amount { 317 | return [self.image filter:@"CIColorControls" params:@{kCIInputSaturationKey: @(amount*2)}]; 318 | } 319 | 320 | - (NGImage *)sharpify { 321 | return [[self bloomWithRadius:1.5f andIntensity:6.f] 322 | blur:.6f]; 323 | } 324 | 325 | - (NGImage*)blur:(float)amount{ 326 | return [self.image filter:@"CIGaussianBlur" params:@{@"inputRadius": @(amount)}]; 327 | } 328 | 329 | - (NGImage*)bloomWithRadius:(float)radius andIntensity:(float)intensity{ 330 | return [self.image filter:@"CIBloom" 331 | params:@{@"inputRadius": @(radius), @"inputIntensity": @(intensity)}]; 332 | } 333 | 334 | - (NGImage*)gloomWithRadius:(float)radius andIntensity:(float)intensity{ 335 | return [self.image filter:@"CIGloom" 336 | params:@{@"inputRadius": @(radius), @"inputIntensity": @(intensity)}]; 337 | } 338 | 339 | - (NGImage*)unsharpMaskWithRadius:(float)radius andIntensity:(float)intensity { 340 | return [self.image filter:@"CIUnsharpMask" 341 | params:@{@"inputRadius": @(radius), @"inputIntensity": @(intensity)}]; 342 | } 343 | 344 | - (NGImage*)blackAndWhite { 345 | return [self.image filter:@"CIColorControls" params:@{kCIInputSaturationKey: @0.0f}]; 346 | } 347 | 348 | - (NGImage*)crossProcess { 349 | NGImage *img = [self.image filter:@"CIColorControls" 350 | params:@{kCIInputSaturationKey: @.4f, @"inputContrast": @1.0f}]; 351 | 352 | img = [img imageToFitSize:CGSizeMake(self.image.size.width*self.image.scale, self.image.size.height*self.image.scale) method:IFResizeScale]; 353 | 354 | CIImage *backgroundImage = [CIImage imageWithCGImage:[img CGImage]]; 355 | NGImage *i = [Img(@"crossprocess") imageToFitSize:CGSizeMake(self.image.size.width*self.image.scale, self.image.size.height*self.image.scale) method:IFResizeCrop]; 356 | CIImage *inputImage = [CIImage imageWithCGImage:i.CGImage]; 357 | return [self.image filter:@"CIOverlayBlendMode" 358 | params:@{kCIInputImageKey: inputImage, kCIInputBackgroundImageKey: backgroundImage}]; 359 | } 360 | 361 | - (NGImage*)magichour { 362 | NGImage *img = [self.image filter:@"CIColorControls" params:@{@"inputContrast": @1.0f}]; 363 | img = [img imageToFitSize:CGSizeMake(self.image.size.width*self.image.scale, self.image.size.height*self.image.scale) method:IFResizeScale]; 364 | CIImage *backgroundImage = [CIImage imageWithCGImage:img.CGImage]; 365 | NGImage *i = [Img(@"magichour") imageToFitSize:CGSizeMake(self.image.size.width*self.image.scale, self.image.size.height*self.image.scale) method:IFResizeCrop]; 366 | CIImage *inputImage = [CIImage imageWithCGImage:i.CGImage]; 367 | return [self.image filter:@"CIMultiplyBlendMode" 368 | params:@{kCIInputImageKey: inputImage, kCIInputBackgroundImageKey: backgroundImage}]; 369 | } 370 | 371 | 372 | - (NGImage*)toycamera { 373 | CGSize size = self.image.size; 374 | CGFloat scale = self.image.scale; 375 | 376 | NGImage *img = [self.image imageToFitSize:CGSizeMake(size.width*scale, size.height*scale) 377 | method:IFResizeScale]; 378 | 379 | CIImage *backgroundImage = [CIImage imageWithCGImage:img.CGImage]; 380 | 381 | NGImage *i = [Img(@"toycamera") imageToFitSize:CGSizeMake(size.width*scale, size.height*scale) 382 | method:IFResizeCrop]; 383 | 384 | CIImage *inputImage = [CIImage imageWithCGImage:i.CGImage]; 385 | 386 | return [self.image filter:@"CIOverlayBlendMode" 387 | params:@{kCIInputImageKey: inputImage, kCIInputBackgroundImageKey: backgroundImage}]; 388 | } 389 | 390 | 391 | - (NGImage*)contrast:(float)amount { 392 | return [self.image filter:@"CIColorControls" 393 | params:@{@"inputContrast": @(amount*4)}]; 394 | } 395 | 396 | - (NGImage*)gamma:(float)amount { 397 | return [self.image filter:@"CIGammaAdjust" 398 | params:@{@"inputPower": @(amount)}]; 399 | } 400 | 401 | - (NGImage*)sharpen:(float)amount { 402 | return [self.image filter:@"CISharpenLuminance" 403 | params:@{kCIInputSharpnessKey: @(amount)}]; 404 | } 405 | 406 | - (NGImage*)posterize:(float)amount { 407 | return [self.image filter:@"CIColorPosterize" 408 | params:@{@"inputLevels": @(amount)}]; 409 | } 410 | 411 | - (NGImage *)filter:(NSString *)filterName params:(NSDictionary *)theParams { 412 | NGImage *uiImage; 413 | 414 | CIImage *image = self.image.ng_CIImage; 415 | 416 | BOOL shouldClamp = theParams.allKeys.count && theParams[@"inputRadius"]; 417 | if (shouldClamp) { 418 | image = [image ng_imageByClampingToExtent]; 419 | } 420 | 421 | CIFilter *filter = [CIFilter withName:filterName andCIImage:image]; 422 | 423 | [theParams enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop __unused) { 424 | [filter setValue:obj forKey:key]; 425 | }]; 426 | 427 | CIImage* outputImage = filter.outputImage; 428 | 429 | CGRect extent = shouldClamp ? (CGRect){.size = self.image.size} : outputImage.extent; 430 | self.image = uiImage = [outputImage UIImageFromExtent:extent]; 431 | 432 | return uiImage; 433 | } 434 | 435 | 436 | @end 437 | -------------------------------------------------------------------------------- /ImageFilters/ImageFilterCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilterCache.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import 9 | #import "Platforms.h" 10 | 11 | @interface ImageFilterCache : NSObject 12 | + (NGImage *)cached:(NGImage *)image forFilterName:(NSString *)filterName; 13 | + (NGImage *)cache:(NGImage *)image forFilterName:(NSString *)filterName; 14 | + (NSString *)keyForImage:(NGImage *)image andFilterName:(NSString *)filterName; 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/ImageFilterCache.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilterCache.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "ImageFilterCache.h" 9 | 10 | @implementation ImageFilterCache 11 | 12 | static NSCache *cache; 13 | 14 | + (void)initialize { 15 | cache = NSCache.new; 16 | cache.countLimit = 20; 17 | } 18 | 19 | + (NGImage *)cached:(NGImage *)image forFilterName:(NSString *)filterName { 20 | NSString *keyForImage = [self keyForImage:image andFilterName:filterName]; 21 | return [cache objectForKey:keyForImage]; 22 | } 23 | 24 | + (NGImage *)cache:(NGImage *)image forFilterName:(NSString *)filterName { 25 | NSString *keyForImage = [self keyForImage:image andFilterName:filterName]; 26 | [cache setObject:image forKey:keyForImage]; 27 | return image; 28 | } 29 | 30 | + (NSString *)keyForImage:(NGImage *)image andFilterName:(NSString *)filterName { 31 | return [NSString stringWithFormat:@"%@_%@", image, filterName]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ImageFilters/Images/crossprocess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/crossprocess.png -------------------------------------------------------------------------------- /ImageFilters/Images/crossprocess@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/crossprocess@2x.png -------------------------------------------------------------------------------- /ImageFilters/Images/magichour.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/magichour.png -------------------------------------------------------------------------------- /ImageFilters/Images/magichour@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/magichour@2x.png -------------------------------------------------------------------------------- /ImageFilters/Images/toycamera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/toycamera.png -------------------------------------------------------------------------------- /ImageFilters/Images/toycamera@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/Images/toycamera@2x.png -------------------------------------------------------------------------------- /ImageFilters/NGFilterConstructor.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilterConstructor.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import 9 | 10 | @interface NGFilterConstructor : NSObject 11 | @property (nonatomic, strong) id constructor; 12 | @property (nonatomic, strong) NSDictionary *attributes; 13 | @end 14 | -------------------------------------------------------------------------------- /ImageFilters/NGFilterConstructor.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilterConstructor.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import "NGFilterConstructor.h" 9 | 10 | @implementation NGFilterConstructor 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /ImageFilters/NGFilterStore.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilterStore.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import 9 | 10 | @interface NGFilterStore : NSObject 11 | + (CIFilter *)filterWithName:(NSString *)name; 12 | + (void)registerFilterName:(NSString *)name 13 | constructor:(id)anObject 14 | classAttributes:(NSDictionary *)attributes; 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/NGFilterStore.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilterStore.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/19/14. 6 | // 7 | 8 | #import "NGFilterStore.h" 9 | #import "Platforms.h" 10 | #import "NGFilterConstructor.h" 11 | 12 | static NSMutableDictionary *_backingStore; 13 | 14 | @implementation NGFilterStore 15 | 16 | + (void)initialize { 17 | _backingStore = NSMutableDictionary.new; 18 | } 19 | 20 | + (CIFilter *)filterWithName:(NSString *)name { 21 | NGFilterConstructor *fc = [_backingStore objectForKey:name]; 22 | CIFilter *filter = [fc.constructor filterWithName:name]; 23 | return filter; 24 | } 25 | 26 | + (void)registerFilterName:(NSString *)name 27 | constructor:(id)anObject 28 | classAttributes:(NSDictionary *)attributes { 29 | NGFilterConstructor *fc = NGFilterConstructor.new; 30 | // TODO — figure out what to do with attributes 31 | fc.attributes = attributes; 32 | fc.constructor = anObject; 33 | [_backingStore setObject:fc forKey:name]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /ImageFilters/Platforms.h: -------------------------------------------------------------------------------- 1 | // 2 | // Platforms.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #ifndef ImageFilterExample_Platforms_h 9 | #define ImageFilterExample_Platforms_h 10 | 11 | #if TARGET_OS_IPHONE 12 | 13 | #define NGColor UIColor 14 | #define NGImage UIImage 15 | #define NGFont UIFont 16 | #define NGBezierPath UIBezierPath 17 | #define isMobile 1 18 | #define isDesktop 0 19 | #import 20 | 21 | #elif TARGET_OS_MAC && !TARGET_OS_IPHONE 22 | 23 | #define NGColor NSColor 24 | #define NGImage NSImage 25 | #define NGFont NSFont 26 | #define NGBezierPath NSBezierPath 27 | #define isMobile 0 28 | #define isDesktop 1 29 | #include 30 | 31 | 32 | #endif 33 | 34 | #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_8_0 35 | #define hasIOS8Features 1 36 | #define needsIOS8Features 0 37 | #else 38 | #define hasIOS8Features 0 39 | #define needsIOS8Features 1 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /ImageFilters/UIImage+Filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Filter.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "Platforms.h" 9 | 10 | @interface NGImage (Filter) 11 | - (CIImage*)ng_CIImage; 12 | #if isDesktop 13 | - (CGImageRef)CGImage; 14 | - (CGFloat)scale; 15 | + (NGImage *)imageWithCGImage:(CGImageRef)ref; 16 | #endif 17 | @end 18 | -------------------------------------------------------------------------------- /ImageFilters/UIImage+Filter.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Filter.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/1/14. 6 | // 7 | 8 | #import "UIImage+Filter.h" 9 | #import "Platforms.h" 10 | 11 | @implementation NGImage (Filter) 12 | - (CIImage*)ng_CIImage { 13 | return [CIImage imageWithCGImage:self.CGImage]; 14 | } 15 | 16 | #if isDesktop 17 | - (CGImageRef)CGImage; { 18 | NSGraphicsContext *context = NSGraphicsContext.currentContext; 19 | CGRect rect = (CGRect){.size=self.size}; 20 | CGImageRef ref = [self CGImageForProposedRect:&rect context:context hints:NULL]; 21 | return ref; 22 | } 23 | 24 | - (CGFloat)scale; { 25 | return 1.f; 26 | } 27 | 28 | + (NGImage *)imageWithCGImage:(CGImageRef)ref { 29 | NGImage *image = [[NGImage alloc] initWithCGImage:ref size:CGSizeMake(CGImageGetWidth(ref), CGImageGetHeight(ref))]; 30 | return image; 31 | } 32 | #endif 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B072F4C1912275A003A4716 /* CIFilter+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B072F441912275A003A4716 /* CIFilter+Filter.m */; }; 11 | 1B072F4D1912275A003A4716 /* CIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B072F461912275A003A4716 /* CIImage+Filter.m */; }; 12 | 1B072F4E1912275A003A4716 /* ImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B072F481912275A003A4716 /* ImageFilter.m */; }; 13 | 1B072F4F1912275A003A4716 /* UIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B072F4B1912275A003A4716 /* UIImage+Filter.m */; }; 14 | 1B0CDE571929FCA700251B38 /* CIBlueMoodFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B0CDE561929FCA700251B38 /* CIBlueMoodFilter.m */; }; 15 | 1B78B37D1910DB4200BEB3D4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B78B37C1910DB4200BEB3D4 /* Cocoa.framework */; }; 16 | 1B78B3871910DB4200BEB3D4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B78B3851910DB4200BEB3D4 /* InfoPlist.strings */; }; 17 | 1B78B3891910DB4200BEB3D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B78B3881910DB4200BEB3D4 /* main.m */; }; 18 | 1B78B3901910DB4200BEB3D4 /* NGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B78B38F1910DB4200BEB3D4 /* NGAppDelegate.m */; }; 19 | 1B78B3931910DB4200BEB3D4 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B78B3911910DB4200BEB3D4 /* MainMenu.xib */; }; 20 | 1B78B3951910DB4200BEB3D4 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1B78B3941910DB4200BEB3D4 /* Images.xcassets */; }; 21 | 1B78B39C1910DB4300BEB3D4 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B78B39B1910DB4300BEB3D4 /* XCTest.framework */; }; 22 | 1B78B39D1910DB4300BEB3D4 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B78B37C1910DB4200BEB3D4 /* Cocoa.framework */; }; 23 | 1B78B3A51910DB4300BEB3D4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B78B3A31910DB4300BEB3D4 /* InfoPlist.strings */; }; 24 | 1B78B3A71910DB4300BEB3D4 /* ImageFilterExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B78B3A61910DB4300BEB3D4 /* ImageFilterExampleTests.m */; }; 25 | 1B78B3B71910DC2E00BEB3D4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B78B3B61910DC2E00BEB3D4 /* ViewController.m */; }; 26 | 1B7E93F1192B15E4008EB9EA /* north-park_sunflower.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B7E93F0192B15E4008EB9EA /* north-park_sunflower.png */; }; 27 | 731767831AAA0F6A0041CC02 /* crossprocess.png in Resources */ = {isa = PBXBuildFile; fileRef = 7317677D1AAA0F6A0041CC02 /* crossprocess.png */; }; 28 | 731767841AAA0F6A0041CC02 /* crossprocess@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 7317677E1AAA0F6A0041CC02 /* crossprocess@2x.png */; }; 29 | 731767851AAA0F6A0041CC02 /* magichour.png in Resources */ = {isa = PBXBuildFile; fileRef = 7317677F1AAA0F6A0041CC02 /* magichour.png */; }; 30 | 731767861AAA0F6A0041CC02 /* magichour@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 731767801AAA0F6A0041CC02 /* magichour@2x.png */; }; 31 | 731767871AAA0F6A0041CC02 /* toycamera.png in Resources */ = {isa = PBXBuildFile; fileRef = 731767811AAA0F6A0041CC02 /* toycamera.png */; }; 32 | 731767881AAA0F6A0041CC02 /* toycamera@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 731767821AAA0F6A0041CC02 /* toycamera@2x.png */; }; 33 | 73FAECD71A95A9FA00596D57 /* north-park_sunflower_flipped.png in Resources */ = {isa = PBXBuildFile; fileRef = 73FAECD61A95A9FA00596D57 /* north-park_sunflower_flipped.png */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | 1B78B39E1910DB4300BEB3D4 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = 1B78B3711910DB4200BEB3D4 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = 1B78B3781910DB4200BEB3D4; 42 | remoteInfo = ImageFilterExample; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 1B072F431912275A003A4716 /* CIFilter+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CIFilter+Filter.h"; path = "../../../CIFilter+Filter.h"; sourceTree = ""; }; 48 | 1B072F441912275A003A4716 /* CIFilter+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CIFilter+Filter.m"; path = "../../../CIFilter+Filter.m"; sourceTree = ""; }; 49 | 1B072F451912275A003A4716 /* CIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CIImage+Filter.h"; path = "../../../CIImage+Filter.h"; sourceTree = ""; }; 50 | 1B072F461912275A003A4716 /* CIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CIImage+Filter.m"; path = "../../../CIImage+Filter.m"; sourceTree = ""; }; 51 | 1B072F471912275A003A4716 /* ImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageFilter.h; path = ../../../ImageFilter.h; sourceTree = ""; }; 52 | 1B072F481912275A003A4716 /* ImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ImageFilter.m; path = ../../../ImageFilter.m; sourceTree = ""; }; 53 | 1B072F491912275A003A4716 /* Platforms.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platforms.h; path = ../../../Platforms.h; sourceTree = ""; }; 54 | 1B072F4A1912275A003A4716 /* UIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+Filter.h"; path = "../../../UIImage+Filter.h"; sourceTree = ""; }; 55 | 1B072F4B1912275A003A4716 /* UIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+Filter.m"; path = "../../../UIImage+Filter.m"; sourceTree = ""; }; 56 | 1B0CDE551929FCA700251B38 /* CIBlueMoodFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CIBlueMoodFilter.h; path = ../../../CIBlueMoodFilter.h; sourceTree = ""; }; 57 | 1B0CDE561929FCA700251B38 /* CIBlueMoodFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CIBlueMoodFilter.m; path = ../../../CIBlueMoodFilter.m; sourceTree = ""; }; 58 | 1B78B3791910DB4200BEB3D4 /* ImageFilterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 59 | 1B78B37C1910DB4200BEB3D4 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; }; 60 | 1B78B37F1910DB4200BEB3D4 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; }; 61 | 1B78B3801910DB4200BEB3D4 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; }; 62 | 1B78B3811910DB4200BEB3D4 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 63 | 1B78B3841910DB4200BEB3D4 /* ImageFilterExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ImageFilterExample-Info.plist"; sourceTree = ""; }; 64 | 1B78B3861910DB4200BEB3D4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 65 | 1B78B3881910DB4200BEB3D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 66 | 1B78B38A1910DB4200BEB3D4 /* ImageFilterExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ImageFilterExample-Prefix.pch"; sourceTree = ""; }; 67 | 1B78B38E1910DB4200BEB3D4 /* NGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NGAppDelegate.h; sourceTree = ""; }; 68 | 1B78B38F1910DB4200BEB3D4 /* NGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NGAppDelegate.m; sourceTree = ""; }; 69 | 1B78B3921910DB4200BEB3D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; 70 | 1B78B3941910DB4200BEB3D4 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 71 | 1B78B39A1910DB4300BEB3D4 /* ImageFilterExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageFilterExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 72 | 1B78B39B1910DB4300BEB3D4 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 73 | 1B78B3A21910DB4300BEB3D4 /* ImageFilterExampleTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ImageFilterExampleTests-Info.plist"; sourceTree = ""; }; 74 | 1B78B3A41910DB4300BEB3D4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 75 | 1B78B3A61910DB4300BEB3D4 /* ImageFilterExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageFilterExampleTests.m; sourceTree = ""; }; 76 | 1B78B3B51910DC2E00BEB3D4 /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 77 | 1B78B3B61910DC2E00BEB3D4 /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 78 | 1B7E93F0192B15E4008EB9EA /* north-park_sunflower.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "north-park_sunflower.png"; path = "../../iOS/ImageFilterExample/Images/north-park_sunflower.png"; sourceTree = ""; }; 79 | 7317677D1AAA0F6A0041CC02 /* crossprocess.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = crossprocess.png; path = ../../../Images/crossprocess.png; sourceTree = ""; }; 80 | 7317677E1AAA0F6A0041CC02 /* crossprocess@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "crossprocess@2x.png"; path = "../../../Images/crossprocess@2x.png"; sourceTree = ""; }; 81 | 7317677F1AAA0F6A0041CC02 /* magichour.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = magichour.png; path = ../../../Images/magichour.png; sourceTree = ""; }; 82 | 731767801AAA0F6A0041CC02 /* magichour@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "magichour@2x.png"; path = "../../../Images/magichour@2x.png"; sourceTree = ""; }; 83 | 731767811AAA0F6A0041CC02 /* toycamera.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = toycamera.png; path = ../../../Images/toycamera.png; sourceTree = ""; }; 84 | 731767821AAA0F6A0041CC02 /* toycamera@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "toycamera@2x.png"; path = "../../../Images/toycamera@2x.png"; sourceTree = ""; }; 85 | 73FAECD61A95A9FA00596D57 /* north-park_sunflower_flipped.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "north-park_sunflower_flipped.png"; path = "../../iOS/ImageFilterExample/Images/north-park_sunflower_flipped.png"; sourceTree = ""; }; 86 | /* End PBXFileReference section */ 87 | 88 | /* Begin PBXFrameworksBuildPhase section */ 89 | 1B78B3761910DB4200BEB3D4 /* Frameworks */ = { 90 | isa = PBXFrameworksBuildPhase; 91 | buildActionMask = 2147483647; 92 | files = ( 93 | 1B78B37D1910DB4200BEB3D4 /* Cocoa.framework in Frameworks */, 94 | ); 95 | runOnlyForDeploymentPostprocessing = 0; 96 | }; 97 | 1B78B3971910DB4300BEB3D4 /* Frameworks */ = { 98 | isa = PBXFrameworksBuildPhase; 99 | buildActionMask = 2147483647; 100 | files = ( 101 | 1B78B39D1910DB4300BEB3D4 /* Cocoa.framework in Frameworks */, 102 | 1B78B39C1910DB4300BEB3D4 /* XCTest.framework in Frameworks */, 103 | ); 104 | runOnlyForDeploymentPostprocessing = 0; 105 | }; 106 | /* End PBXFrameworksBuildPhase section */ 107 | 108 | /* Begin PBXGroup section */ 109 | 1B78B3701910DB4200BEB3D4 = { 110 | isa = PBXGroup; 111 | children = ( 112 | 1B78B3821910DB4200BEB3D4 /* ImageFilterExample */, 113 | 1B78B3A01910DB4300BEB3D4 /* ImageFilterExampleTests */, 114 | 1B78B37B1910DB4200BEB3D4 /* Frameworks */, 115 | 1B78B37A1910DB4200BEB3D4 /* Products */, 116 | ); 117 | sourceTree = ""; 118 | }; 119 | 1B78B37A1910DB4200BEB3D4 /* Products */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 1B78B3791910DB4200BEB3D4 /* ImageFilterExample.app */, 123 | 1B78B39A1910DB4300BEB3D4 /* ImageFilterExampleTests.xctest */, 124 | ); 125 | name = Products; 126 | sourceTree = ""; 127 | }; 128 | 1B78B37B1910DB4200BEB3D4 /* Frameworks */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 1B78B37C1910DB4200BEB3D4 /* Cocoa.framework */, 132 | 1B78B39B1910DB4300BEB3D4 /* XCTest.framework */, 133 | 1B78B37E1910DB4200BEB3D4 /* Other Frameworks */, 134 | ); 135 | name = Frameworks; 136 | sourceTree = ""; 137 | }; 138 | 1B78B37E1910DB4200BEB3D4 /* Other Frameworks */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 1B78B37F1910DB4200BEB3D4 /* AppKit.framework */, 142 | 1B78B3801910DB4200BEB3D4 /* CoreData.framework */, 143 | 1B78B3811910DB4200BEB3D4 /* Foundation.framework */, 144 | ); 145 | name = "Other Frameworks"; 146 | sourceTree = ""; 147 | }; 148 | 1B78B3821910DB4200BEB3D4 /* ImageFilterExample */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 1B78B38E1910DB4200BEB3D4 /* NGAppDelegate.h */, 152 | 1B78B38F1910DB4200BEB3D4 /* NGAppDelegate.m */, 153 | 1B78B3B51910DC2E00BEB3D4 /* ViewController.h */, 154 | 1B78B3B61910DC2E00BEB3D4 /* ViewController.m */, 155 | 1B78B3911910DB4200BEB3D4 /* MainMenu.xib */, 156 | 1B78B3941910DB4200BEB3D4 /* Images.xcassets */, 157 | 1B78B3831910DB4200BEB3D4 /* Supporting Files */, 158 | ); 159 | path = ImageFilterExample; 160 | sourceTree = ""; 161 | }; 162 | 1B78B3831910DB4200BEB3D4 /* Supporting Files */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | 1B7E93F2192B15E9008EB9EA /* Images */, 166 | 1B7E93F3192B15F0008EB9EA /* ImageFilter */, 167 | 1B78B3841910DB4200BEB3D4 /* ImageFilterExample-Info.plist */, 168 | 1B78B3851910DB4200BEB3D4 /* InfoPlist.strings */, 169 | 1B78B3881910DB4200BEB3D4 /* main.m */, 170 | 1B78B38A1910DB4200BEB3D4 /* ImageFilterExample-Prefix.pch */, 171 | ); 172 | name = "Supporting Files"; 173 | sourceTree = ""; 174 | }; 175 | 1B78B3A01910DB4300BEB3D4 /* ImageFilterExampleTests */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 1B78B3A61910DB4300BEB3D4 /* ImageFilterExampleTests.m */, 179 | 1B78B3A11910DB4300BEB3D4 /* Supporting Files */, 180 | ); 181 | path = ImageFilterExampleTests; 182 | sourceTree = ""; 183 | }; 184 | 1B78B3A11910DB4300BEB3D4 /* Supporting Files */ = { 185 | isa = PBXGroup; 186 | children = ( 187 | 1B78B3A21910DB4300BEB3D4 /* ImageFilterExampleTests-Info.plist */, 188 | 1B78B3A31910DB4300BEB3D4 /* InfoPlist.strings */, 189 | ); 190 | name = "Supporting Files"; 191 | sourceTree = ""; 192 | }; 193 | 1B7E93F2192B15E9008EB9EA /* Images */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 731767891AAA0F710041CC02 /* Filter images */, 197 | 1B7E93F0192B15E4008EB9EA /* north-park_sunflower.png */, 198 | 73FAECD61A95A9FA00596D57 /* north-park_sunflower_flipped.png */, 199 | ); 200 | name = Images; 201 | sourceTree = ""; 202 | }; 203 | 1B7E93F3192B15F0008EB9EA /* ImageFilter */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | 1B072F431912275A003A4716 /* CIFilter+Filter.h */, 207 | 1B072F441912275A003A4716 /* CIFilter+Filter.m */, 208 | 1B072F451912275A003A4716 /* CIImage+Filter.h */, 209 | 1B072F461912275A003A4716 /* CIImage+Filter.m */, 210 | 1B072F471912275A003A4716 /* ImageFilter.h */, 211 | 1B072F481912275A003A4716 /* ImageFilter.m */, 212 | 1B0CDE551929FCA700251B38 /* CIBlueMoodFilter.h */, 213 | 1B0CDE561929FCA700251B38 /* CIBlueMoodFilter.m */, 214 | 1B072F491912275A003A4716 /* Platforms.h */, 215 | 1B072F4A1912275A003A4716 /* UIImage+Filter.h */, 216 | 1B072F4B1912275A003A4716 /* UIImage+Filter.m */, 217 | ); 218 | name = ImageFilter; 219 | sourceTree = ""; 220 | }; 221 | 731767891AAA0F710041CC02 /* Filter images */ = { 222 | isa = PBXGroup; 223 | children = ( 224 | 7317677D1AAA0F6A0041CC02 /* crossprocess.png */, 225 | 7317677E1AAA0F6A0041CC02 /* crossprocess@2x.png */, 226 | 7317677F1AAA0F6A0041CC02 /* magichour.png */, 227 | 731767801AAA0F6A0041CC02 /* magichour@2x.png */, 228 | 731767811AAA0F6A0041CC02 /* toycamera.png */, 229 | 731767821AAA0F6A0041CC02 /* toycamera@2x.png */, 230 | ); 231 | name = "Filter images"; 232 | sourceTree = ""; 233 | }; 234 | /* End PBXGroup section */ 235 | 236 | /* Begin PBXNativeTarget section */ 237 | 1B78B3781910DB4200BEB3D4 /* ImageFilterExample */ = { 238 | isa = PBXNativeTarget; 239 | buildConfigurationList = 1B78B3AA1910DB4300BEB3D4 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */; 240 | buildPhases = ( 241 | 1B78B3751910DB4200BEB3D4 /* Sources */, 242 | 1B78B3761910DB4200BEB3D4 /* Frameworks */, 243 | 1B78B3771910DB4200BEB3D4 /* Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = ImageFilterExample; 250 | productName = ImageFilterExample; 251 | productReference = 1B78B3791910DB4200BEB3D4 /* ImageFilterExample.app */; 252 | productType = "com.apple.product-type.application"; 253 | }; 254 | 1B78B3991910DB4300BEB3D4 /* ImageFilterExampleTests */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = 1B78B3AD1910DB4300BEB3D4 /* Build configuration list for PBXNativeTarget "ImageFilterExampleTests" */; 257 | buildPhases = ( 258 | 1B78B3961910DB4300BEB3D4 /* Sources */, 259 | 1B78B3971910DB4300BEB3D4 /* Frameworks */, 260 | 1B78B3981910DB4300BEB3D4 /* Resources */, 261 | ); 262 | buildRules = ( 263 | ); 264 | dependencies = ( 265 | 1B78B39F1910DB4300BEB3D4 /* PBXTargetDependency */, 266 | ); 267 | name = ImageFilterExampleTests; 268 | productName = ImageFilterExampleTests; 269 | productReference = 1B78B39A1910DB4300BEB3D4 /* ImageFilterExampleTests.xctest */; 270 | productType = "com.apple.product-type.bundle.unit-test"; 271 | }; 272 | /* End PBXNativeTarget section */ 273 | 274 | /* Begin PBXProject section */ 275 | 1B78B3711910DB4200BEB3D4 /* Project object */ = { 276 | isa = PBXProject; 277 | attributes = { 278 | CLASSPREFIX = NG; 279 | LastUpgradeCheck = 0510; 280 | ORGANIZATIONNAME = "James Womack"; 281 | TargetAttributes = { 282 | 1B78B3991910DB4300BEB3D4 = { 283 | TestTargetID = 1B78B3781910DB4200BEB3D4; 284 | }; 285 | }; 286 | }; 287 | buildConfigurationList = 1B78B3741910DB4200BEB3D4 /* Build configuration list for PBXProject "ImageFilterExample" */; 288 | compatibilityVersion = "Xcode 3.2"; 289 | developmentRegion = English; 290 | hasScannedForEncodings = 0; 291 | knownRegions = ( 292 | en, 293 | Base, 294 | ); 295 | mainGroup = 1B78B3701910DB4200BEB3D4; 296 | productRefGroup = 1B78B37A1910DB4200BEB3D4 /* Products */; 297 | projectDirPath = ""; 298 | projectRoot = ""; 299 | targets = ( 300 | 1B78B3781910DB4200BEB3D4 /* ImageFilterExample */, 301 | 1B78B3991910DB4300BEB3D4 /* ImageFilterExampleTests */, 302 | ); 303 | }; 304 | /* End PBXProject section */ 305 | 306 | /* Begin PBXResourcesBuildPhase section */ 307 | 1B78B3771910DB4200BEB3D4 /* Resources */ = { 308 | isa = PBXResourcesBuildPhase; 309 | buildActionMask = 2147483647; 310 | files = ( 311 | 731767841AAA0F6A0041CC02 /* crossprocess@2x.png in Resources */, 312 | 1B78B3871910DB4200BEB3D4 /* InfoPlist.strings in Resources */, 313 | 731767861AAA0F6A0041CC02 /* magichour@2x.png in Resources */, 314 | 1B78B3951910DB4200BEB3D4 /* Images.xcassets in Resources */, 315 | 1B7E93F1192B15E4008EB9EA /* north-park_sunflower.png in Resources */, 316 | 1B78B3931910DB4200BEB3D4 /* MainMenu.xib in Resources */, 317 | 731767831AAA0F6A0041CC02 /* crossprocess.png in Resources */, 318 | 731767871AAA0F6A0041CC02 /* toycamera.png in Resources */, 319 | 731767881AAA0F6A0041CC02 /* toycamera@2x.png in Resources */, 320 | 73FAECD71A95A9FA00596D57 /* north-park_sunflower_flipped.png in Resources */, 321 | 731767851AAA0F6A0041CC02 /* magichour.png in Resources */, 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | }; 325 | 1B78B3981910DB4300BEB3D4 /* Resources */ = { 326 | isa = PBXResourcesBuildPhase; 327 | buildActionMask = 2147483647; 328 | files = ( 329 | 1B78B3A51910DB4300BEB3D4 /* InfoPlist.strings in Resources */, 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | }; 333 | /* End PBXResourcesBuildPhase section */ 334 | 335 | /* Begin PBXSourcesBuildPhase section */ 336 | 1B78B3751910DB4200BEB3D4 /* Sources */ = { 337 | isa = PBXSourcesBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | 1B78B3891910DB4200BEB3D4 /* main.m in Sources */, 341 | 1B072F4E1912275A003A4716 /* ImageFilter.m in Sources */, 342 | 1B072F4D1912275A003A4716 /* CIImage+Filter.m in Sources */, 343 | 1B78B3B71910DC2E00BEB3D4 /* ViewController.m in Sources */, 344 | 1B0CDE571929FCA700251B38 /* CIBlueMoodFilter.m in Sources */, 345 | 1B78B3901910DB4200BEB3D4 /* NGAppDelegate.m in Sources */, 346 | 1B072F4F1912275A003A4716 /* UIImage+Filter.m in Sources */, 347 | 1B072F4C1912275A003A4716 /* CIFilter+Filter.m in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | 1B78B3961910DB4300BEB3D4 /* Sources */ = { 352 | isa = PBXSourcesBuildPhase; 353 | buildActionMask = 2147483647; 354 | files = ( 355 | 1B78B3A71910DB4300BEB3D4 /* ImageFilterExampleTests.m in Sources */, 356 | ); 357 | runOnlyForDeploymentPostprocessing = 0; 358 | }; 359 | /* End PBXSourcesBuildPhase section */ 360 | 361 | /* Begin PBXTargetDependency section */ 362 | 1B78B39F1910DB4300BEB3D4 /* PBXTargetDependency */ = { 363 | isa = PBXTargetDependency; 364 | target = 1B78B3781910DB4200BEB3D4 /* ImageFilterExample */; 365 | targetProxy = 1B78B39E1910DB4300BEB3D4 /* PBXContainerItemProxy */; 366 | }; 367 | /* End PBXTargetDependency section */ 368 | 369 | /* Begin PBXVariantGroup section */ 370 | 1B78B3851910DB4200BEB3D4 /* InfoPlist.strings */ = { 371 | isa = PBXVariantGroup; 372 | children = ( 373 | 1B78B3861910DB4200BEB3D4 /* en */, 374 | ); 375 | name = InfoPlist.strings; 376 | sourceTree = ""; 377 | }; 378 | 1B78B3911910DB4200BEB3D4 /* MainMenu.xib */ = { 379 | isa = PBXVariantGroup; 380 | children = ( 381 | 1B78B3921910DB4200BEB3D4 /* Base */, 382 | ); 383 | name = MainMenu.xib; 384 | sourceTree = ""; 385 | }; 386 | 1B78B3A31910DB4300BEB3D4 /* InfoPlist.strings */ = { 387 | isa = PBXVariantGroup; 388 | children = ( 389 | 1B78B3A41910DB4300BEB3D4 /* en */, 390 | ); 391 | name = InfoPlist.strings; 392 | sourceTree = ""; 393 | }; 394 | /* End PBXVariantGroup section */ 395 | 396 | /* Begin XCBuildConfiguration section */ 397 | 1B78B3A81910DB4300BEB3D4 /* Debug */ = { 398 | isa = XCBuildConfiguration; 399 | buildSettings = { 400 | ALWAYS_SEARCH_USER_PATHS = NO; 401 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 402 | CLANG_CXX_LIBRARY = "libc++"; 403 | CLANG_ENABLE_MODULES = YES; 404 | CLANG_ENABLE_OBJC_ARC = YES; 405 | CLANG_WARN_BOOL_CONVERSION = YES; 406 | CLANG_WARN_CONSTANT_CONVERSION = YES; 407 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 408 | CLANG_WARN_EMPTY_BODY = YES; 409 | CLANG_WARN_ENUM_CONVERSION = YES; 410 | CLANG_WARN_INT_CONVERSION = YES; 411 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 412 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 413 | COPY_PHASE_STRIP = NO; 414 | GCC_C_LANGUAGE_STANDARD = gnu99; 415 | GCC_DYNAMIC_NO_PIC = NO; 416 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 417 | GCC_OPTIMIZATION_LEVEL = 0; 418 | GCC_PREPROCESSOR_DEFINITIONS = ( 419 | "DEBUG=1", 420 | "$(inherited)", 421 | ); 422 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 423 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 424 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 425 | GCC_WARN_UNDECLARED_SELECTOR = YES; 426 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 427 | GCC_WARN_UNUSED_FUNCTION = YES; 428 | GCC_WARN_UNUSED_VARIABLE = YES; 429 | MACOSX_DEPLOYMENT_TARGET = 10.9; 430 | ONLY_ACTIVE_ARCH = YES; 431 | SDKROOT = macosx; 432 | WARNING_CFLAGS = "-Wall"; 433 | }; 434 | name = Debug; 435 | }; 436 | 1B78B3A91910DB4300BEB3D4 /* Release */ = { 437 | isa = XCBuildConfiguration; 438 | buildSettings = { 439 | ALWAYS_SEARCH_USER_PATHS = NO; 440 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 441 | CLANG_CXX_LIBRARY = "libc++"; 442 | CLANG_ENABLE_MODULES = YES; 443 | CLANG_ENABLE_OBJC_ARC = YES; 444 | CLANG_WARN_BOOL_CONVERSION = YES; 445 | CLANG_WARN_CONSTANT_CONVERSION = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INT_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | COPY_PHASE_STRIP = YES; 453 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 454 | ENABLE_NS_ASSERTIONS = NO; 455 | GCC_C_LANGUAGE_STANDARD = gnu99; 456 | GCC_ENABLE_OBJC_EXCEPTIONS = YES; 457 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 458 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 459 | GCC_WARN_UNDECLARED_SELECTOR = YES; 460 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 461 | GCC_WARN_UNUSED_FUNCTION = YES; 462 | GCC_WARN_UNUSED_VARIABLE = YES; 463 | MACOSX_DEPLOYMENT_TARGET = 10.9; 464 | SDKROOT = macosx; 465 | WARNING_CFLAGS = "-Wall"; 466 | }; 467 | name = Release; 468 | }; 469 | 1B78B3AB1910DB4300BEB3D4 /* Debug */ = { 470 | isa = XCBuildConfiguration; 471 | buildSettings = { 472 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 473 | COMBINE_HIDPI_IMAGES = YES; 474 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 475 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 476 | INFOPLIST_FILE = "ImageFilterExample/ImageFilterExample-Info.plist"; 477 | MACOSX_DEPLOYMENT_TARGET = 10.10; 478 | OTHER_CFLAGS = "-Wall"; 479 | PRODUCT_NAME = "$(TARGET_NAME)"; 480 | WRAPPER_EXTENSION = app; 481 | }; 482 | name = Debug; 483 | }; 484 | 1B78B3AC1910DB4300BEB3D4 /* Release */ = { 485 | isa = XCBuildConfiguration; 486 | buildSettings = { 487 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 488 | COMBINE_HIDPI_IMAGES = YES; 489 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 490 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 491 | INFOPLIST_FILE = "ImageFilterExample/ImageFilterExample-Info.plist"; 492 | MACOSX_DEPLOYMENT_TARGET = 10.10; 493 | PRODUCT_NAME = "$(TARGET_NAME)"; 494 | WRAPPER_EXTENSION = app; 495 | }; 496 | name = Release; 497 | }; 498 | 1B78B3AE1910DB4300BEB3D4 /* Debug */ = { 499 | isa = XCBuildConfiguration; 500 | buildSettings = { 501 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ImageFilterExample.app/Contents/MacOS/ImageFilterExample"; 502 | COMBINE_HIDPI_IMAGES = YES; 503 | FRAMEWORK_SEARCH_PATHS = ( 504 | "$(DEVELOPER_FRAMEWORKS_DIR)", 505 | "$(inherited)", 506 | ); 507 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 508 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 509 | GCC_PREPROCESSOR_DEFINITIONS = ( 510 | "DEBUG=1", 511 | "$(inherited)", 512 | ); 513 | INFOPLIST_FILE = "ImageFilterExampleTests/ImageFilterExampleTests-Info.plist"; 514 | PRODUCT_NAME = "$(TARGET_NAME)"; 515 | TEST_HOST = "$(BUNDLE_LOADER)"; 516 | WRAPPER_EXTENSION = xctest; 517 | }; 518 | name = Debug; 519 | }; 520 | 1B78B3AF1910DB4300BEB3D4 /* Release */ = { 521 | isa = XCBuildConfiguration; 522 | buildSettings = { 523 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ImageFilterExample.app/Contents/MacOS/ImageFilterExample"; 524 | COMBINE_HIDPI_IMAGES = YES; 525 | FRAMEWORK_SEARCH_PATHS = ( 526 | "$(DEVELOPER_FRAMEWORKS_DIR)", 527 | "$(inherited)", 528 | ); 529 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 530 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 531 | INFOPLIST_FILE = "ImageFilterExampleTests/ImageFilterExampleTests-Info.plist"; 532 | PRODUCT_NAME = "$(TARGET_NAME)"; 533 | TEST_HOST = "$(BUNDLE_LOADER)"; 534 | WRAPPER_EXTENSION = xctest; 535 | }; 536 | name = Release; 537 | }; 538 | /* End XCBuildConfiguration section */ 539 | 540 | /* Begin XCConfigurationList section */ 541 | 1B78B3741910DB4200BEB3D4 /* Build configuration list for PBXProject "ImageFilterExample" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 1B78B3A81910DB4300BEB3D4 /* Debug */, 545 | 1B78B3A91910DB4300BEB3D4 /* Release */, 546 | ); 547 | defaultConfigurationIsVisible = 0; 548 | defaultConfigurationName = Release; 549 | }; 550 | 1B78B3AA1910DB4300BEB3D4 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */ = { 551 | isa = XCConfigurationList; 552 | buildConfigurations = ( 553 | 1B78B3AB1910DB4300BEB3D4 /* Debug */, 554 | 1B78B3AC1910DB4300BEB3D4 /* Release */, 555 | ); 556 | defaultConfigurationIsVisible = 0; 557 | defaultConfigurationName = Release; 558 | }; 559 | 1B78B3AD1910DB4300BEB3D4 /* Build configuration list for PBXNativeTarget "ImageFilterExampleTests" */ = { 560 | isa = XCConfigurationList; 561 | buildConfigurations = ( 562 | 1B78B3AE1910DB4300BEB3D4 /* Debug */, 563 | 1B78B3AF1910DB4300BEB3D4 /* Release */, 564 | ); 565 | defaultConfigurationIsVisible = 0; 566 | defaultConfigurationName = Release; 567 | }; 568 | /* End XCConfigurationList section */ 569 | }; 570 | rootObject = 1B78B3711910DB4200BEB3D4 /* Project object */; 571 | } 572 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/ImageFilterExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.nblgstr.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSApplicationCategoryType 26 | public.app-category.photography 27 | LSMinimumSystemVersion 28 | ${MACOSX_DEPLOYMENT_TARGET} 29 | NSHumanReadableCopyright 30 | Copyright © 2014 James Womack. All rights reserved. 31 | NSMainNibFile 32 | MainMenu 33 | NSPrincipalClass 34 | NSApplication 35 | 36 | 37 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/ImageFilterExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #ifdef __OBJC__ 8 | #import 9 | #endif 10 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/NGAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGAppDelegate.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 4/30/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NGAppDelegate : NSObject 12 | 13 | @property (assign) IBOutlet NSWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/NGAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGAppDelegate.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 4/30/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import "NGAppDelegate.h" 10 | #import "ImageFilter.h" 11 | 12 | @implementation NGAppDelegate 13 | 14 | - (void)applicationDidFinishLaunching:(NSNotification *)aNotification 15 | { 16 | // Insert code here to initialize your application 17 | } 18 | 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2012—2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : NSViewController 12 | 13 | @property (weak, nonatomic) IBOutlet NSImageView *imageView; 14 | @property (readonly, nonatomic) NSImage *originalImage; 15 | @property (readonly, nonatomic) NSImage *flippedImage; 16 | 17 | - (IBAction)sharpify:(NSButton *)sender; 18 | - (IBAction)previousState:(NSButton *)sender; 19 | - (IBAction)toggle:(NSClickGestureRecognizer *)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2012—2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "ImageFilter.h" 11 | #import "Platforms.h" 12 | 13 | @implementation ViewController { 14 | NSImage *originalImage; 15 | NSImage *flippedImage; 16 | NSImage *currentImage; 17 | } 18 | 19 | @dynamic originalImage, flippedImage; 20 | 21 | 22 | - (void)viewDidAppear { 23 | [super viewDidAppear]; 24 | currentImage = self.originalImage; 25 | } 26 | 27 | 28 | - (NSImage *)originalImage { 29 | !originalImage && (originalImage = self.imageView.image); 30 | return originalImage; 31 | } 32 | 33 | - (NSImage *)flippedImage { 34 | !flippedImage && (flippedImage = [NSImage imageNamed:@"north-park_sunflower_flipped"]); 35 | return flippedImage; 36 | } 37 | 38 | - (IBAction)toggle:(NSClickGestureRecognizer *)sender 39 | { 40 | if (sender.state != NSGestureRecognizerStateEnded) { 41 | return; 42 | } 43 | 44 | if (!currentImage || [currentImage isEqual:self.flippedImage]) { 45 | currentImage = self.originalImage; 46 | }else if ([currentImage isEqual:self.originalImage]) { 47 | currentImage = self.flippedImage; 48 | } 49 | 50 | self.imageView.image = currentImage; 51 | } 52 | 53 | - (IBAction)sharpify:(NSButton *)sender 54 | { 55 | self.imageView.image = currentImage.sharpify.crossProcess; 56 | } 57 | 58 | - (IBAction)previousState:(NSButton *)sender 59 | { 60 | self.imageView.image = currentImage; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 4/30/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | int main(int argc, const char * argv[]) 12 | { 13 | return NSApplicationMain(argc, argv); 14 | } 15 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExampleTests/ImageFilterExampleTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.nblgstr.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExampleTests/ImageFilterExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilterExampleTests.m 3 | // ImageFilterExampleTests 4 | // 5 | // Created by James Womack on 4/30/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ImageFilterExampleTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ImageFilterExampleTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ImageFilters/examples/Mac/ImageFilterExampleTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B78B36819108ADB00BEB3D4 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B78B36719108ADB00BEB3D4 /* Default-568h@2x.png */; }; 11 | 1B78B36C1910C66800BEB3D4 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B78B36B1910C66800BEB3D4 /* Accelerate.framework */; }; 12 | 1B7E93E8192B006B008EB9EA /* north-park_sunflower.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B7E93E6192B006B008EB9EA /* north-park_sunflower.png */; }; 13 | 1B7E93E9192B006B008EB9EA /* north-park_sunflower@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1B7E93E7192B006B008EB9EA /* north-park_sunflower@2x.png */; }; 14 | 1B7E93ED192B0CD0008EB9EA /* AppDelegate.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B7E93EC192B0CD0008EB9EA /* AppDelegate.xib */; }; 15 | 1B7E93EF192B0D31008EB9EA /* ViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1B7E93EE192B0D31008EB9EA /* ViewController.xib */; }; 16 | 2D01F7D2F4A78F54E228F4DC /* libPods-ImageFilterExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 501124EED748F48EA4F5E43F /* libPods-ImageFilterExample.a */; }; 17 | 59776F0215B4035300433DE9 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59776F0115B4035300433DE9 /* UIKit.framework */; }; 18 | 59776F0415B4035300433DE9 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59776F0315B4035300433DE9 /* Foundation.framework */; }; 19 | 59776F0615B4035300433DE9 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59776F0515B4035300433DE9 /* CoreGraphics.framework */; }; 20 | 59776F0E15B4035300433DE9 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 59776F0D15B4035300433DE9 /* main.m */; }; 21 | 59776F1215B4035300433DE9 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 59776F1115B4035300433DE9 /* AppDelegate.m */; }; 22 | 59776F1B15B4035300433DE9 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 59776F1A15B4035300433DE9 /* ViewController.m */; }; 23 | 59776F2B15B40F3000433DE9 /* CoreImage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 59776F2A15B40F3000433DE9 /* CoreImage.framework */; }; 24 | 738415311A915A0A0018BFC1 /* ImageFilterExampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 738415301A915A0A0018BFC1 /* ImageFilterExampleTests.m */; }; 25 | 8D573EC46A51DB546DAB199E /* libPods-ImageFilterExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4295E592912F069431050756 /* libPods-ImageFilterExampleTests.a */; }; 26 | /* End PBXBuildFile section */ 27 | 28 | /* Begin PBXContainerItemProxy section */ 29 | 738415321A915A0A0018BFC1 /* PBXContainerItemProxy */ = { 30 | isa = PBXContainerItemProxy; 31 | containerPortal = 59776EF415B4035300433DE9 /* Project object */; 32 | proxyType = 1; 33 | remoteGlobalIDString = 59776EFC15B4035300433DE9; 34 | remoteInfo = ImageFilterExample; 35 | }; 36 | /* End PBXContainerItemProxy section */ 37 | 38 | /* Begin PBXFileReference section */ 39 | 1B78B36719108ADB00BEB3D4 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 40 | 1B78B36B1910C66800BEB3D4 /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; }; 41 | 1B7E93E6192B006B008EB9EA /* north-park_sunflower.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "north-park_sunflower.png"; sourceTree = ""; }; 42 | 1B7E93E7192B006B008EB9EA /* north-park_sunflower@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "north-park_sunflower@2x.png"; sourceTree = ""; }; 43 | 1B7E93EC192B0CD0008EB9EA /* AppDelegate.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AppDelegate.xib; sourceTree = ""; }; 44 | 1B7E93EE192B0D31008EB9EA /* ViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ViewController.xib; sourceTree = ""; }; 45 | 4295E592912F069431050756 /* libPods-ImageFilterExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ImageFilterExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 501124EED748F48EA4F5E43F /* libPods-ImageFilterExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-ImageFilterExample.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 52F0594EBC8BF414092B0F43 /* Pods-ImageFilterExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageFilterExampleTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ImageFilterExampleTests/Pods-ImageFilterExampleTests.debug.xcconfig"; sourceTree = ""; }; 48 | 59776EFD15B4035300433DE9 /* ImageFilterExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ImageFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 59776F0115B4035300433DE9 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 50 | 59776F0315B4035300433DE9 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 51 | 59776F0515B4035300433DE9 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 52 | 59776F0915B4035300433DE9 /* ImageFilterExample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "ImageFilterExample-Info.plist"; sourceTree = ""; }; 53 | 59776F0D15B4035300433DE9 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 54 | 59776F0F15B4035300433DE9 /* ImageFilterExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ImageFilterExample-Prefix.pch"; sourceTree = ""; }; 55 | 59776F1015B4035300433DE9 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 56 | 59776F1115B4035300433DE9 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 57 | 59776F1915B4035300433DE9 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 58 | 59776F1A15B4035300433DE9 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 59 | 59776F2A15B40F3000433DE9 /* CoreImage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreImage.framework; path = System/Library/Frameworks/CoreImage.framework; sourceTree = SDKROOT; }; 60 | 7384152C1A915A0A0018BFC1 /* ImageFilterExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageFilterExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | 7384152F1A915A0A0018BFC1 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | 738415301A915A0A0018BFC1 /* ImageFilterExampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageFilterExampleTests.m; sourceTree = ""; }; 63 | 9330F35BE90E99588A1AA185 /* Pods-ImageFilterExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageFilterExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-ImageFilterExample/Pods-ImageFilterExample.release.xcconfig"; sourceTree = ""; }; 64 | B555C471A62F4135C0383714 /* Pods-ImageFilterExampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageFilterExampleTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-ImageFilterExampleTests/Pods-ImageFilterExampleTests.release.xcconfig"; sourceTree = ""; }; 65 | C44D52FC67C2F8298D041EAC /* Pods-ImageFilterExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ImageFilterExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-ImageFilterExample/Pods-ImageFilterExample.debug.xcconfig"; sourceTree = ""; }; 66 | /* End PBXFileReference section */ 67 | 68 | /* Begin PBXFrameworksBuildPhase section */ 69 | 59776EFA15B4035300433DE9 /* Frameworks */ = { 70 | isa = PBXFrameworksBuildPhase; 71 | buildActionMask = 2147483647; 72 | files = ( 73 | 1B78B36C1910C66800BEB3D4 /* Accelerate.framework in Frameworks */, 74 | 59776F2B15B40F3000433DE9 /* CoreImage.framework in Frameworks */, 75 | 59776F0615B4035300433DE9 /* CoreGraphics.framework in Frameworks */, 76 | 59776F0215B4035300433DE9 /* UIKit.framework in Frameworks */, 77 | 59776F0415B4035300433DE9 /* Foundation.framework in Frameworks */, 78 | 2D01F7D2F4A78F54E228F4DC /* libPods-ImageFilterExample.a in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | 738415291A915A0A0018BFC1 /* Frameworks */ = { 83 | isa = PBXFrameworksBuildPhase; 84 | buildActionMask = 2147483647; 85 | files = ( 86 | 8D573EC46A51DB546DAB199E /* libPods-ImageFilterExampleTests.a in Frameworks */, 87 | ); 88 | runOnlyForDeploymentPostprocessing = 0; 89 | }; 90 | /* End PBXFrameworksBuildPhase section */ 91 | 92 | /* Begin PBXGroup section */ 93 | 1734798888CD4951338054F1 /* Pods */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 52F0594EBC8BF414092B0F43 /* Pods-ImageFilterExampleTests.debug.xcconfig */, 97 | B555C471A62F4135C0383714 /* Pods-ImageFilterExampleTests.release.xcconfig */, 98 | C44D52FC67C2F8298D041EAC /* Pods-ImageFilterExample.debug.xcconfig */, 99 | 9330F35BE90E99588A1AA185 /* Pods-ImageFilterExample.release.xcconfig */, 100 | ); 101 | name = Pods; 102 | sourceTree = ""; 103 | }; 104 | 1B78B3641910815500BEB3D4 /* IB */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 1B7E93EC192B0CD0008EB9EA /* AppDelegate.xib */, 108 | 1B7E93EE192B0D31008EB9EA /* ViewController.xib */, 109 | ); 110 | name = IB; 111 | sourceTree = ""; 112 | }; 113 | 59776EF215B4035300433DE9 = { 114 | isa = PBXGroup; 115 | children = ( 116 | 59776F0715B4035300433DE9 /* ImageFilterExample */, 117 | 7384152D1A915A0A0018BFC1 /* ImageFilterExampleTests */, 118 | 59776F0015B4035300433DE9 /* Frameworks */, 119 | 59776EFE15B4035300433DE9 /* Products */, 120 | 1734798888CD4951338054F1 /* Pods */, 121 | ); 122 | sourceTree = ""; 123 | }; 124 | 59776EFE15B4035300433DE9 /* Products */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 59776EFD15B4035300433DE9 /* ImageFilterExample.app */, 128 | 7384152C1A915A0A0018BFC1 /* ImageFilterExampleTests.xctest */, 129 | ); 130 | name = Products; 131 | sourceTree = ""; 132 | }; 133 | 59776F0015B4035300433DE9 /* Frameworks */ = { 134 | isa = PBXGroup; 135 | children = ( 136 | 1B78B36B1910C66800BEB3D4 /* Accelerate.framework */, 137 | 59776F2A15B40F3000433DE9 /* CoreImage.framework */, 138 | 59776F0115B4035300433DE9 /* UIKit.framework */, 139 | 59776F0315B4035300433DE9 /* Foundation.framework */, 140 | 59776F0515B4035300433DE9 /* CoreGraphics.framework */, 141 | 4295E592912F069431050756 /* libPods-ImageFilterExampleTests.a */, 142 | 501124EED748F48EA4F5E43F /* libPods-ImageFilterExample.a */, 143 | ); 144 | name = Frameworks; 145 | sourceTree = ""; 146 | }; 147 | 59776F0715B4035300433DE9 /* ImageFilterExample */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 59776F1015B4035300433DE9 /* AppDelegate.h */, 151 | 59776F1115B4035300433DE9 /* AppDelegate.m */, 152 | 59776F1915B4035300433DE9 /* ViewController.h */, 153 | 59776F1A15B4035300433DE9 /* ViewController.m */, 154 | 59776F0815B4035300433DE9 /* Supporting Files */, 155 | ); 156 | path = ImageFilterExample; 157 | sourceTree = ""; 158 | }; 159 | 59776F0815B4035300433DE9 /* Supporting Files */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 1B78B3641910815500BEB3D4 /* IB */, 163 | 59776F2415B404F500433DE9 /* Images */, 164 | 59776F0915B4035300433DE9 /* ImageFilterExample-Info.plist */, 165 | 59776F0D15B4035300433DE9 /* main.m */, 166 | 59776F0F15B4035300433DE9 /* ImageFilterExample-Prefix.pch */, 167 | ); 168 | name = "Supporting Files"; 169 | sourceTree = ""; 170 | }; 171 | 59776F2415B404F500433DE9 /* Images */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | 1B78B36719108ADB00BEB3D4 /* Default-568h@2x.png */, 175 | 1B7E93E6192B006B008EB9EA /* north-park_sunflower.png */, 176 | 1B7E93E7192B006B008EB9EA /* north-park_sunflower@2x.png */, 177 | ); 178 | path = Images; 179 | sourceTree = ""; 180 | }; 181 | 7384152D1A915A0A0018BFC1 /* ImageFilterExampleTests */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 738415301A915A0A0018BFC1 /* ImageFilterExampleTests.m */, 185 | 7384152E1A915A0A0018BFC1 /* Supporting Files */, 186 | ); 187 | path = ImageFilterExampleTests; 188 | sourceTree = ""; 189 | }; 190 | 7384152E1A915A0A0018BFC1 /* Supporting Files */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | 7384152F1A915A0A0018BFC1 /* Info.plist */, 194 | ); 195 | name = "Supporting Files"; 196 | sourceTree = ""; 197 | }; 198 | /* End PBXGroup section */ 199 | 200 | /* Begin PBXNativeTarget section */ 201 | 59776EFC15B4035300433DE9 /* ImageFilterExample */ = { 202 | isa = PBXNativeTarget; 203 | buildConfigurationList = 59776F1E15B4035300433DE9 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */; 204 | buildPhases = ( 205 | 12055823E2068E051DD02930 /* Check Pods Manifest.lock */, 206 | 59776EF915B4035300433DE9 /* Sources */, 207 | 59776EFA15B4035300433DE9 /* Frameworks */, 208 | 59776EFB15B4035300433DE9 /* Resources */, 209 | 48143D3414E096C86CAEC6E5 /* Copy Pods Resources */, 210 | ); 211 | buildRules = ( 212 | ); 213 | dependencies = ( 214 | ); 215 | name = ImageFilterExample; 216 | productName = ImageFilterExample; 217 | productReference = 59776EFD15B4035300433DE9 /* ImageFilterExample.app */; 218 | productType = "com.apple.product-type.application"; 219 | }; 220 | 7384152B1A915A0A0018BFC1 /* ImageFilterExampleTests */ = { 221 | isa = PBXNativeTarget; 222 | buildConfigurationList = 738415361A915A0A0018BFC1 /* Build configuration list for PBXNativeTarget "ImageFilterExampleTests" */; 223 | buildPhases = ( 224 | 563F049AD9F10C7116C1767E /* Check Pods Manifest.lock */, 225 | 738415281A915A0A0018BFC1 /* Sources */, 226 | 738415291A915A0A0018BFC1 /* Frameworks */, 227 | 7384152A1A915A0A0018BFC1 /* Resources */, 228 | 980A867FD6CCB83BFB5754B4 /* Copy Pods Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 738415331A915A0A0018BFC1 /* PBXTargetDependency */, 234 | ); 235 | name = ImageFilterExampleTests; 236 | productName = ImageFilterExampleTests; 237 | productReference = 7384152C1A915A0A0018BFC1 /* ImageFilterExampleTests.xctest */; 238 | productType = "com.apple.product-type.bundle.unit-test"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 59776EF415B4035300433DE9 /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | LastUpgradeCheck = 0510; 247 | ORGANIZATIONNAME = "James Womack"; 248 | TargetAttributes = { 249 | 7384152B1A915A0A0018BFC1 = { 250 | CreatedOnToolsVersion = 6.1.1; 251 | TestTargetID = 59776EFC15B4035300433DE9; 252 | }; 253 | }; 254 | }; 255 | buildConfigurationList = 59776EF715B4035300433DE9 /* Build configuration list for PBXProject "ImageFilterExample" */; 256 | compatibilityVersion = "Xcode 3.2"; 257 | developmentRegion = English; 258 | hasScannedForEncodings = 0; 259 | knownRegions = ( 260 | en, 261 | ); 262 | mainGroup = 59776EF215B4035300433DE9; 263 | productRefGroup = 59776EFE15B4035300433DE9 /* Products */; 264 | projectDirPath = ""; 265 | projectRoot = ""; 266 | targets = ( 267 | 59776EFC15B4035300433DE9 /* ImageFilterExample */, 268 | 7384152B1A915A0A0018BFC1 /* ImageFilterExampleTests */, 269 | ); 270 | }; 271 | /* End PBXProject section */ 272 | 273 | /* Begin PBXResourcesBuildPhase section */ 274 | 59776EFB15B4035300433DE9 /* Resources */ = { 275 | isa = PBXResourcesBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | 1B7E93EF192B0D31008EB9EA /* ViewController.xib in Resources */, 279 | 1B78B36819108ADB00BEB3D4 /* Default-568h@2x.png in Resources */, 280 | 1B7E93E8192B006B008EB9EA /* north-park_sunflower.png in Resources */, 281 | 1B7E93ED192B0CD0008EB9EA /* AppDelegate.xib in Resources */, 282 | 1B7E93E9192B006B008EB9EA /* north-park_sunflower@2x.png in Resources */, 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | }; 286 | 7384152A1A915A0A0018BFC1 /* Resources */ = { 287 | isa = PBXResourcesBuildPhase; 288 | buildActionMask = 2147483647; 289 | files = ( 290 | ); 291 | runOnlyForDeploymentPostprocessing = 0; 292 | }; 293 | /* End PBXResourcesBuildPhase section */ 294 | 295 | /* Begin PBXShellScriptBuildPhase section */ 296 | 12055823E2068E051DD02930 /* Check Pods Manifest.lock */ = { 297 | isa = PBXShellScriptBuildPhase; 298 | buildActionMask = 2147483647; 299 | files = ( 300 | ); 301 | inputPaths = ( 302 | ); 303 | name = "Check Pods Manifest.lock"; 304 | outputPaths = ( 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | shellPath = /bin/sh; 308 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 309 | showEnvVarsInLog = 0; 310 | }; 311 | 48143D3414E096C86CAEC6E5 /* Copy Pods Resources */ = { 312 | isa = PBXShellScriptBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | ); 316 | inputPaths = ( 317 | ); 318 | name = "Copy Pods Resources"; 319 | outputPaths = ( 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | shellPath = /bin/sh; 323 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ImageFilterExample/Pods-ImageFilterExample-resources.sh\"\n"; 324 | showEnvVarsInLog = 0; 325 | }; 326 | 563F049AD9F10C7116C1767E /* Check Pods Manifest.lock */ = { 327 | isa = PBXShellScriptBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | ); 331 | inputPaths = ( 332 | ); 333 | name = "Check Pods Manifest.lock"; 334 | outputPaths = ( 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | shellPath = /bin/sh; 338 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 339 | showEnvVarsInLog = 0; 340 | }; 341 | 980A867FD6CCB83BFB5754B4 /* Copy Pods Resources */ = { 342 | isa = PBXShellScriptBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | ); 346 | inputPaths = ( 347 | ); 348 | name = "Copy Pods Resources"; 349 | outputPaths = ( 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | shellPath = /bin/sh; 353 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-ImageFilterExampleTests/Pods-ImageFilterExampleTests-resources.sh\"\n"; 354 | showEnvVarsInLog = 0; 355 | }; 356 | /* End PBXShellScriptBuildPhase section */ 357 | 358 | /* Begin PBXSourcesBuildPhase section */ 359 | 59776EF915B4035300433DE9 /* Sources */ = { 360 | isa = PBXSourcesBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | 59776F0E15B4035300433DE9 /* main.m in Sources */, 364 | 59776F1215B4035300433DE9 /* AppDelegate.m in Sources */, 365 | 59776F1B15B4035300433DE9 /* ViewController.m in Sources */, 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | }; 369 | 738415281A915A0A0018BFC1 /* Sources */ = { 370 | isa = PBXSourcesBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | 738415311A915A0A0018BFC1 /* ImageFilterExampleTests.m in Sources */, 374 | ); 375 | runOnlyForDeploymentPostprocessing = 0; 376 | }; 377 | /* End PBXSourcesBuildPhase section */ 378 | 379 | /* Begin PBXTargetDependency section */ 380 | 738415331A915A0A0018BFC1 /* PBXTargetDependency */ = { 381 | isa = PBXTargetDependency; 382 | target = 59776EFC15B4035300433DE9 /* ImageFilterExample */; 383 | targetProxy = 738415321A915A0A0018BFC1 /* PBXContainerItemProxy */; 384 | }; 385 | /* End PBXTargetDependency section */ 386 | 387 | /* Begin XCBuildConfiguration section */ 388 | 59776F1C15B4035300433DE9 /* Debug */ = { 389 | isa = XCBuildConfiguration; 390 | buildSettings = { 391 | ALWAYS_SEARCH_USER_PATHS = NO; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 393 | CLANG_ENABLE_OBJC_ARC = YES; 394 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 395 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 396 | COPY_PHASE_STRIP = NO; 397 | GCC_C_LANGUAGE_STANDARD = gnu99; 398 | GCC_DYNAMIC_NO_PIC = NO; 399 | GCC_OPTIMIZATION_LEVEL = 0; 400 | GCC_PREPROCESSOR_DEFINITIONS = ( 401 | "DEBUG=1", 402 | "$(inherited)", 403 | ); 404 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 405 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 406 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 407 | GCC_WARN_UNUSED_VARIABLE = YES; 408 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 409 | ONLY_ACTIVE_ARCH = YES; 410 | SDKROOT = iphoneos; 411 | TARGETED_DEVICE_FAMILY = "1,2"; 412 | WARNING_CFLAGS = ( 413 | "-Wextra", 414 | "-Wall", 415 | ); 416 | }; 417 | name = Debug; 418 | }; 419 | 59776F1D15B4035300433DE9 /* Release */ = { 420 | isa = XCBuildConfiguration; 421 | buildSettings = { 422 | ALWAYS_SEARCH_USER_PATHS = NO; 423 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 424 | CLANG_ENABLE_OBJC_ARC = YES; 425 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 426 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 427 | COPY_PHASE_STRIP = YES; 428 | GCC_C_LANGUAGE_STANDARD = gnu99; 429 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 430 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 431 | GCC_WARN_UNUSED_VARIABLE = YES; 432 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 433 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 434 | SDKROOT = iphoneos; 435 | TARGETED_DEVICE_FAMILY = "1,2"; 436 | VALIDATE_PRODUCT = YES; 437 | WARNING_CFLAGS = ( 438 | "-Wextra", 439 | "-Wall", 440 | ); 441 | }; 442 | name = Release; 443 | }; 444 | 59776F1F15B4035300433DE9 /* Debug */ = { 445 | isa = XCBuildConfiguration; 446 | baseConfigurationReference = C44D52FC67C2F8298D041EAC /* Pods-ImageFilterExample.debug.xcconfig */; 447 | buildSettings = { 448 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 449 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 450 | INFOPLIST_FILE = "ImageFilterExample/ImageFilterExample-Info.plist"; 451 | PRODUCT_NAME = "$(TARGET_NAME)"; 452 | WRAPPER_EXTENSION = app; 453 | }; 454 | name = Debug; 455 | }; 456 | 59776F2015B4035300433DE9 /* Release */ = { 457 | isa = XCBuildConfiguration; 458 | baseConfigurationReference = 9330F35BE90E99588A1AA185 /* Pods-ImageFilterExample.release.xcconfig */; 459 | buildSettings = { 460 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 461 | GCC_PREFIX_HEADER = "ImageFilterExample/ImageFilterExample-Prefix.pch"; 462 | INFOPLIST_FILE = "ImageFilterExample/ImageFilterExample-Info.plist"; 463 | PRODUCT_NAME = "$(TARGET_NAME)"; 464 | WRAPPER_EXTENSION = app; 465 | }; 466 | name = Release; 467 | }; 468 | 738415341A915A0A0018BFC1 /* Debug */ = { 469 | isa = XCBuildConfiguration; 470 | baseConfigurationReference = 52F0594EBC8BF414092B0F43 /* Pods-ImageFilterExampleTests.debug.xcconfig */; 471 | buildSettings = { 472 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ImageFilterExample.app/ImageFilterExample"; 473 | CLANG_CXX_LIBRARY = "libc++"; 474 | CLANG_ENABLE_MODULES = YES; 475 | CLANG_WARN_BOOL_CONVERSION = YES; 476 | CLANG_WARN_CONSTANT_CONVERSION = YES; 477 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 478 | CLANG_WARN_EMPTY_BODY = YES; 479 | CLANG_WARN_ENUM_CONVERSION = YES; 480 | CLANG_WARN_INT_CONVERSION = YES; 481 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 482 | CLANG_WARN_UNREACHABLE_CODE = YES; 483 | ENABLE_STRICT_OBJC_MSGSEND = YES; 484 | FRAMEWORK_SEARCH_PATHS = ( 485 | "$(SDKROOT)/Developer/Library/Frameworks", 486 | "$(inherited)", 487 | ); 488 | GCC_PREPROCESSOR_DEFINITIONS = ( 489 | "DEBUG=1", 490 | "$(inherited)", 491 | ); 492 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 493 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 494 | GCC_WARN_UNDECLARED_SELECTOR = YES; 495 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 496 | GCC_WARN_UNUSED_FUNCTION = YES; 497 | INFOPLIST_FILE = ImageFilterExampleTests/Info.plist; 498 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 499 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 500 | MTL_ENABLE_DEBUG_INFO = YES; 501 | PRODUCT_NAME = "$(TARGET_NAME)"; 502 | TEST_HOST = "$(BUNDLE_LOADER)"; 503 | }; 504 | name = Debug; 505 | }; 506 | 738415351A915A0A0018BFC1 /* Release */ = { 507 | isa = XCBuildConfiguration; 508 | baseConfigurationReference = B555C471A62F4135C0383714 /* Pods-ImageFilterExampleTests.release.xcconfig */; 509 | buildSettings = { 510 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/ImageFilterExample.app/ImageFilterExample"; 511 | CLANG_CXX_LIBRARY = "libc++"; 512 | CLANG_ENABLE_MODULES = YES; 513 | CLANG_WARN_BOOL_CONVERSION = YES; 514 | CLANG_WARN_CONSTANT_CONVERSION = YES; 515 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 516 | CLANG_WARN_EMPTY_BODY = YES; 517 | CLANG_WARN_ENUM_CONVERSION = YES; 518 | CLANG_WARN_INT_CONVERSION = YES; 519 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 520 | CLANG_WARN_UNREACHABLE_CODE = YES; 521 | ENABLE_NS_ASSERTIONS = NO; 522 | ENABLE_STRICT_OBJC_MSGSEND = YES; 523 | FRAMEWORK_SEARCH_PATHS = ( 524 | "$(SDKROOT)/Developer/Library/Frameworks", 525 | "$(inherited)", 526 | ); 527 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 528 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 529 | GCC_WARN_UNDECLARED_SELECTOR = YES; 530 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 531 | GCC_WARN_UNUSED_FUNCTION = YES; 532 | INFOPLIST_FILE = ImageFilterExampleTests/Info.plist; 533 | IPHONEOS_DEPLOYMENT_TARGET = 8.1; 534 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 535 | MTL_ENABLE_DEBUG_INFO = NO; 536 | PRODUCT_NAME = "$(TARGET_NAME)"; 537 | TEST_HOST = "$(BUNDLE_LOADER)"; 538 | }; 539 | name = Release; 540 | }; 541 | /* End XCBuildConfiguration section */ 542 | 543 | /* Begin XCConfigurationList section */ 544 | 59776EF715B4035300433DE9 /* Build configuration list for PBXProject "ImageFilterExample" */ = { 545 | isa = XCConfigurationList; 546 | buildConfigurations = ( 547 | 59776F1C15B4035300433DE9 /* Debug */, 548 | 59776F1D15B4035300433DE9 /* Release */, 549 | ); 550 | defaultConfigurationIsVisible = 0; 551 | defaultConfigurationName = Release; 552 | }; 553 | 59776F1E15B4035300433DE9 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */ = { 554 | isa = XCConfigurationList; 555 | buildConfigurations = ( 556 | 59776F1F15B4035300433DE9 /* Debug */, 557 | 59776F2015B4035300433DE9 /* Release */, 558 | ); 559 | defaultConfigurationIsVisible = 0; 560 | defaultConfigurationName = Release; 561 | }; 562 | 738415361A915A0A0018BFC1 /* Build configuration list for PBXNativeTarget "ImageFilterExampleTests" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | 738415341A915A0A0018BFC1 /* Debug */, 566 | 738415351A915A0A0018BFC1 /* Release */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | /* End XCConfigurationList section */ 572 | }; 573 | rootObject = 59776EF415B4035300433DE9 /* Project object */; 574 | } 575 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2011—2015 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2011—2015 James Womack. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)__unused application 15 | didFinishLaunchingWithOptions:(NSDictionary *)__unused launchOptions { 16 | return YES; 17 | } 18 | 19 | + (void)initialize { 20 | [ImageFilter initialize]; 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/AppDelegate.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/ImageFilterExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.cirrostratus.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSMainNibFile 28 | AppDelegate 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/ImageFilterExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'ImageFilterExample' target in the 'ImageFilterExample' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_5_0 8 | #warning "This project uses features only available in iOS SDK 5.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/Images/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/iOS/ImageFilterExample/Images/Default-568h@2x.png -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower.png -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower@2x.png -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower_flipped.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/iOS/ImageFilterExample/Images/north-park_sunflower_flipped.png -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2011—2015 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 14 | @property (strong, nonatomic) UIImage *originalImage; 15 | @property (strong, nonatomic) IBOutlet UISegmentedControl *segControl; 16 | 17 | - (IBAction)filter:(UIButton *)sender; 18 | - (IBAction)revert:(UIButton *)sender; 19 | - (IBAction)toggle:(UISegmentedControl *)sender; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2011—2015 James Womack. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @implementation ViewController 13 | 14 | - (void)viewDidLoad { 15 | [super viewDidLoad]; 16 | 17 | self.originalImage = self.imageView.image; 18 | } 19 | 20 | - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { 21 | if (UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPhone) { 22 | return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); 23 | } else { 24 | return YES; 25 | } 26 | } 27 | 28 | - (IBAction)filter:(UIButton *)__unused sender { 29 | self.segControl.selectedSegmentIndex = UISegmentedControlNoSegment; 30 | UIImage *image = [self.originalImage copy]; 31 | dispatch_async(dispatch_get_main_queue(), ^{ 32 | self.imageView.image = [image crossProcess]; 33 | }); 34 | } 35 | 36 | - (IBAction)revert:(UIButton *)__unused sender { 37 | self.segControl.selectedSegmentIndex = UISegmentedControlNoSegment; 38 | self.imageView.image = self.originalImage; 39 | self.imageView.image.filter = nil; 40 | } 41 | 42 | - (IBAction)toggle:(UISegmentedControl *)sender { 43 | if (!sender.selectedSegmentIndex) { 44 | [self filter:nil]; 45 | }else{ 46 | [self revert:nil]; 47 | } 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/ViewController.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 34 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 7/16/12. 6 | // Copyright (c) 2012 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExampleTests/ImageFilterExampleTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilterExampleTests.m 3 | // ImageFilterExampleTests 4 | // 5 | // Created by James Womack on 2/15/15. 6 | // Copyright (c) 2015 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #define HC_SHORTHAND 12 | #import 13 | #define MOCKITO_SHORTHAND 14 | #import 15 | #import "ImageFilter.h" 16 | 17 | SpecBegin(ImageFilter) 18 | 19 | describe(@"ImageFilter", ^{ 20 | it(@"receive forwarding requests from UIImage instances", ^{ 21 | UIImage *image = UIImage.new; 22 | ImageFilter *imageFilter = mock([ImageFilter class]); 23 | image.filter = imageFilter; 24 | 25 | [image blackAndWhite]; 26 | 27 | [verifyCount(imageFilter, times(1)) blackAndWhite]; 28 | }); 29 | }); 30 | 31 | SpecEnd -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/ImageFilterExampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | io.womack.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '7.0' 2 | 3 | target 'ImageFilterExample' do 4 | pod 'ImageFilters', :git => 'https://github.com/jameswomack/iOS-Image-Filters.git' 5 | end 6 | 7 | target 'ImageFilterExampleTests' do 8 | pod 'Specta' 9 | pod 'OCMockito' 10 | end 11 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/CoreFilter-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.nblgstr.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/CoreFilter-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #import "Platforms.h" 17 | #endif 18 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "40x40", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "60x60", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGAppDelegate.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NGAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGAppDelegate.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import "NGAppDelegate.h" 10 | 11 | @implementation NGAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 14 | return YES; 15 | } 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilter.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NGFilter : CIFilter 12 | @property (nonatomic, readwrite) CIImage *inputImage; 13 | @property (nonatomic, assign) BOOL *keepPreviousImages; 14 | - (CIImage *)outputImage; 15 | @end 16 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGFilter.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | 10 | #import "NGFilter.h" 11 | 12 | 13 | #define NG_FILTER @"NGFilter" 14 | #define NG_FILTER_EXCEPTION(m) [NSString stringWithFormat:@"%@%@",NG_FILTER,m] 15 | #define NG_FILTER_EXCEPTION_R(m) @"%@ %@",NG_FILTER,m 16 | #define INPUT_IMAGE_EXCEPTION NG_FILTER_EXCEPTION( @"InputImageException" ) 17 | #define INPUT_IMAGE_EXCEPTION_R NG_FILTER_EXCEPTION_R( @"a nil inputImage was passed" ) 18 | 19 | 20 | @implementation NGFilter { 21 | CIImage *_inputImage; 22 | CIFilter *_filter; 23 | NSCache *_filterResultCache; 24 | } 25 | 26 | 27 | + (CIFilter *)filterWithName:(NSString *)name { 28 | return self.new; 29 | } 30 | 31 | 32 | @synthesize inputImage = _inputImage; 33 | 34 | 35 | - (void)setInputImage:(CIImage *)inputImage { 36 | !inputImage && [self raiseInputImageException]; 37 | _inputImage = inputImage.copy; 38 | [self.filter setValue:_inputImage forKey:kCIInputImageKey]; 39 | !self.keepPreviousImages && [self clearCache]; 40 | } 41 | 42 | 43 | - (CIImage *)inputImage { 44 | return _inputImage; 45 | } 46 | 47 | 48 | - (BOOL)raiseInputImageException { 49 | [NSException raise:INPUT_IMAGE_EXCEPTION format:INPUT_IMAGE_EXCEPTION_R]; 50 | return YES; 51 | } 52 | 53 | 54 | - (CIFilter *)filter { 55 | !_filter && (_filter = [CIFilter filterWithName:@"CIGaussianBlur"]); 56 | [_filter setValue:_inputImage forKey:kCIInputImageKey]; 57 | return _filter; 58 | } 59 | 60 | 61 | - (NSCache *)filterResultCache { 62 | !_filterResultCache && (_filterResultCache = NSCache.new); 63 | return _filterResultCache; 64 | } 65 | 66 | 67 | - (BOOL)clearCache { 68 | [self.filterResultCache removeAllObjects]; 69 | return YES; 70 | } 71 | 72 | 73 | - (NSDictionary *)keysAndValues { 74 | return @{kCIInputRadiusKey: @(20.f), kCIInputImageKey: _inputImage}; 75 | } 76 | 77 | 78 | - (void)applyKeysAndValues { 79 | [self.keysAndValues enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 80 | [self.filter setValue:obj forKey:key]; 81 | }]; 82 | } 83 | 84 | - (id)valueForKey:(NSString *)key { 85 | if ([self.keysAndValues objectForKey:key]) { 86 | return [self.keysAndValues objectForKey:key]; 87 | } 88 | return [super valueForKey:key]; 89 | } 90 | 91 | 92 | - (NSString *)filterCacheKeyForCurrentState { 93 | NSUInteger inputImageHash = self.inputImage.hash; 94 | NSUInteger inputRadiusHash = [[self valueForKey:kCIInputRadiusKey] hash]; 95 | return [NSString stringWithFormat:@"%i_%i",inputImageHash,inputRadiusHash]; 96 | } 97 | 98 | 99 | - (CIImage *)getSetCachedFilterOutput:(NSString *)filterCacheKeyForCurrentState { 100 | CIImage *outputImage; 101 | 102 | if (!(outputImage = [self.filterResultCache objectForKey:filterCacheKeyForCurrentState])) { 103 | outputImage = self.filter.outputImage; 104 | [self.filterResultCache setObject:outputImage forKey:filterCacheKeyForCurrentState]; 105 | } 106 | 107 | return outputImage; 108 | } 109 | 110 | 111 | - (CIImage *)outputImage { 112 | return [self getSetCachedFilterOutput:self.filterCacheKeyForCurrentState]; 113 | } 114 | 115 | 116 | @end 117 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/16/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NGLayer : CAShapeLayer 12 | - (instancetype)initWithImage:(UIImage *)image; 13 | @end 14 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGLayer.m: -------------------------------------------------------------------------------- 1 | // 2 | // CALayer.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/16/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import "NGLayer.h" 10 | #import "UIImage+Filter.h" 11 | 12 | @interface NGLayer () 13 | @property (strong, nonatomic) CIDetector *faceDetector; 14 | @end 15 | 16 | @implementation NGLayer 17 | 18 | - (instancetype)initWithImage:(UIImage *)image { 19 | if ((self = super.init)) {; 20 | UIBezierPath *path = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 10, 200, 200)]; 21 | CGPathRef pathRef = path.CGPath; 22 | self.path = pathRef; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NGViewController.h 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NGViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *originalImageView; 14 | @property (weak, nonatomic) IBOutlet UIImageView *filteredImageView; 15 | @property (strong, nonatomic) IBOutlet UITapGestureRecognizer *mainViewTapGestureRecognizer; 16 | 17 | - (IBAction)receivedMainViewTapGesture:(UIGestureRecognizer *)gestureRecognizer; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/NGViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // NGViewController.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import "NGViewController.h" 10 | #import "NGFilter.h" 11 | #import "UIImage+Filter.h" 12 | #import "CIFilter+Filter.h" 13 | #import "CIImage+Filter.h" 14 | #import "NGLayer.h" 15 | 16 | #define DUMMY_RETURN_VALUE YES 17 | 18 | 19 | typedef BOOL NGFilteredImageViewAnimationType; 20 | NGFilteredImageViewAnimationType const NGFilteredImageViewAnimationTypeHide = 0; 21 | NGFilteredImageViewAnimationType const NGFilteredImageViewAnimationTypeShow = 1; 22 | 23 | 24 | 25 | @interface NGViewController () { 26 | NGFilter *_filter; 27 | } 28 | 29 | @property (readonly, nonatomic) BOOL shouldShowFilteredImageView; 30 | @property (readwrite, nonatomic) BOOL isAnimatingFilteredImageView; 31 | @property (readwrite, nonatomic) BOOL animationInProgressIsHideAnimation; 32 | @property (strong, nonatomic) NSNumber *queuedFilteredImageViewAnimation; 33 | @property (readonly, nonatomic) NGFilter *filter; 34 | @end 35 | 36 | 37 | @implementation NGViewController 38 | 39 | 40 | @dynamic shouldShowFilteredImageView, filter; 41 | 42 | 43 | - (void)viewDidLoad { 44 | [super viewDidLoad]; 45 | 46 | dispatch_sync(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 47 | UIImage *image = self.filter.outputImage.UIImage; 48 | dispatch_async(dispatch_get_main_queue(), ^{ 49 | UIImageView *imageView = self.filteredImageView; 50 | imageView.image = image; 51 | imageView.layer.mask = [NGLayer.alloc initWithImage:self.originalImageView.image]; 52 | }); 53 | }); 54 | } 55 | 56 | 57 | - (NGFilter *)filter { 58 | if (!_filter) { 59 | _filter = (NGFilter *)[NGFilter filterWithName:nil]; 60 | [_filter setValuesForKeysWithDictionary:@{ 61 | kCIInputImageKey: self.filteredImageView.image.CIImage 62 | }]; 63 | } 64 | return _filter; 65 | } 66 | 67 | 68 | - (IBAction)receivedMainViewTapGesture:(UIGestureRecognizer *)gestureRecognizer { 69 | NSAssert([gestureRecognizer isKindOfClass:UITapGestureRecognizer.class], @"%@", @"gestureRecognizer is a tap gesture"); 70 | 71 | if(!self.isAnimatingFilteredImageView) { 72 | self.shouldShowFilteredImageView ? [self showFilteredImageView] : [self hideFilteredImageView]; 73 | } else if(!self.queuedFilteredImageViewAnimation) { 74 | self.queuedFilteredImageViewAnimation = self.animationInProgressIsHideAnimation ? @(NGFilteredImageViewAnimationTypeShow) : @(NGFilteredImageViewAnimationTypeHide); 75 | } 76 | } 77 | 78 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { 79 | return YES; 80 | } 81 | 82 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { 83 | return YES; 84 | } 85 | 86 | - (BOOL)shouldShowFilteredImageView { 87 | return self.filteredImageView.alpha == 0.f; 88 | } 89 | 90 | - (BOOL)animateFilteredImageViewAlpha:(CGFloat)alpha { 91 | [self negotiateFilteredImageViewAnimationQueueingForAlpha:alpha]; 92 | 93 | [UIView animateWithDuration:.5f animations:^{ 94 | self.isAnimatingFilteredImageView = YES; 95 | self.filteredImageView.alpha = alpha; 96 | } completion:^(BOOL finished) { 97 | self.isAnimatingFilteredImageView = NO; 98 | 99 | self.queuedFilteredImageViewAnimation && [self animateFilteredImageViewAlpha:(CGFloat)self.queuedFilteredImageViewAnimation.boolValue]; 100 | self.queuedFilteredImageViewAnimation = nil; 101 | }]; 102 | 103 | return DUMMY_RETURN_VALUE; 104 | } 105 | 106 | - (void)negotiateFilteredImageViewAnimationQueueingForAlpha:(CGFloat)alpha { 107 | NGFilteredImageViewAnimationType animationType = (NGFilteredImageViewAnimationType)floorf(alpha); 108 | [self shouldQueueAnimationOfType:animationType] && (self.queuedFilteredImageViewAnimation = @(animationType)); 109 | } 110 | 111 | - (BOOL)shouldQueueAnimationOfType:(NGFilteredImageViewAnimationType)animationType { 112 | return self.isAnimatingFilteredImageView 113 | && animationType == self.animationInProgressIsHideAnimation 114 | && self.queuedFilteredImageViewAnimation == nil; 115 | } 116 | 117 | - (void)showFilteredImageView { 118 | [self animateFilteredImageViewAlpha:1.f]; 119 | self.animationInProgressIsHideAnimation = NO; 120 | } 121 | 122 | - (void)hideFilteredImageView { 123 | [self animateFilteredImageViewAlpha:0.f]; 124 | self.animationInProgressIsHideAnimation = YES; 125 | } 126 | 127 | - (void)didReceiveMemoryWarning { 128 | [super didReceiveMemoryWarning]; 129 | _filter = nil; 130 | } 131 | 132 | @end 133 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/chung.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/iOS_Touch_Response/CoreFilter/chung.jpg -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilter/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ImageFilterExample 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "NGAppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([NGAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilterTests/CoreFilterTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.nblgstr.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilterTests/CoreFilterTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageFilterExampleTests.m 3 | // ImageFilterExampleTests 4 | // 5 | // Created by James Womack on 5/15/14. 6 | // Copyright (c) 2014 James Womack. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CoreFilterTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation CoreFilterTests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/CoreFilterTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /ImageFilters/examples/iOS_Touch_Response/ImageFilterExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1B0CDE531929F84100251B38 /* NGFilterConstructor.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B0CDE501929F84100251B38 /* NGFilterConstructor.m */; }; 11 | 1B0CDE541929F84100251B38 /* NGFilterStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B0CDE521929F84100251B38 /* NGFilterStore.m */; }; 12 | 1B69B2D61924957E009FD709 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2D51924957E009FD709 /* Foundation.framework */; }; 13 | 1B69B2D81924957E009FD709 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2D71924957E009FD709 /* CoreGraphics.framework */; }; 14 | 1B69B2DA1924957E009FD709 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2D91924957E009FD709 /* UIKit.framework */; }; 15 | 1B69B2E01924957E009FD709 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B69B2DE1924957E009FD709 /* InfoPlist.strings */; }; 16 | 1B69B2E21924957E009FD709 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B2E11924957E009FD709 /* main.m */; }; 17 | 1B69B2E61924957E009FD709 /* NGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B2E51924957E009FD709 /* NGAppDelegate.m */; }; 18 | 1B69B2E91924957E009FD709 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 1B69B2E71924957E009FD709 /* Main.storyboard */; }; 19 | 1B69B2EC1924957E009FD709 /* NGViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B2EB1924957E009FD709 /* NGViewController.m */; }; 20 | 1B69B2EE1924957E009FD709 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1B69B2ED1924957E009FD709 /* Images.xcassets */; }; 21 | 1B69B2F51924957E009FD709 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2F41924957E009FD709 /* XCTest.framework */; }; 22 | 1B69B2F61924957E009FD709 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2D51924957E009FD709 /* Foundation.framework */; }; 23 | 1B69B2F71924957E009FD709 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B69B2D91924957E009FD709 /* UIKit.framework */; }; 24 | 1B69B2FF1924957E009FD709 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 1B69B2FD1924957E009FD709 /* InfoPlist.strings */; }; 25 | 1B69B3011924957E009FD709 /* CoreFilterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B3001924957E009FD709 /* CoreFilterTests.m */; }; 26 | 1B69B30C192495A5009FD709 /* NGFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B30B192495A5009FD709 /* NGFilter.m */; }; 27 | 1B69B30E1925F37C009FD709 /* chung.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 1B69B30D1925F37C009FD709 /* chung.jpg */; }; 28 | 1B69B3111925F515009FD709 /* UIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B3101925F515009FD709 /* UIImage+Filter.m */; }; 29 | 1B69B3151925F5C9009FD709 /* CIFilter+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B3141925F5C9009FD709 /* CIFilter+Filter.m */; }; 30 | 1B69B3181925F607009FD709 /* CIImage+Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B69B3171925F607009FD709 /* CIImage+Filter.m */; }; 31 | 1B9AFAE719262F97007BC676 /* NGLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 1B9AFAE619262F97007BC676 /* NGLayer.m */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | 1B69B2F81924957E009FD709 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = 1B69B2CA1924957E009FD709 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = 1B69B2D11924957E009FD709; 40 | remoteInfo = CoreFilter; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 1B0CDE4F1929F84100251B38 /* NGFilterConstructor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NGFilterConstructor.h; path = ../../../NGFilterConstructor.h; sourceTree = ""; }; 46 | 1B0CDE501929F84100251B38 /* NGFilterConstructor.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NGFilterConstructor.m; path = ../../../NGFilterConstructor.m; sourceTree = ""; }; 47 | 1B0CDE511929F84100251B38 /* NGFilterStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NGFilterStore.h; path = ../../../NGFilterStore.h; sourceTree = ""; }; 48 | 1B0CDE521929F84100251B38 /* NGFilterStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = NGFilterStore.m; path = ../../../NGFilterStore.m; sourceTree = ""; }; 49 | 1B69B2D21924957E009FD709 /* CoreFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; name = CoreFilter.app; path = ImageFilterExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | 1B69B2D51924957E009FD709 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 51 | 1B69B2D71924957E009FD709 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 52 | 1B69B2D91924957E009FD709 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 53 | 1B69B2DD1924957E009FD709 /* CoreFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CoreFilter-Info.plist"; sourceTree = ""; }; 54 | 1B69B2DF1924957E009FD709 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 55 | 1B69B2E11924957E009FD709 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 56 | 1B69B2E31924957E009FD709 /* CoreFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CoreFilter-Prefix.pch"; sourceTree = ""; }; 57 | 1B69B2E41924957E009FD709 /* NGAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NGAppDelegate.h; sourceTree = ""; }; 58 | 1B69B2E51924957E009FD709 /* NGAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NGAppDelegate.m; sourceTree = ""; }; 59 | 1B69B2E81924957E009FD709 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 60 | 1B69B2EA1924957E009FD709 /* NGViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NGViewController.h; sourceTree = ""; }; 61 | 1B69B2EB1924957E009FD709 /* NGViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NGViewController.m; sourceTree = ""; }; 62 | 1B69B2ED1924957E009FD709 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 63 | 1B69B2F31924957E009FD709 /* CoreFilterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CoreFilterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 1B69B2F41924957E009FD709 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 65 | 1B69B2FC1924957E009FD709 /* CoreFilterTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CoreFilterTests-Info.plist"; sourceTree = ""; }; 66 | 1B69B2FE1924957E009FD709 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 67 | 1B69B3001924957E009FD709 /* CoreFilterTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CoreFilterTests.m; sourceTree = ""; }; 68 | 1B69B30A192495A5009FD709 /* NGFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGFilter.h; sourceTree = ""; }; 69 | 1B69B30B192495A5009FD709 /* NGFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGFilter.m; sourceTree = ""; }; 70 | 1B69B30D1925F37C009FD709 /* chung.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = chung.jpg; sourceTree = ""; }; 71 | 1B69B30F1925F515009FD709 /* UIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIImage+Filter.h"; path = "../../../UIImage+Filter.h"; sourceTree = ""; }; 72 | 1B69B3101925F515009FD709 /* UIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIImage+Filter.m"; path = "../../../UIImage+Filter.m"; sourceTree = ""; }; 73 | 1B69B3121925F53C009FD709 /* Platforms.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Platforms.h; path = ../../../Platforms.h; sourceTree = ""; }; 74 | 1B69B3131925F5C9009FD709 /* CIFilter+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CIFilter+Filter.h"; path = "../../../CIFilter+Filter.h"; sourceTree = ""; }; 75 | 1B69B3141925F5C9009FD709 /* CIFilter+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CIFilter+Filter.m"; path = "../../../CIFilter+Filter.m"; sourceTree = ""; }; 76 | 1B69B3161925F607009FD709 /* CIImage+Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CIImage+Filter.h"; path = "../../../CIImage+Filter.h"; sourceTree = ""; }; 77 | 1B69B3171925F607009FD709 /* CIImage+Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CIImage+Filter.m"; path = "../../../CIImage+Filter.m"; sourceTree = ""; }; 78 | 1B9AFAE519262F97007BC676 /* NGLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NGLayer.h; sourceTree = ""; }; 79 | 1B9AFAE619262F97007BC676 /* NGLayer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NGLayer.m; sourceTree = ""; }; 80 | /* End PBXFileReference section */ 81 | 82 | /* Begin PBXFrameworksBuildPhase section */ 83 | 1B69B2CF1924957E009FD709 /* Frameworks */ = { 84 | isa = PBXFrameworksBuildPhase; 85 | buildActionMask = 2147483647; 86 | files = ( 87 | 1B69B2D81924957E009FD709 /* CoreGraphics.framework in Frameworks */, 88 | 1B69B2DA1924957E009FD709 /* UIKit.framework in Frameworks */, 89 | 1B69B2D61924957E009FD709 /* Foundation.framework in Frameworks */, 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | 1B69B2F01924957E009FD709 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | 1B69B2F51924957E009FD709 /* XCTest.framework in Frameworks */, 98 | 1B69B2F71924957E009FD709 /* UIKit.framework in Frameworks */, 99 | 1B69B2F61924957E009FD709 /* Foundation.framework in Frameworks */, 100 | ); 101 | runOnlyForDeploymentPostprocessing = 0; 102 | }; 103 | /* End PBXFrameworksBuildPhase section */ 104 | 105 | /* Begin PBXGroup section */ 106 | 1B69B2C91924957E009FD709 = { 107 | isa = PBXGroup; 108 | children = ( 109 | 1B69B2DB1924957E009FD709 /* CoreFilter */, 110 | 1B69B2FA1924957E009FD709 /* CoreFilterTests */, 111 | 1B69B2D41924957E009FD709 /* Frameworks */, 112 | 1B69B2D31924957E009FD709 /* Products */, 113 | ); 114 | sourceTree = ""; 115 | }; 116 | 1B69B2D31924957E009FD709 /* Products */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 1B69B2D21924957E009FD709 /* CoreFilter.app */, 120 | 1B69B2F31924957E009FD709 /* CoreFilterTests.xctest */, 121 | ); 122 | name = Products; 123 | sourceTree = ""; 124 | }; 125 | 1B69B2D41924957E009FD709 /* Frameworks */ = { 126 | isa = PBXGroup; 127 | children = ( 128 | 1B69B2D51924957E009FD709 /* Foundation.framework */, 129 | 1B69B2D71924957E009FD709 /* CoreGraphics.framework */, 130 | 1B69B2D91924957E009FD709 /* UIKit.framework */, 131 | 1B69B2F41924957E009FD709 /* XCTest.framework */, 132 | ); 133 | name = Frameworks; 134 | sourceTree = ""; 135 | }; 136 | 1B69B2DB1924957E009FD709 /* CoreFilter */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 1B69B2E41924957E009FD709 /* NGAppDelegate.h */, 140 | 1B69B2E51924957E009FD709 /* NGAppDelegate.m */, 141 | 1B69B2E71924957E009FD709 /* Main.storyboard */, 142 | 1B69B2EA1924957E009FD709 /* NGViewController.h */, 143 | 1B69B2EB1924957E009FD709 /* NGViewController.m */, 144 | 1B69B2ED1924957E009FD709 /* Images.xcassets */, 145 | 1B69B2DC1924957E009FD709 /* Supporting Files */, 146 | ); 147 | path = CoreFilter; 148 | sourceTree = ""; 149 | }; 150 | 1B69B2DC1924957E009FD709 /* Supporting Files */ = { 151 | isa = PBXGroup; 152 | children = ( 153 | 1B7E93F4192B1652008EB9EA /* ImageFilter */, 154 | 1B69B30D1925F37C009FD709 /* chung.jpg */, 155 | 1B69B2DD1924957E009FD709 /* CoreFilter-Info.plist */, 156 | 1B69B2DE1924957E009FD709 /* InfoPlist.strings */, 157 | 1B69B2E11924957E009FD709 /* main.m */, 158 | 1B69B2E31924957E009FD709 /* CoreFilter-Prefix.pch */, 159 | ); 160 | name = "Supporting Files"; 161 | sourceTree = ""; 162 | }; 163 | 1B69B2FA1924957E009FD709 /* CoreFilterTests */ = { 164 | isa = PBXGroup; 165 | children = ( 166 | 1B69B3001924957E009FD709 /* CoreFilterTests.m */, 167 | 1B69B2FB1924957E009FD709 /* Supporting Files */, 168 | ); 169 | path = CoreFilterTests; 170 | sourceTree = ""; 171 | }; 172 | 1B69B2FB1924957E009FD709 /* Supporting Files */ = { 173 | isa = PBXGroup; 174 | children = ( 175 | 1B69B2FC1924957E009FD709 /* CoreFilterTests-Info.plist */, 176 | 1B69B2FD1924957E009FD709 /* InfoPlist.strings */, 177 | ); 178 | name = "Supporting Files"; 179 | sourceTree = ""; 180 | }; 181 | 1B7E93F4192B1652008EB9EA /* ImageFilter */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 1B69B30A192495A5009FD709 /* NGFilter.h */, 185 | 1B69B30B192495A5009FD709 /* NGFilter.m */, 186 | 1B69B3121925F53C009FD709 /* Platforms.h */, 187 | 1B69B3161925F607009FD709 /* CIImage+Filter.h */, 188 | 1B69B3171925F607009FD709 /* CIImage+Filter.m */, 189 | 1B69B3131925F5C9009FD709 /* CIFilter+Filter.h */, 190 | 1B69B3141925F5C9009FD709 /* CIFilter+Filter.m */, 191 | 1B69B30F1925F515009FD709 /* UIImage+Filter.h */, 192 | 1B69B3101925F515009FD709 /* UIImage+Filter.m */, 193 | 1B0CDE4F1929F84100251B38 /* NGFilterConstructor.h */, 194 | 1B0CDE501929F84100251B38 /* NGFilterConstructor.m */, 195 | 1B0CDE511929F84100251B38 /* NGFilterStore.h */, 196 | 1B0CDE521929F84100251B38 /* NGFilterStore.m */, 197 | 1B9AFAE519262F97007BC676 /* NGLayer.h */, 198 | 1B9AFAE619262F97007BC676 /* NGLayer.m */, 199 | ); 200 | name = ImageFilter; 201 | sourceTree = ""; 202 | }; 203 | /* End PBXGroup section */ 204 | 205 | /* Begin PBXNativeTarget section */ 206 | 1B69B2D11924957E009FD709 /* ImageFilterExample */ = { 207 | isa = PBXNativeTarget; 208 | buildConfigurationList = 1B69B3041924957E009FD709 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */; 209 | buildPhases = ( 210 | 1B69B2CE1924957E009FD709 /* Sources */, 211 | 1B69B2CF1924957E009FD709 /* Frameworks */, 212 | 1B69B2D01924957E009FD709 /* Resources */, 213 | ); 214 | buildRules = ( 215 | ); 216 | dependencies = ( 217 | ); 218 | name = ImageFilterExample; 219 | productName = CoreFilter; 220 | productReference = 1B69B2D21924957E009FD709 /* CoreFilter.app */; 221 | productType = "com.apple.product-type.application"; 222 | }; 223 | 1B69B2F21924957E009FD709 /* CoreFilterTests */ = { 224 | isa = PBXNativeTarget; 225 | buildConfigurationList = 1B69B3071924957E009FD709 /* Build configuration list for PBXNativeTarget "CoreFilterTests" */; 226 | buildPhases = ( 227 | 1B69B2EF1924957E009FD709 /* Sources */, 228 | 1B69B2F01924957E009FD709 /* Frameworks */, 229 | 1B69B2F11924957E009FD709 /* Resources */, 230 | ); 231 | buildRules = ( 232 | ); 233 | dependencies = ( 234 | 1B69B2F91924957E009FD709 /* PBXTargetDependency */, 235 | ); 236 | name = CoreFilterTests; 237 | productName = CoreFilterTests; 238 | productReference = 1B69B2F31924957E009FD709 /* CoreFilterTests.xctest */; 239 | productType = "com.apple.product-type.bundle.unit-test"; 240 | }; 241 | /* End PBXNativeTarget section */ 242 | 243 | /* Begin PBXProject section */ 244 | 1B69B2CA1924957E009FD709 /* Project object */ = { 245 | isa = PBXProject; 246 | attributes = { 247 | CLASSPREFIX = NG; 248 | LastUpgradeCheck = 0510; 249 | ORGANIZATIONNAME = "James Womack"; 250 | TargetAttributes = { 251 | 1B69B2F21924957E009FD709 = { 252 | TestTargetID = 1B69B2D11924957E009FD709; 253 | }; 254 | }; 255 | }; 256 | buildConfigurationList = 1B69B2CD1924957E009FD709 /* Build configuration list for PBXProject "ImageFilterExample" */; 257 | compatibilityVersion = "Xcode 3.2"; 258 | developmentRegion = English; 259 | hasScannedForEncodings = 0; 260 | knownRegions = ( 261 | en, 262 | Base, 263 | ); 264 | mainGroup = 1B69B2C91924957E009FD709; 265 | productRefGroup = 1B69B2D31924957E009FD709 /* Products */; 266 | projectDirPath = ""; 267 | projectRoot = ""; 268 | targets = ( 269 | 1B69B2D11924957E009FD709 /* ImageFilterExample */, 270 | 1B69B2F21924957E009FD709 /* CoreFilterTests */, 271 | ); 272 | }; 273 | /* End PBXProject section */ 274 | 275 | /* Begin PBXResourcesBuildPhase section */ 276 | 1B69B2D01924957E009FD709 /* Resources */ = { 277 | isa = PBXResourcesBuildPhase; 278 | buildActionMask = 2147483647; 279 | files = ( 280 | 1B69B2EE1924957E009FD709 /* Images.xcassets in Resources */, 281 | 1B69B30E1925F37C009FD709 /* chung.jpg in Resources */, 282 | 1B69B2E01924957E009FD709 /* InfoPlist.strings in Resources */, 283 | 1B69B2E91924957E009FD709 /* Main.storyboard in Resources */, 284 | ); 285 | runOnlyForDeploymentPostprocessing = 0; 286 | }; 287 | 1B69B2F11924957E009FD709 /* Resources */ = { 288 | isa = PBXResourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 1B69B2FF1924957E009FD709 /* InfoPlist.strings in Resources */, 292 | ); 293 | runOnlyForDeploymentPostprocessing = 0; 294 | }; 295 | /* End PBXResourcesBuildPhase section */ 296 | 297 | /* Begin PBXSourcesBuildPhase section */ 298 | 1B69B2CE1924957E009FD709 /* Sources */ = { 299 | isa = PBXSourcesBuildPhase; 300 | buildActionMask = 2147483647; 301 | files = ( 302 | 1B0CDE541929F84100251B38 /* NGFilterStore.m in Sources */, 303 | 1B69B30C192495A5009FD709 /* NGFilter.m in Sources */, 304 | 1B69B3111925F515009FD709 /* UIImage+Filter.m in Sources */, 305 | 1B69B2EC1924957E009FD709 /* NGViewController.m in Sources */, 306 | 1B69B3181925F607009FD709 /* CIImage+Filter.m in Sources */, 307 | 1B69B2E21924957E009FD709 /* main.m in Sources */, 308 | 1B0CDE531929F84100251B38 /* NGFilterConstructor.m in Sources */, 309 | 1B9AFAE719262F97007BC676 /* NGLayer.m in Sources */, 310 | 1B69B2E61924957E009FD709 /* NGAppDelegate.m in Sources */, 311 | 1B69B3151925F5C9009FD709 /* CIFilter+Filter.m in Sources */, 312 | ); 313 | runOnlyForDeploymentPostprocessing = 0; 314 | }; 315 | 1B69B2EF1924957E009FD709 /* Sources */ = { 316 | isa = PBXSourcesBuildPhase; 317 | buildActionMask = 2147483647; 318 | files = ( 319 | 1B69B3011924957E009FD709 /* CoreFilterTests.m in Sources */, 320 | ); 321 | runOnlyForDeploymentPostprocessing = 0; 322 | }; 323 | /* End PBXSourcesBuildPhase section */ 324 | 325 | /* Begin PBXTargetDependency section */ 326 | 1B69B2F91924957E009FD709 /* PBXTargetDependency */ = { 327 | isa = PBXTargetDependency; 328 | target = 1B69B2D11924957E009FD709 /* ImageFilterExample */; 329 | targetProxy = 1B69B2F81924957E009FD709 /* PBXContainerItemProxy */; 330 | }; 331 | /* End PBXTargetDependency section */ 332 | 333 | /* Begin PBXVariantGroup section */ 334 | 1B69B2DE1924957E009FD709 /* InfoPlist.strings */ = { 335 | isa = PBXVariantGroup; 336 | children = ( 337 | 1B69B2DF1924957E009FD709 /* en */, 338 | ); 339 | name = InfoPlist.strings; 340 | sourceTree = ""; 341 | }; 342 | 1B69B2E71924957E009FD709 /* Main.storyboard */ = { 343 | isa = PBXVariantGroup; 344 | children = ( 345 | 1B69B2E81924957E009FD709 /* Base */, 346 | ); 347 | name = Main.storyboard; 348 | sourceTree = ""; 349 | }; 350 | 1B69B2FD1924957E009FD709 /* InfoPlist.strings */ = { 351 | isa = PBXVariantGroup; 352 | children = ( 353 | 1B69B2FE1924957E009FD709 /* en */, 354 | ); 355 | name = InfoPlist.strings; 356 | sourceTree = ""; 357 | }; 358 | /* End PBXVariantGroup section */ 359 | 360 | /* Begin XCBuildConfiguration section */ 361 | 1B69B3021924957E009FD709 /* Debug */ = { 362 | isa = XCBuildConfiguration; 363 | buildSettings = { 364 | ALWAYS_SEARCH_USER_PATHS = NO; 365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 366 | CLANG_CXX_LIBRARY = "libc++"; 367 | CLANG_ENABLE_MODULES = YES; 368 | CLANG_ENABLE_OBJC_ARC = YES; 369 | CLANG_WARN_BOOL_CONVERSION = YES; 370 | CLANG_WARN_CONSTANT_CONVERSION = YES; 371 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 372 | CLANG_WARN_EMPTY_BODY = YES; 373 | CLANG_WARN_ENUM_CONVERSION = YES; 374 | CLANG_WARN_INT_CONVERSION = YES; 375 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 376 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 377 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 378 | COPY_PHASE_STRIP = NO; 379 | GCC_C_LANGUAGE_STANDARD = gnu99; 380 | GCC_DYNAMIC_NO_PIC = NO; 381 | GCC_OPTIMIZATION_LEVEL = 0; 382 | GCC_PREPROCESSOR_DEFINITIONS = ( 383 | "DEBUG=1", 384 | "$(inherited)", 385 | ); 386 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 387 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 388 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 389 | GCC_WARN_UNDECLARED_SELECTOR = YES; 390 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 391 | GCC_WARN_UNUSED_FUNCTION = YES; 392 | GCC_WARN_UNUSED_VARIABLE = YES; 393 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 394 | ONLY_ACTIVE_ARCH = YES; 395 | SDKROOT = iphoneos; 396 | }; 397 | name = Debug; 398 | }; 399 | 1B69B3031924957E009FD709 /* Release */ = { 400 | isa = XCBuildConfiguration; 401 | buildSettings = { 402 | ALWAYS_SEARCH_USER_PATHS = NO; 403 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 404 | CLANG_CXX_LIBRARY = "libc++"; 405 | CLANG_ENABLE_MODULES = YES; 406 | CLANG_ENABLE_OBJC_ARC = YES; 407 | CLANG_WARN_BOOL_CONVERSION = YES; 408 | CLANG_WARN_CONSTANT_CONVERSION = YES; 409 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 410 | CLANG_WARN_EMPTY_BODY = YES; 411 | CLANG_WARN_ENUM_CONVERSION = YES; 412 | CLANG_WARN_INT_CONVERSION = YES; 413 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 414 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 415 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 416 | COPY_PHASE_STRIP = YES; 417 | ENABLE_NS_ASSERTIONS = NO; 418 | GCC_C_LANGUAGE_STANDARD = gnu99; 419 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 420 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 421 | GCC_WARN_UNDECLARED_SELECTOR = YES; 422 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 423 | GCC_WARN_UNUSED_FUNCTION = YES; 424 | GCC_WARN_UNUSED_VARIABLE = YES; 425 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 426 | SDKROOT = iphoneos; 427 | VALIDATE_PRODUCT = YES; 428 | }; 429 | name = Release; 430 | }; 431 | 1B69B3051924957E009FD709 /* Debug */ = { 432 | isa = XCBuildConfiguration; 433 | buildSettings = { 434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 435 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 436 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 437 | GCC_PREFIX_HEADER = "CoreFilter/CoreFilter-Prefix.pch"; 438 | INFOPLIST_FILE = "CoreFilter/CoreFilter-Info.plist"; 439 | PRODUCT_NAME = "$(TARGET_NAME)"; 440 | WRAPPER_EXTENSION = app; 441 | }; 442 | name = Debug; 443 | }; 444 | 1B69B3061924957E009FD709 /* Release */ = { 445 | isa = XCBuildConfiguration; 446 | buildSettings = { 447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 448 | ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage; 449 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 450 | GCC_PREFIX_HEADER = "CoreFilter/CoreFilter-Prefix.pch"; 451 | INFOPLIST_FILE = "CoreFilter/CoreFilter-Info.plist"; 452 | PRODUCT_NAME = "$(TARGET_NAME)"; 453 | WRAPPER_EXTENSION = app; 454 | }; 455 | name = Release; 456 | }; 457 | 1B69B3081924957E009FD709 /* Debug */ = { 458 | isa = XCBuildConfiguration; 459 | buildSettings = { 460 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CoreFilter.app/CoreFilter"; 461 | FRAMEWORK_SEARCH_PATHS = ( 462 | "$(SDKROOT)/Developer/Library/Frameworks", 463 | "$(inherited)", 464 | "$(DEVELOPER_FRAMEWORKS_DIR)", 465 | ); 466 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 467 | GCC_PREFIX_HEADER = "CoreFilter/CoreFilter-Prefix.pch"; 468 | GCC_PREPROCESSOR_DEFINITIONS = ( 469 | "DEBUG=1", 470 | "$(inherited)", 471 | ); 472 | INFOPLIST_FILE = "CoreFilterTests/CoreFilterTests-Info.plist"; 473 | PRODUCT_NAME = "$(TARGET_NAME)"; 474 | TEST_HOST = "$(BUNDLE_LOADER)"; 475 | WRAPPER_EXTENSION = xctest; 476 | }; 477 | name = Debug; 478 | }; 479 | 1B69B3091924957E009FD709 /* Release */ = { 480 | isa = XCBuildConfiguration; 481 | buildSettings = { 482 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/CoreFilter.app/CoreFilter"; 483 | FRAMEWORK_SEARCH_PATHS = ( 484 | "$(SDKROOT)/Developer/Library/Frameworks", 485 | "$(inherited)", 486 | "$(DEVELOPER_FRAMEWORKS_DIR)", 487 | ); 488 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 489 | GCC_PREFIX_HEADER = "CoreFilter/CoreFilter-Prefix.pch"; 490 | INFOPLIST_FILE = "CoreFilterTests/CoreFilterTests-Info.plist"; 491 | PRODUCT_NAME = "$(TARGET_NAME)"; 492 | TEST_HOST = "$(BUNDLE_LOADER)"; 493 | WRAPPER_EXTENSION = xctest; 494 | }; 495 | name = Release; 496 | }; 497 | /* End XCBuildConfiguration section */ 498 | 499 | /* Begin XCConfigurationList section */ 500 | 1B69B2CD1924957E009FD709 /* Build configuration list for PBXProject "ImageFilterExample" */ = { 501 | isa = XCConfigurationList; 502 | buildConfigurations = ( 503 | 1B69B3021924957E009FD709 /* Debug */, 504 | 1B69B3031924957E009FD709 /* Release */, 505 | ); 506 | defaultConfigurationIsVisible = 0; 507 | defaultConfigurationName = Release; 508 | }; 509 | 1B69B3041924957E009FD709 /* Build configuration list for PBXNativeTarget "ImageFilterExample" */ = { 510 | isa = XCConfigurationList; 511 | buildConfigurations = ( 512 | 1B69B3051924957E009FD709 /* Debug */, 513 | 1B69B3061924957E009FD709 /* Release */, 514 | ); 515 | defaultConfigurationIsVisible = 0; 516 | defaultConfigurationName = Release; 517 | }; 518 | 1B69B3071924957E009FD709 /* Build configuration list for PBXNativeTarget "CoreFilterTests" */ = { 519 | isa = XCConfigurationList; 520 | buildConfigurations = ( 521 | 1B69B3081924957E009FD709 /* Debug */, 522 | 1B69B3091924957E009FD709 /* Release */, 523 | ); 524 | defaultConfigurationIsVisible = 0; 525 | defaultConfigurationName = Release; 526 | }; 527 | /* End XCConfigurationList section */ 528 | }; 529 | rootObject = 1B69B2CA1924957E009FD709 /* Project object */; 530 | } 531 | -------------------------------------------------------------------------------- /ImageFilters/examples/north-park_sunflower.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/north-park_sunflower.png -------------------------------------------------------------------------------- /ImageFilters/examples/north-park_sunflower@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jameswomack/iOS-Image-Filters/c4556d013d99f70bd9e49eb3a17cdc178a28e010/ImageFilters/examples/north-park_sunflower@2x.png -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011 James Womack 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ImageFilter 2 | ## High-level image/photo filtering on iOS 6+ 3 | 4 | * Use custom CoreFilter classes with `filterWithName:` 5 | * Use the same library interchangeably on Mac & iOS 6 | * Overlay photgraphs Photoshop style for custom image effects 7 | * Also sepia, black & white, hue & saturation, brightness, contrast, etc. 8 | * Inspired initially by Eric Silverberg's pre-iOS 5 image filtering class 9 | * Includes several retina & non-retina images for my custom effects loosely based on some popular ones in tap tap tap's Camera+ (Camera Plus as some type) 10 | * Utilizes CoreImage, CIImage and was one of if not the first OS repo on Github to share easy to use but professional CoreImage filtering techniques 11 | * Can be used by iOS devs levels beginner and up to create their own Instagram or Snapseed-like custom filters for the iPad, iPhone, iPod Touch 12 | 13 | ## Installation 14 | * `pod 'ImageFilters', :git => 'https://github.com/jameswomack/iOS-Image-Filters.git'` -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | include FileUtils::Verbose 2 | 3 | namespace :test do 4 | desc "Run the ImageFilterExample Tests for iOS" 5 | task :ios do 6 | run_tests('ImageFilterExample', 'iphonesimulator') 7 | tests_failed('iOS') unless $?.success? 8 | end 9 | end 10 | 11 | desc "Run the ImageFilterExample Tests" 12 | task :test do 13 | Rake::Task['test:ios'].invoke 14 | end 15 | 16 | task :default => 'test' 17 | 18 | 19 | private 20 | 21 | def run_tests(scheme, sdk) 22 | sh("xcodebuild -workspace ./ImageFilters/examples/iOS/ImageFilterExample.xcworkspace -scheme '#{scheme}' -sdk '#{sdk}' -configuration Debug clean test | xcpretty -c ; exit ${PIPESTATUS[0]}") rescue nil 23 | end 24 | 25 | def tests_failed(platform) 26 | puts red("#{platform} unit tests failed") 27 | exit $?.exitstatus 28 | end 29 | 30 | def red(string) 31 | "\033[0;31m! #{string}" 32 | end 33 | 34 | --------------------------------------------------------------------------------