├── .gitignore ├── ImageEffects.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj ├── ImageEffects.podspec ├── ImageEffectsTests ├── Info.plist └── ImageEffectsTests.m ├── ImageEffects ├── Info.plist ├── ImageEffects.h └── ImageEffects.m ├── README.md └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | **/xcuserdata 3 | **/xcshareddata 4 | 5 | -------------------------------------------------------------------------------- /ImageEffects.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ImageEffects.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "ImageEffects" 3 | s.version = "1.0.0" 4 | s.summary = "Bring UIImageEffects (WWDC 2013) to UIImage category with handy interface." 5 | s.homepage = "http://github.com/devxoul/ImageEffects" 6 | s.license = { :type => 'WWDC 2013', :file => 'LICENSE' } 7 | s.author = { "devxoul" => "devxoul@gmail.com" } 8 | s.source = { :git => "https://github.com/devxoul/ImageEffects.git", 9 | :tag => "#{s.version}" } 10 | s.platform = :ios, '7.0' 11 | s.requires_arc = true 12 | s.source_files = 'ImageEffects/*.{h,m}' 13 | s.frameworks = 'UIKit', 'Foundation' 14 | end 15 | -------------------------------------------------------------------------------- /ImageEffectsTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | kr.xoul.$(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 | -------------------------------------------------------------------------------- /ImageEffects/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | kr.xoul.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ImageEffectsTests/ImageEffectsTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ImageEffectsTests.m 3 | // ImageEffectsTests 4 | // 5 | // Created by 전수열 on 2015. 5. 26.. 6 | // Copyright (c) 2015년 Suyeol Jeon. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface ImageEffectsTests : XCTestCase 13 | 14 | @end 15 | 16 | @implementation ImageEffectsTests 17 | 18 | - (void)setUp { 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 | // Put teardown code here. This method is called after the invocation of each test method in the class. 25 | [super tearDown]; 26 | } 27 | 28 | - (void)testExample { 29 | // This is an example of a functional test case. 30 | XCTAssert(YES, @"Pass"); 31 | } 32 | 33 | - (void)testPerformanceExample { 34 | // This is an example of a performance test case. 35 | [self measureBlock:^{ 36 | // Put the code you want to measure the time of here. 37 | }]; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ImageEffects 2 | ============ 3 | 4 | [![CocoaPods](http://img.shields.io/cocoapods/v/ImageEffects.svg?style=flat)](http://cocoapods.org/?q=name%3AImageEffects%20author%3Adevxoul) 5 | 6 | Bring UIImageEffects (WWDC 2013) to UIImage category with handy interface. 7 | 8 | 9 | Additional Features 10 | ------------------- 11 | 12 | - Apply blur to image with blur size (CGSize) 13 | 14 | 15 | Interface 16 | --------- 17 | 18 | ```objc 19 | - (UIImage *)lightImage; 20 | - (UIImage *)extraLightImage; 21 | - (UIImage *)darkImage; 22 | - (UIImage *)tintedImageWithColor:(UIColor *)tintColor; 23 | - (UIImage *)blurredImageWithRadius:(CGFloat)blurRadius; 24 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize; 25 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize 26 | tintColor:(UIColor *)tintColor 27 | saturationDeltaFactor:(CGFloat)saturationDeltaFactor 28 | maskImage:(UIImage *)maskImage; 29 | ``` 30 | 31 | 32 | Installation 33 | ------------ 34 | 35 | Use [CocoaPods](https://cocoapods.org). 36 | 37 | ```ruby 38 | pod 'ImageEffects' 39 | ``` 40 | 41 | 42 | License 43 | ------- 44 | 45 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 46 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 2 | Inc. ("Apple") in consideration of your agreement to the following 3 | terms, and your use, installation, modification or redistribution of 4 | this Apple software constitutes acceptance of these terms. If you do 5 | not agree with these terms, please do not use, install, modify or 6 | redistribute this Apple software. 7 | 8 | In consideration of your agreement to abide by the following terms, and 9 | subject to these terms, Apple grants you a personal, non-exclusive 10 | license, under Apple's copyrights in this original Apple software (the 11 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 12 | Software, with or without modifications, in source and/or binary forms; 13 | provided that if you redistribute the Apple Software in its entirety and 14 | without modifications, you must retain this notice and the following 15 | text and disclaimers in all such redistributions of the Apple Software. 16 | Neither the name, trademarks, service marks or logos of Apple Inc. may 17 | be used to endorse or promote products derived from the Apple Software 18 | without specific prior written permission from Apple. Except as 19 | expressly stated in this notice, no other rights or licenses, express or 20 | implied, are granted by Apple herein, including but not limited to any 21 | patent rights that may be infringed by your derivative works or by other 22 | works in which the Apple Software may be incorporated. 23 | 24 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 25 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 26 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 27 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 28 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 29 | 30 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 31 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 34 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 35 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 36 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 37 | POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Copyright (C) 2014 Apple Inc. All Rights Reserved. -------------------------------------------------------------------------------- /ImageEffects/ImageEffects.h: -------------------------------------------------------------------------------- 1 | /* 2 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 3 | Inc. ("Apple") in consideration of your agreement to the following 4 | terms, and your use, installation, modification or redistribution of 5 | this Apple software constitutes acceptance of these terms. If you do 6 | not agree with these terms, please do not use, install, modify or 7 | redistribute this Apple software. 8 | 9 | In consideration of your agreement to abide by the following terms, and 10 | subject to these terms, Apple grants you a personal, non-exclusive 11 | license, under Apple's copyrights in this original Apple software (the 12 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 13 | Software, with or without modifications, in source and/or binary forms; 14 | provided that if you redistribute the Apple Software in its entirety and 15 | without modifications, you must retain this notice and the following 16 | text and disclaimers in all such redistributions of the Apple Software. 17 | Neither the name, trademarks, service marks or logos of Apple Inc. may 18 | be used to endorse or promote products derived from the Apple Software 19 | without specific prior written permission from Apple. Except as 20 | expressly stated in this notice, no other rights or licenses, express or 21 | implied, are granted by Apple herein, including but not limited to any 22 | patent rights that may be infringed by your derivative works or by other 23 | works in which the Apple Software may be incorporated. 24 | 25 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 26 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 27 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 28 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 29 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 30 | 31 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 32 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 33 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 35 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 36 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 37 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 38 | POSSIBILITY OF SUCH DAMAGE. 39 | 40 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 41 | 42 | */ 43 | 44 | #import 45 | 46 | FOUNDATION_EXPORT double ImageEffectsVersionNumber; 47 | FOUNDATION_EXPORT const unsigned char ImageEffectsVersionString[]; 48 | 49 | @interface UIImage (Effects) 50 | 51 | - (UIImage *)lightImage; 52 | - (UIImage *)extraLightImage; 53 | - (UIImage *)darkImage; 54 | - (UIImage *)tintedImageWithColor:(UIColor *)tintColor; 55 | - (UIImage *)blurredImageWithRadius:(CGFloat)blurRadius; 56 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize; 57 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize 58 | tintColor:(UIColor *)tintColor 59 | saturationDeltaFactor:(CGFloat)saturationDeltaFactor 60 | maskImage:(UIImage *)maskImage; 61 | 62 | @end 63 | 64 | -------------------------------------------------------------------------------- /ImageEffects/ImageEffects.m: -------------------------------------------------------------------------------- 1 | /* 2 | Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple 3 | Inc. ("Apple") in consideration of your agreement to the following 4 | terms, and your use, installation, modification or redistribution of 5 | this Apple software constitutes acceptance of these terms. If you do 6 | not agree with these terms, please do not use, install, modify or 7 | redistribute this Apple software. 8 | 9 | In consideration of your agreement to abide by the following terms, and 10 | subject to these terms, Apple grants you a personal, non-exclusive 11 | license, under Apple's copyrights in this original Apple software (the 12 | "Apple Software"), to use, reproduce, modify and redistribute the Apple 13 | Software, with or without modifications, in source and/or binary forms; 14 | provided that if you redistribute the Apple Software in its entirety and 15 | without modifications, you must retain this notice and the following 16 | text and disclaimers in all such redistributions of the Apple Software. 17 | Neither the name, trademarks, service marks or logos of Apple Inc. may 18 | be used to endorse or promote products derived from the Apple Software 19 | without specific prior written permission from Apple. Except as 20 | expressly stated in this notice, no other rights or licenses, express or 21 | implied, are granted by Apple herein, including but not limited to any 22 | patent rights that may be infringed by your derivative works or by other 23 | works in which the Apple Software may be incorporated. 24 | 25 | The Apple Software is provided by Apple on an "AS IS" basis. APPLE 26 | MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION 27 | THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS 28 | FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND 29 | OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS. 30 | 31 | IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL 32 | OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 33 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, 35 | MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED 36 | AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE), 37 | STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE 38 | POSSIBILITY OF SUCH DAMAGE. 39 | 40 | Copyright (C) 2014 Apple Inc. All Rights Reserved. 41 | 42 | */ 43 | 44 | #import "ImageEffects.h" 45 | 46 | @import Accelerate; 47 | 48 | @implementation UIImage (Effects) 49 | 50 | #pragma mark - 51 | #pragma mark - Effects 52 | 53 | //| ---------------------------------------------------------------------------- 54 | - (UIImage *)lightImage 55 | { 56 | UIColor *tintColor = [UIColor colorWithWhite:1.0 alpha:0.3]; 57 | return [self blurredImageWithSize:CGSizeMake(60, 60) tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 58 | } 59 | 60 | 61 | //| ---------------------------------------------------------------------------- 62 | - (UIImage *)extraLightImage 63 | { 64 | UIColor *tintColor = [UIColor colorWithWhite:0.97 alpha:0.82]; 65 | return [self blurredImageWithSize:CGSizeMake(40, 40) tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 66 | } 67 | 68 | 69 | //| ---------------------------------------------------------------------------- 70 | - (UIImage *)darkImage 71 | { 72 | UIColor *tintColor = [UIColor colorWithWhite:0.11 alpha:0.73]; 73 | return [self blurredImageWithSize:CGSizeMake(40, 40) tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 74 | } 75 | 76 | 77 | //| ---------------------------------------------------------------------------- 78 | - (UIImage *)tintedImageWithColor:(UIColor *)tintColor 79 | { 80 | const CGFloat EffectColorAlpha = 0.6; 81 | UIColor *effectColor = tintColor; 82 | size_t componentCount = CGColorGetNumberOfComponents(tintColor.CGColor); 83 | if (componentCount == 2) { 84 | CGFloat b; 85 | if ([tintColor getWhite:&b alpha:NULL]) { 86 | effectColor = [UIColor colorWithWhite:b alpha:EffectColorAlpha]; 87 | } 88 | } 89 | else { 90 | CGFloat r, g, b; 91 | if ([tintColor getRed:&r green:&g blue:&b alpha:NULL]) { 92 | effectColor = [UIColor colorWithRed:r green:g blue:b alpha:EffectColorAlpha]; 93 | } 94 | } 95 | return [self blurredImageWithSize:CGSizeMake(20, 20) tintColor:effectColor saturationDeltaFactor:-1.0 maskImage:nil]; 96 | } 97 | 98 | 99 | //| ---------------------------------------------------------------------------- 100 | - (UIImage *)blurredImageWithRadius:(CGFloat)blurRadius 101 | { 102 | return [self blurredImageWithSize:CGSizeMake(blurRadius, blurRadius)]; 103 | } 104 | 105 | 106 | //| ---------------------------------------------------------------------------- 107 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize 108 | { 109 | return [self blurredImageWithSize:blurSize tintColor:nil saturationDeltaFactor:1.0 maskImage:nil]; 110 | } 111 | 112 | #pragma mark - 113 | #pragma mark - Implementation 114 | 115 | //| ---------------------------------------------------------------------------- 116 | - (UIImage *)blurredImageWithSize:(CGSize)blurSize tintColor:(UIColor *)tintColor saturationDeltaFactor:(CGFloat)saturationDeltaFactor maskImage:(UIImage *)maskImage 117 | { 118 | #define ENABLE_BLUR 1 119 | #define ENABLE_SATURATION_ADJUSTMENT 1 120 | #define ENABLE_TINT 1 121 | 122 | // Check pre-conditions. 123 | if (self.size.width < 1 || self.size.height < 1) 124 | { 125 | NSLog(@"*** error: invalid size: (%.2f x %.2f). Both dimensions must be >= 1: %@", self.size.width, self.size.height, self); 126 | return nil; 127 | } 128 | if (!self.CGImage) 129 | { 130 | NSLog(@"*** error: inputImage must be backed by a CGImage: %@", self); 131 | return nil; 132 | } 133 | if (maskImage && !maskImage.CGImage) 134 | { 135 | NSLog(@"*** error: effectMaskImage must be backed by a CGImage: %@", maskImage); 136 | return nil; 137 | } 138 | 139 | BOOL hasBlur = blurSize.width > __FLT_EPSILON__ || blurSize.height > __FLT_EPSILON__; 140 | BOOL hasSaturationChange = fabs(saturationDeltaFactor - 1.) > __FLT_EPSILON__; 141 | 142 | CGImageRef inputCGImage = self.CGImage; 143 | CGFloat inputImageScale = self.scale; 144 | CGBitmapInfo inputImageBitmapInfo = CGImageGetBitmapInfo(inputCGImage); 145 | CGImageAlphaInfo inputImageAlphaInfo = (inputImageBitmapInfo & kCGBitmapAlphaInfoMask); 146 | 147 | CGSize outputImageSizeInPoints = self.size; 148 | CGRect outputImageRectInPoints = { CGPointZero, outputImageSizeInPoints }; 149 | 150 | // Set up output context. 151 | BOOL useOpaqueContext; 152 | if (inputImageAlphaInfo == kCGImageAlphaNone || inputImageAlphaInfo == kCGImageAlphaNoneSkipLast || inputImageAlphaInfo == kCGImageAlphaNoneSkipFirst) 153 | useOpaqueContext = YES; 154 | else 155 | useOpaqueContext = NO; 156 | UIGraphicsBeginImageContextWithOptions(outputImageRectInPoints.size, useOpaqueContext, inputImageScale); 157 | CGContextRef outputContext = UIGraphicsGetCurrentContext(); 158 | CGContextScaleCTM(outputContext, 1.0, -1.0); 159 | CGContextTranslateCTM(outputContext, 0, -outputImageRectInPoints.size.height); 160 | 161 | if (hasBlur || hasSaturationChange) 162 | { 163 | vImage_Buffer effectInBuffer; 164 | vImage_Buffer scratchBuffer1; 165 | 166 | vImage_Buffer *inputBuffer; 167 | vImage_Buffer *outputBuffer; 168 | 169 | vImage_CGImageFormat format = { 170 | .bitsPerComponent = 8, 171 | .bitsPerPixel = 32, 172 | .colorSpace = NULL, 173 | // (kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little) 174 | // requests a BGRA buffer. 175 | .bitmapInfo = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little, 176 | .version = 0, 177 | .decode = NULL, 178 | .renderingIntent = kCGRenderingIntentDefault 179 | }; 180 | 181 | vImage_Error e = vImageBuffer_InitWithCGImage(&effectInBuffer, &format, NULL, self.CGImage, kvImagePrintDiagnosticsToConsole); 182 | if (e != kvImageNoError) 183 | { 184 | NSLog(@"*** error: vImageBuffer_InitWithCGImage returned error code %zi for inputImage: %@", e, self); 185 | UIGraphicsEndImageContext(); 186 | return nil; 187 | } 188 | 189 | vImageBuffer_Init(&scratchBuffer1, effectInBuffer.height, effectInBuffer.width, format.bitsPerPixel, kvImageNoFlags); 190 | inputBuffer = &effectInBuffer; 191 | outputBuffer = &scratchBuffer1; 192 | 193 | #if ENABLE_BLUR 194 | if (hasBlur) 195 | { 196 | CGFloat radiusX = [self gaussianBlurRadiusWithBlurRadius:blurSize.width * inputImageScale]; 197 | CGFloat radiusY = [self gaussianBlurRadiusWithBlurRadius:blurSize.height * inputImageScale]; 198 | 199 | NSInteger tempBufferSize = vImageBoxConvolve_ARGB8888(inputBuffer, outputBuffer, NULL, 0, 0, radiusY, radiusX, NULL, kvImageGetTempBufferSize | kvImageEdgeExtend); 200 | void *tempBuffer = malloc(tempBufferSize); 201 | 202 | vImageBoxConvolve_ARGB8888(inputBuffer, outputBuffer, tempBuffer, 0, 0, radiusY, radiusX, NULL, kvImageEdgeExtend); 203 | vImageBoxConvolve_ARGB8888(outputBuffer, inputBuffer, tempBuffer, 0, 0, radiusY, radiusX, NULL, kvImageEdgeExtend); 204 | vImageBoxConvolve_ARGB8888(inputBuffer, outputBuffer, tempBuffer, 0, 0, radiusY, radiusX, NULL, kvImageEdgeExtend); 205 | 206 | free(tempBuffer); 207 | 208 | vImage_Buffer *temp = inputBuffer; 209 | inputBuffer = outputBuffer; 210 | outputBuffer = temp; 211 | } 212 | #endif 213 | 214 | #if ENABLE_SATURATION_ADJUSTMENT 215 | if (hasSaturationChange) 216 | { 217 | CGFloat s = saturationDeltaFactor; 218 | // These values appear in the W3C Filter Effects spec: 219 | // https://dvcs.w3.org/hg/FXTF/raw-file/default/filters/index.html#grayscaleEquivalent 220 | // 221 | CGFloat floatingPointSaturationMatrix[] = { 222 | 0.0722 + 0.9278 * s, 0.0722 - 0.0722 * s, 0.0722 - 0.0722 * s, 0, 223 | 0.7152 - 0.7152 * s, 0.7152 + 0.2848 * s, 0.7152 - 0.7152 * s, 0, 224 | 0.2126 - 0.2126 * s, 0.2126 - 0.2126 * s, 0.2126 + 0.7873 * s, 0, 225 | 0, 0, 0, 1, 226 | }; 227 | const int32_t divisor = 256; 228 | NSUInteger matrixSize = sizeof(floatingPointSaturationMatrix)/sizeof(floatingPointSaturationMatrix[0]); 229 | int16_t saturationMatrix[matrixSize]; 230 | for (NSUInteger i = 0; i < matrixSize; ++i) { 231 | saturationMatrix[i] = (int16_t)roundf(floatingPointSaturationMatrix[i] * divisor); 232 | } 233 | vImageMatrixMultiply_ARGB8888(inputBuffer, outputBuffer, saturationMatrix, divisor, NULL, NULL, kvImageNoFlags); 234 | 235 | vImage_Buffer *temp = inputBuffer; 236 | inputBuffer = outputBuffer; 237 | outputBuffer = temp; 238 | } 239 | #endif 240 | 241 | CGImageRef effectCGImage; 242 | if ( (effectCGImage = vImageCreateCGImageFromBuffer(inputBuffer, &format, &cleanupBuffer, NULL, kvImageNoAllocate, NULL)) == NULL ) { 243 | effectCGImage = vImageCreateCGImageFromBuffer(inputBuffer, &format, NULL, NULL, kvImageNoFlags, NULL); 244 | free(inputBuffer->data); 245 | } 246 | if (maskImage) { 247 | // Only need to draw the base image if the effect image will be masked. 248 | CGContextDrawImage(outputContext, outputImageRectInPoints, inputCGImage); 249 | } 250 | 251 | // draw effect image 252 | CGContextSaveGState(outputContext); 253 | if (maskImage) 254 | CGContextClipToMask(outputContext, outputImageRectInPoints, maskImage.CGImage); 255 | CGContextDrawImage(outputContext, outputImageRectInPoints, effectCGImage); 256 | CGContextRestoreGState(outputContext); 257 | 258 | // Cleanup 259 | CGImageRelease(effectCGImage); 260 | free(outputBuffer->data); 261 | } 262 | else 263 | { 264 | // draw base image 265 | CGContextDrawImage(outputContext, outputImageRectInPoints, inputCGImage); 266 | } 267 | 268 | #if ENABLE_TINT 269 | // Add in color tint. 270 | if (tintColor) 271 | { 272 | CGContextSaveGState(outputContext); 273 | CGContextSetFillColorWithColor(outputContext, tintColor.CGColor); 274 | CGContextFillRect(outputContext, outputImageRectInPoints); 275 | CGContextRestoreGState(outputContext); 276 | } 277 | #endif 278 | 279 | // Output image is ready. 280 | UIImage *outputImage = UIGraphicsGetImageFromCurrentImageContext(); 281 | UIGraphicsEndImageContext(); 282 | 283 | return outputImage; 284 | #undef ENABLE_BLUR 285 | #undef ENABLE_SATURATION_ADJUSTMENT 286 | #undef ENABLE_TINT 287 | } 288 | 289 | 290 | // A description of how to compute the box kernel width from the Gaussian 291 | // radius (aka standard deviation) appears in the SVG spec: 292 | // http://www.w3.org/TR/SVG/filters.html#feGaussianBlurElement 293 | // 294 | // For larger values of 's' (s >= 2.0), an approximation can be used: Three 295 | // successive box-blurs build a piece-wise quadratic convolution kernel, which 296 | // approximates the Gaussian kernel to within roughly 3%. 297 | // 298 | // let d = floor(s * 3*sqrt(2*pi)/4 + 0.5) 299 | // 300 | // ... if d is odd, use three box-blurs of size 'd', centered on the output pixel. 301 | // 302 | - (CGFloat)gaussianBlurRadiusWithBlurRadius:(CGFloat)blurRadius 303 | { 304 | if (blurRadius - 2. < __FLT_EPSILON__) { 305 | blurRadius = 2.; 306 | } 307 | uint32_t radius = floor((blurRadius * 3. * sqrt(2 * M_PI) / 4 + 0.5) / 2); 308 | radius |= 1; // force radius to be odd so that the three box-blur methodology works. 309 | return radius; 310 | } 311 | 312 | 313 | //| ---------------------------------------------------------------------------- 314 | // Helper function to handle deferred cleanup of a buffer. 315 | // 316 | void cleanupBuffer(void *userData, void *buf_data) 317 | { free(buf_data); } 318 | 319 | @end 320 | 321 | -------------------------------------------------------------------------------- /ImageEffects.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 03AC7B761B149C6A0015C171 /* ImageEffects.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03AC7B6A1B149C690015C171 /* ImageEffects.framework */; }; 11 | 03AC7B7D1B149C6A0015C171 /* ImageEffectsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AC7B7C1B149C6A0015C171 /* ImageEffectsTests.m */; }; 12 | 03AC7B881B149C7E0015C171 /* ImageEffects.h in Headers */ = {isa = PBXBuildFile; fileRef = 03AC7B861B149C7E0015C171 /* ImageEffects.h */; }; 13 | 03AC7B891B149C7E0015C171 /* ImageEffects.m in Sources */ = {isa = PBXBuildFile; fileRef = 03AC7B871B149C7E0015C171 /* ImageEffects.m */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | 03AC7B771B149C6A0015C171 /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = 03AC7B611B149C690015C171 /* Project object */; 20 | proxyType = 1; 21 | remoteGlobalIDString = 03AC7B691B149C690015C171; 22 | remoteInfo = ImageEffects; 23 | }; 24 | /* End PBXContainerItemProxy section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 03AC7B6A1B149C690015C171 /* ImageEffects.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ImageEffects.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 03AC7B6E1B149C690015C171 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 03AC7B751B149C6A0015C171 /* ImageEffectsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ImageEffectsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 03AC7B7B1B149C6A0015C171 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 03AC7B7C1B149C6A0015C171 /* ImageEffectsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ImageEffectsTests.m; sourceTree = ""; }; 32 | 03AC7B861B149C7E0015C171 /* ImageEffects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ImageEffects.h; sourceTree = ""; }; 33 | 03AC7B871B149C7E0015C171 /* ImageEffects.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ImageEffects.m; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | 03AC7B661B149C690015C171 /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | 03AC7B721B149C6A0015C171 /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 03AC7B761B149C6A0015C171 /* ImageEffects.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 03AC7B601B149C690015C171 = { 56 | isa = PBXGroup; 57 | children = ( 58 | 03AC7B6C1B149C690015C171 /* ImageEffects */, 59 | 03AC7B791B149C6A0015C171 /* ImageEffectsTests */, 60 | 03AC7B6B1B149C690015C171 /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 03AC7B6B1B149C690015C171 /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 03AC7B6A1B149C690015C171 /* ImageEffects.framework */, 68 | 03AC7B751B149C6A0015C171 /* ImageEffectsTests.xctest */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 03AC7B6C1B149C690015C171 /* ImageEffects */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 03AC7B861B149C7E0015C171 /* ImageEffects.h */, 77 | 03AC7B871B149C7E0015C171 /* ImageEffects.m */, 78 | 03AC7B6D1B149C690015C171 /* Supporting Files */, 79 | ); 80 | path = ImageEffects; 81 | sourceTree = ""; 82 | }; 83 | 03AC7B6D1B149C690015C171 /* Supporting Files */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 03AC7B6E1B149C690015C171 /* Info.plist */, 87 | ); 88 | name = "Supporting Files"; 89 | sourceTree = ""; 90 | }; 91 | 03AC7B791B149C6A0015C171 /* ImageEffectsTests */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 03AC7B7C1B149C6A0015C171 /* ImageEffectsTests.m */, 95 | 03AC7B7A1B149C6A0015C171 /* Supporting Files */, 96 | ); 97 | path = ImageEffectsTests; 98 | sourceTree = ""; 99 | }; 100 | 03AC7B7A1B149C6A0015C171 /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 03AC7B7B1B149C6A0015C171 /* Info.plist */, 104 | ); 105 | name = "Supporting Files"; 106 | sourceTree = ""; 107 | }; 108 | /* End PBXGroup section */ 109 | 110 | /* Begin PBXHeadersBuildPhase section */ 111 | 03AC7B671B149C690015C171 /* Headers */ = { 112 | isa = PBXHeadersBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | 03AC7B881B149C7E0015C171 /* ImageEffects.h in Headers */, 116 | ); 117 | runOnlyForDeploymentPostprocessing = 0; 118 | }; 119 | /* End PBXHeadersBuildPhase section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | 03AC7B691B149C690015C171 /* ImageEffects */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = 03AC7B801B149C6A0015C171 /* Build configuration list for PBXNativeTarget "ImageEffects" */; 125 | buildPhases = ( 126 | 03AC7B651B149C690015C171 /* Sources */, 127 | 03AC7B661B149C690015C171 /* Frameworks */, 128 | 03AC7B671B149C690015C171 /* Headers */, 129 | 03AC7B681B149C690015C171 /* Resources */, 130 | ); 131 | buildRules = ( 132 | ); 133 | dependencies = ( 134 | ); 135 | name = ImageEffects; 136 | productName = ImageEffects; 137 | productReference = 03AC7B6A1B149C690015C171 /* ImageEffects.framework */; 138 | productType = "com.apple.product-type.framework"; 139 | }; 140 | 03AC7B741B149C6A0015C171 /* ImageEffectsTests */ = { 141 | isa = PBXNativeTarget; 142 | buildConfigurationList = 03AC7B831B149C6A0015C171 /* Build configuration list for PBXNativeTarget "ImageEffectsTests" */; 143 | buildPhases = ( 144 | 03AC7B711B149C6A0015C171 /* Sources */, 145 | 03AC7B721B149C6A0015C171 /* Frameworks */, 146 | 03AC7B731B149C6A0015C171 /* Resources */, 147 | ); 148 | buildRules = ( 149 | ); 150 | dependencies = ( 151 | 03AC7B781B149C6A0015C171 /* PBXTargetDependency */, 152 | ); 153 | name = ImageEffectsTests; 154 | productName = ImageEffectsTests; 155 | productReference = 03AC7B751B149C6A0015C171 /* ImageEffectsTests.xctest */; 156 | productType = "com.apple.product-type.bundle.unit-test"; 157 | }; 158 | /* End PBXNativeTarget section */ 159 | 160 | /* Begin PBXProject section */ 161 | 03AC7B611B149C690015C171 /* Project object */ = { 162 | isa = PBXProject; 163 | attributes = { 164 | LastUpgradeCheck = 0630; 165 | ORGANIZATIONNAME = "Suyeol Jeon"; 166 | TargetAttributes = { 167 | 03AC7B691B149C690015C171 = { 168 | CreatedOnToolsVersion = 6.3.1; 169 | }; 170 | 03AC7B741B149C6A0015C171 = { 171 | CreatedOnToolsVersion = 6.3.1; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = 03AC7B641B149C690015C171 /* Build configuration list for PBXProject "ImageEffects" */; 176 | compatibilityVersion = "Xcode 3.2"; 177 | developmentRegion = English; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | ); 182 | mainGroup = 03AC7B601B149C690015C171; 183 | productRefGroup = 03AC7B6B1B149C690015C171 /* Products */; 184 | projectDirPath = ""; 185 | projectRoot = ""; 186 | targets = ( 187 | 03AC7B691B149C690015C171 /* ImageEffects */, 188 | 03AC7B741B149C6A0015C171 /* ImageEffectsTests */, 189 | ); 190 | }; 191 | /* End PBXProject section */ 192 | 193 | /* Begin PBXResourcesBuildPhase section */ 194 | 03AC7B681B149C690015C171 /* Resources */ = { 195 | isa = PBXResourcesBuildPhase; 196 | buildActionMask = 2147483647; 197 | files = ( 198 | ); 199 | runOnlyForDeploymentPostprocessing = 0; 200 | }; 201 | 03AC7B731B149C6A0015C171 /* Resources */ = { 202 | isa = PBXResourcesBuildPhase; 203 | buildActionMask = 2147483647; 204 | files = ( 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | /* End PBXResourcesBuildPhase section */ 209 | 210 | /* Begin PBXSourcesBuildPhase section */ 211 | 03AC7B651B149C690015C171 /* Sources */ = { 212 | isa = PBXSourcesBuildPhase; 213 | buildActionMask = 2147483647; 214 | files = ( 215 | 03AC7B891B149C7E0015C171 /* ImageEffects.m in Sources */, 216 | ); 217 | runOnlyForDeploymentPostprocessing = 0; 218 | }; 219 | 03AC7B711B149C6A0015C171 /* Sources */ = { 220 | isa = PBXSourcesBuildPhase; 221 | buildActionMask = 2147483647; 222 | files = ( 223 | 03AC7B7D1B149C6A0015C171 /* ImageEffectsTests.m in Sources */, 224 | ); 225 | runOnlyForDeploymentPostprocessing = 0; 226 | }; 227 | /* End PBXSourcesBuildPhase section */ 228 | 229 | /* Begin PBXTargetDependency section */ 230 | 03AC7B781B149C6A0015C171 /* PBXTargetDependency */ = { 231 | isa = PBXTargetDependency; 232 | target = 03AC7B691B149C690015C171 /* ImageEffects */; 233 | targetProxy = 03AC7B771B149C6A0015C171 /* PBXContainerItemProxy */; 234 | }; 235 | /* End PBXTargetDependency section */ 236 | 237 | /* Begin XCBuildConfiguration section */ 238 | 03AC7B7E1B149C6A0015C171 /* Debug */ = { 239 | isa = XCBuildConfiguration; 240 | buildSettings = { 241 | ALWAYS_SEARCH_USER_PATHS = NO; 242 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 243 | CLANG_CXX_LIBRARY = "libc++"; 244 | CLANG_ENABLE_MODULES = YES; 245 | CLANG_ENABLE_OBJC_ARC = YES; 246 | CLANG_WARN_BOOL_CONVERSION = YES; 247 | CLANG_WARN_CONSTANT_CONVERSION = YES; 248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 249 | CLANG_WARN_EMPTY_BODY = YES; 250 | CLANG_WARN_ENUM_CONVERSION = YES; 251 | CLANG_WARN_INT_CONVERSION = YES; 252 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 253 | CLANG_WARN_UNREACHABLE_CODE = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 256 | COPY_PHASE_STRIP = NO; 257 | CURRENT_PROJECT_VERSION = 1; 258 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 259 | ENABLE_STRICT_OBJC_MSGSEND = YES; 260 | GCC_C_LANGUAGE_STANDARD = gnu99; 261 | GCC_DYNAMIC_NO_PIC = NO; 262 | GCC_NO_COMMON_BLOCKS = YES; 263 | GCC_OPTIMIZATION_LEVEL = 0; 264 | GCC_PREPROCESSOR_DEFINITIONS = ( 265 | "DEBUG=1", 266 | "$(inherited)", 267 | ); 268 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 271 | GCC_WARN_UNDECLARED_SELECTOR = YES; 272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 273 | GCC_WARN_UNUSED_FUNCTION = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 276 | MTL_ENABLE_DEBUG_INFO = YES; 277 | ONLY_ACTIVE_ARCH = YES; 278 | SDKROOT = iphoneos; 279 | TARGETED_DEVICE_FAMILY = "1,2"; 280 | VERSIONING_SYSTEM = "apple-generic"; 281 | VERSION_INFO_PREFIX = ""; 282 | }; 283 | name = Debug; 284 | }; 285 | 03AC7B7F1B149C6A0015C171 /* Release */ = { 286 | isa = XCBuildConfiguration; 287 | buildSettings = { 288 | ALWAYS_SEARCH_USER_PATHS = NO; 289 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 290 | CLANG_CXX_LIBRARY = "libc++"; 291 | CLANG_ENABLE_MODULES = YES; 292 | CLANG_ENABLE_OBJC_ARC = YES; 293 | CLANG_WARN_BOOL_CONVERSION = YES; 294 | CLANG_WARN_CONSTANT_CONVERSION = YES; 295 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 296 | CLANG_WARN_EMPTY_BODY = YES; 297 | CLANG_WARN_ENUM_CONVERSION = YES; 298 | CLANG_WARN_INT_CONVERSION = YES; 299 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 300 | CLANG_WARN_UNREACHABLE_CODE = YES; 301 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 302 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 303 | COPY_PHASE_STRIP = NO; 304 | CURRENT_PROJECT_VERSION = 1; 305 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 306 | ENABLE_NS_ASSERTIONS = NO; 307 | ENABLE_STRICT_OBJC_MSGSEND = YES; 308 | GCC_C_LANGUAGE_STANDARD = gnu99; 309 | GCC_NO_COMMON_BLOCKS = YES; 310 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 311 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 312 | GCC_WARN_UNDECLARED_SELECTOR = YES; 313 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 314 | GCC_WARN_UNUSED_FUNCTION = YES; 315 | GCC_WARN_UNUSED_VARIABLE = YES; 316 | IPHONEOS_DEPLOYMENT_TARGET = 8.3; 317 | MTL_ENABLE_DEBUG_INFO = NO; 318 | SDKROOT = iphoneos; 319 | TARGETED_DEVICE_FAMILY = "1,2"; 320 | VALIDATE_PRODUCT = YES; 321 | VERSIONING_SYSTEM = "apple-generic"; 322 | VERSION_INFO_PREFIX = ""; 323 | }; 324 | name = Release; 325 | }; 326 | 03AC7B811B149C6A0015C171 /* Debug */ = { 327 | isa = XCBuildConfiguration; 328 | buildSettings = { 329 | DEFINES_MODULE = YES; 330 | DYLIB_COMPATIBILITY_VERSION = 1; 331 | DYLIB_CURRENT_VERSION = 1; 332 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 333 | INFOPLIST_FILE = ImageEffects/Info.plist; 334 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 335 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 336 | PRODUCT_NAME = "$(TARGET_NAME)"; 337 | SKIP_INSTALL = YES; 338 | }; 339 | name = Debug; 340 | }; 341 | 03AC7B821B149C6A0015C171 /* Release */ = { 342 | isa = XCBuildConfiguration; 343 | buildSettings = { 344 | DEFINES_MODULE = YES; 345 | DYLIB_COMPATIBILITY_VERSION = 1; 346 | DYLIB_CURRENT_VERSION = 1; 347 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 348 | INFOPLIST_FILE = ImageEffects/Info.plist; 349 | INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; 350 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 351 | PRODUCT_NAME = "$(TARGET_NAME)"; 352 | SKIP_INSTALL = YES; 353 | }; 354 | name = Release; 355 | }; 356 | 03AC7B841B149C6A0015C171 /* Debug */ = { 357 | isa = XCBuildConfiguration; 358 | buildSettings = { 359 | FRAMEWORK_SEARCH_PATHS = ( 360 | "$(SDKROOT)/Developer/Library/Frameworks", 361 | "$(inherited)", 362 | ); 363 | GCC_PREPROCESSOR_DEFINITIONS = ( 364 | "DEBUG=1", 365 | "$(inherited)", 366 | ); 367 | INFOPLIST_FILE = ImageEffectsTests/Info.plist; 368 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 369 | PRODUCT_NAME = "$(TARGET_NAME)"; 370 | }; 371 | name = Debug; 372 | }; 373 | 03AC7B851B149C6A0015C171 /* Release */ = { 374 | isa = XCBuildConfiguration; 375 | buildSettings = { 376 | FRAMEWORK_SEARCH_PATHS = ( 377 | "$(SDKROOT)/Developer/Library/Frameworks", 378 | "$(inherited)", 379 | ); 380 | INFOPLIST_FILE = ImageEffectsTests/Info.plist; 381 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | }; 384 | name = Release; 385 | }; 386 | /* End XCBuildConfiguration section */ 387 | 388 | /* Begin XCConfigurationList section */ 389 | 03AC7B641B149C690015C171 /* Build configuration list for PBXProject "ImageEffects" */ = { 390 | isa = XCConfigurationList; 391 | buildConfigurations = ( 392 | 03AC7B7E1B149C6A0015C171 /* Debug */, 393 | 03AC7B7F1B149C6A0015C171 /* Release */, 394 | ); 395 | defaultConfigurationIsVisible = 0; 396 | defaultConfigurationName = Release; 397 | }; 398 | 03AC7B801B149C6A0015C171 /* Build configuration list for PBXNativeTarget "ImageEffects" */ = { 399 | isa = XCConfigurationList; 400 | buildConfigurations = ( 401 | 03AC7B811B149C6A0015C171 /* Debug */, 402 | 03AC7B821B149C6A0015C171 /* Release */, 403 | ); 404 | defaultConfigurationIsVisible = 0; 405 | }; 406 | 03AC7B831B149C6A0015C171 /* Build configuration list for PBXNativeTarget "ImageEffectsTests" */ = { 407 | isa = XCConfigurationList; 408 | buildConfigurations = ( 409 | 03AC7B841B149C6A0015C171 /* Debug */, 410 | 03AC7B851B149C6A0015C171 /* Release */, 411 | ); 412 | defaultConfigurationIsVisible = 0; 413 | }; 414 | /* End XCConfigurationList section */ 415 | }; 416 | rootObject = 03AC7B611B149C690015C171 /* Project object */; 417 | } 418 | --------------------------------------------------------------------------------