├── .gitignore ├── GPUImgeDemo ├── GPUImgeDemo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── GPUImgeDemo.xcworkspace │ └── contents.xcworkspacedata ├── GPUImgeDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── BeautifyFilterViewController.h │ ├── BeautifyFilterViewController.m │ ├── GPUImageBeautifyFilter │ │ ├── GPUImageBeautifyFilter.h │ │ └── GPUImageBeautifyFilter.m │ ├── GPUImageFilterViewController.h │ ├── GPUImageFilterViewController.m │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── Podfile ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A840F5610427B1ABAB1EE8E3 /* libPods-GPUImgeDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E706ED58126B1B23FA1C1092 /* libPods-GPUImgeDemo.a */; }; 11 | EC0ACB921D977562000F9E32 /* BeautifyFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EC0ACB911D977562000F9E32 /* BeautifyFilterViewController.m */; }; 12 | EC0ACB951D977574000F9E32 /* GPUImageFilterViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EC0ACB941D977574000F9E32 /* GPUImageFilterViewController.m */; }; 13 | EC0ACB9C1D977EF5000F9E32 /* GPUImageBeautifyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = EC0ACB9B1D977EF5000F9E32 /* GPUImageBeautifyFilter.m */; }; 14 | EC9BDD7A1D951F4A006CE977 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = EC9BDD791D951F4A006CE977 /* main.m */; }; 15 | EC9BDD7D1D951F4A006CE977 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = EC9BDD7C1D951F4A006CE977 /* AppDelegate.m */; }; 16 | EC9BDD801D951F4A006CE977 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = EC9BDD7F1D951F4A006CE977 /* ViewController.m */; }; 17 | EC9BDD831D951F4A006CE977 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EC9BDD811D951F4A006CE977 /* Main.storyboard */; }; 18 | EC9BDD851D951F4A006CE977 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = EC9BDD841D951F4A006CE977 /* Assets.xcassets */; }; 19 | EC9BDD881D951F4A006CE977 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = EC9BDD861D951F4A006CE977 /* LaunchScreen.storyboard */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXFileReference section */ 23 | 2E213C811AF53189E93B6D3E /* Pods-GPUImgeDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImgeDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImgeDemo/Pods-GPUImgeDemo.debug.xcconfig"; sourceTree = ""; }; 24 | 8CD3FEC939E3EDB89DFE8D44 /* Pods-GPUImgeDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImgeDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImgeDemo/Pods-GPUImgeDemo.release.xcconfig"; sourceTree = ""; }; 25 | E706ED58126B1B23FA1C1092 /* libPods-GPUImgeDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GPUImgeDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 26 | EC0ACB901D977562000F9E32 /* BeautifyFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BeautifyFilterViewController.h; sourceTree = ""; }; 27 | EC0ACB911D977562000F9E32 /* BeautifyFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BeautifyFilterViewController.m; sourceTree = ""; }; 28 | EC0ACB931D977574000F9E32 /* GPUImageFilterViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFilterViewController.h; sourceTree = ""; }; 29 | EC0ACB941D977574000F9E32 /* GPUImageFilterViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPUImageFilterViewController.m; sourceTree = ""; }; 30 | EC0ACB9A1D977EF5000F9E32 /* GPUImageBeautifyFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageBeautifyFilter.h; sourceTree = ""; }; 31 | EC0ACB9B1D977EF5000F9E32 /* GPUImageBeautifyFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPUImageBeautifyFilter.m; sourceTree = ""; }; 32 | EC9BDD751D951F4A006CE977 /* GPUImgeDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GPUImgeDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | EC9BDD791D951F4A006CE977 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 34 | EC9BDD7B1D951F4A006CE977 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 35 | EC9BDD7C1D951F4A006CE977 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 36 | EC9BDD7E1D951F4A006CE977 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 37 | EC9BDD7F1D951F4A006CE977 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 38 | EC9BDD821D951F4A006CE977 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 39 | EC9BDD841D951F4A006CE977 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 40 | EC9BDD871D951F4A006CE977 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 41 | EC9BDD891D951F4A006CE977 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 42 | /* End PBXFileReference section */ 43 | 44 | /* Begin PBXFrameworksBuildPhase section */ 45 | EC9BDD721D951F4A006CE977 /* Frameworks */ = { 46 | isa = PBXFrameworksBuildPhase; 47 | buildActionMask = 2147483647; 48 | files = ( 49 | A840F5610427B1ABAB1EE8E3 /* libPods-GPUImgeDemo.a in Frameworks */, 50 | ); 51 | runOnlyForDeploymentPostprocessing = 0; 52 | }; 53 | /* End PBXFrameworksBuildPhase section */ 54 | 55 | /* Begin PBXGroup section */ 56 | 43EF9F0408BD36A65FB4AF4D /* Pods */ = { 57 | isa = PBXGroup; 58 | children = ( 59 | 2E213C811AF53189E93B6D3E /* Pods-GPUImgeDemo.debug.xcconfig */, 60 | 8CD3FEC939E3EDB89DFE8D44 /* Pods-GPUImgeDemo.release.xcconfig */, 61 | ); 62 | name = Pods; 63 | sourceTree = ""; 64 | }; 65 | B69B2EAF275D6D3FF29D2758 /* Frameworks */ = { 66 | isa = PBXGroup; 67 | children = ( 68 | E706ED58126B1B23FA1C1092 /* libPods-GPUImgeDemo.a */, 69 | ); 70 | name = Frameworks; 71 | sourceTree = ""; 72 | }; 73 | EC0ACB991D977EF5000F9E32 /* GPUImageBeautifyFilter */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | EC0ACB9A1D977EF5000F9E32 /* GPUImageBeautifyFilter.h */, 77 | EC0ACB9B1D977EF5000F9E32 /* GPUImageBeautifyFilter.m */, 78 | ); 79 | path = GPUImageBeautifyFilter; 80 | sourceTree = ""; 81 | }; 82 | EC9BDD6C1D951F4A006CE977 = { 83 | isa = PBXGroup; 84 | children = ( 85 | EC9BDD771D951F4A006CE977 /* GPUImgeDemo */, 86 | EC9BDD761D951F4A006CE977 /* Products */, 87 | 43EF9F0408BD36A65FB4AF4D /* Pods */, 88 | B69B2EAF275D6D3FF29D2758 /* Frameworks */, 89 | ); 90 | sourceTree = ""; 91 | }; 92 | EC9BDD761D951F4A006CE977 /* Products */ = { 93 | isa = PBXGroup; 94 | children = ( 95 | EC9BDD751D951F4A006CE977 /* GPUImgeDemo.app */, 96 | ); 97 | name = Products; 98 | sourceTree = ""; 99 | }; 100 | EC9BDD771D951F4A006CE977 /* GPUImgeDemo */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | EC0ACB991D977EF5000F9E32 /* GPUImageBeautifyFilter */, 104 | EC9BDD7B1D951F4A006CE977 /* AppDelegate.h */, 105 | EC9BDD7C1D951F4A006CE977 /* AppDelegate.m */, 106 | EC9BDD7E1D951F4A006CE977 /* ViewController.h */, 107 | EC9BDD7F1D951F4A006CE977 /* ViewController.m */, 108 | EC9BDD811D951F4A006CE977 /* Main.storyboard */, 109 | EC9BDD841D951F4A006CE977 /* Assets.xcassets */, 110 | EC9BDD861D951F4A006CE977 /* LaunchScreen.storyboard */, 111 | EC9BDD891D951F4A006CE977 /* Info.plist */, 112 | EC9BDD781D951F4A006CE977 /* Supporting Files */, 113 | EC0ACB901D977562000F9E32 /* BeautifyFilterViewController.h */, 114 | EC0ACB911D977562000F9E32 /* BeautifyFilterViewController.m */, 115 | EC0ACB931D977574000F9E32 /* GPUImageFilterViewController.h */, 116 | EC0ACB941D977574000F9E32 /* GPUImageFilterViewController.m */, 117 | ); 118 | path = GPUImgeDemo; 119 | sourceTree = ""; 120 | }; 121 | EC9BDD781D951F4A006CE977 /* Supporting Files */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | EC9BDD791D951F4A006CE977 /* main.m */, 125 | ); 126 | name = "Supporting Files"; 127 | sourceTree = ""; 128 | }; 129 | /* End PBXGroup section */ 130 | 131 | /* Begin PBXNativeTarget section */ 132 | EC9BDD741D951F4A006CE977 /* GPUImgeDemo */ = { 133 | isa = PBXNativeTarget; 134 | buildConfigurationList = EC9BDD8C1D951F4A006CE977 /* Build configuration list for PBXNativeTarget "GPUImgeDemo" */; 135 | buildPhases = ( 136 | F451F81E0661E72F71AA2997 /* [CP] Check Pods Manifest.lock */, 137 | EC9BDD711D951F4A006CE977 /* Sources */, 138 | EC9BDD721D951F4A006CE977 /* Frameworks */, 139 | EC9BDD731D951F4A006CE977 /* Resources */, 140 | A48ADC7626049D022E0870D4 /* [CP] Embed Pods Frameworks */, 141 | 04FF7302DEA584AE167E1CEB /* [CP] Copy Pods Resources */, 142 | ); 143 | buildRules = ( 144 | ); 145 | dependencies = ( 146 | ); 147 | name = GPUImgeDemo; 148 | productName = GPUImgeDemo; 149 | productReference = EC9BDD751D951F4A006CE977 /* GPUImgeDemo.app */; 150 | productType = "com.apple.product-type.application"; 151 | }; 152 | /* End PBXNativeTarget section */ 153 | 154 | /* Begin PBXProject section */ 155 | EC9BDD6D1D951F4A006CE977 /* Project object */ = { 156 | isa = PBXProject; 157 | attributes = { 158 | LastUpgradeCheck = 0720; 159 | ORGANIZATIONNAME = yz; 160 | TargetAttributes = { 161 | EC9BDD741D951F4A006CE977 = { 162 | CreatedOnToolsVersion = 7.2.1; 163 | DevelopmentTeam = YKYB5YMSRP; 164 | }; 165 | }; 166 | }; 167 | buildConfigurationList = EC9BDD701D951F4A006CE977 /* Build configuration list for PBXProject "GPUImgeDemo" */; 168 | compatibilityVersion = "Xcode 3.2"; 169 | developmentRegion = English; 170 | hasScannedForEncodings = 0; 171 | knownRegions = ( 172 | en, 173 | Base, 174 | ); 175 | mainGroup = EC9BDD6C1D951F4A006CE977; 176 | productRefGroup = EC9BDD761D951F4A006CE977 /* Products */; 177 | projectDirPath = ""; 178 | projectRoot = ""; 179 | targets = ( 180 | EC9BDD741D951F4A006CE977 /* GPUImgeDemo */, 181 | ); 182 | }; 183 | /* End PBXProject section */ 184 | 185 | /* Begin PBXResourcesBuildPhase section */ 186 | EC9BDD731D951F4A006CE977 /* Resources */ = { 187 | isa = PBXResourcesBuildPhase; 188 | buildActionMask = 2147483647; 189 | files = ( 190 | EC9BDD881D951F4A006CE977 /* LaunchScreen.storyboard in Resources */, 191 | EC9BDD851D951F4A006CE977 /* Assets.xcassets in Resources */, 192 | EC9BDD831D951F4A006CE977 /* Main.storyboard in Resources */, 193 | ); 194 | runOnlyForDeploymentPostprocessing = 0; 195 | }; 196 | /* End PBXResourcesBuildPhase section */ 197 | 198 | /* Begin PBXShellScriptBuildPhase section */ 199 | 04FF7302DEA584AE167E1CEB /* [CP] Copy Pods Resources */ = { 200 | isa = PBXShellScriptBuildPhase; 201 | buildActionMask = 2147483647; 202 | files = ( 203 | ); 204 | inputPaths = ( 205 | ); 206 | name = "[CP] Copy Pods Resources"; 207 | outputPaths = ( 208 | ); 209 | runOnlyForDeploymentPostprocessing = 0; 210 | shellPath = /bin/sh; 211 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImgeDemo/Pods-GPUImgeDemo-resources.sh\"\n"; 212 | showEnvVarsInLog = 0; 213 | }; 214 | A48ADC7626049D022E0870D4 /* [CP] Embed Pods Frameworks */ = { 215 | isa = PBXShellScriptBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | ); 219 | inputPaths = ( 220 | ); 221 | name = "[CP] Embed Pods Frameworks"; 222 | outputPaths = ( 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | shellPath = /bin/sh; 226 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImgeDemo/Pods-GPUImgeDemo-frameworks.sh\"\n"; 227 | showEnvVarsInLog = 0; 228 | }; 229 | F451F81E0661E72F71AA2997 /* [CP] Check Pods Manifest.lock */ = { 230 | isa = PBXShellScriptBuildPhase; 231 | buildActionMask = 2147483647; 232 | files = ( 233 | ); 234 | inputPaths = ( 235 | ); 236 | name = "[CP] Check Pods Manifest.lock"; 237 | outputPaths = ( 238 | ); 239 | runOnlyForDeploymentPostprocessing = 0; 240 | shellPath = /bin/sh; 241 | 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"; 242 | showEnvVarsInLog = 0; 243 | }; 244 | /* End PBXShellScriptBuildPhase section */ 245 | 246 | /* Begin PBXSourcesBuildPhase section */ 247 | EC9BDD711D951F4A006CE977 /* Sources */ = { 248 | isa = PBXSourcesBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | EC9BDD801D951F4A006CE977 /* ViewController.m in Sources */, 252 | EC9BDD7D1D951F4A006CE977 /* AppDelegate.m in Sources */, 253 | EC9BDD7A1D951F4A006CE977 /* main.m in Sources */, 254 | EC0ACB9C1D977EF5000F9E32 /* GPUImageBeautifyFilter.m in Sources */, 255 | EC0ACB921D977562000F9E32 /* BeautifyFilterViewController.m in Sources */, 256 | EC0ACB951D977574000F9E32 /* GPUImageFilterViewController.m in Sources */, 257 | ); 258 | runOnlyForDeploymentPostprocessing = 0; 259 | }; 260 | /* End PBXSourcesBuildPhase section */ 261 | 262 | /* Begin PBXVariantGroup section */ 263 | EC9BDD811D951F4A006CE977 /* Main.storyboard */ = { 264 | isa = PBXVariantGroup; 265 | children = ( 266 | EC9BDD821D951F4A006CE977 /* Base */, 267 | ); 268 | name = Main.storyboard; 269 | sourceTree = ""; 270 | }; 271 | EC9BDD861D951F4A006CE977 /* LaunchScreen.storyboard */ = { 272 | isa = PBXVariantGroup; 273 | children = ( 274 | EC9BDD871D951F4A006CE977 /* Base */, 275 | ); 276 | name = LaunchScreen.storyboard; 277 | sourceTree = ""; 278 | }; 279 | /* End PBXVariantGroup section */ 280 | 281 | /* Begin XCBuildConfiguration section */ 282 | EC9BDD8A1D951F4A006CE977 /* Debug */ = { 283 | isa = XCBuildConfiguration; 284 | buildSettings = { 285 | ALWAYS_SEARCH_USER_PATHS = NO; 286 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 287 | CLANG_CXX_LIBRARY = "libc++"; 288 | CLANG_ENABLE_MODULES = YES; 289 | CLANG_ENABLE_OBJC_ARC = YES; 290 | CLANG_WARN_BOOL_CONVERSION = YES; 291 | CLANG_WARN_CONSTANT_CONVERSION = YES; 292 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 293 | CLANG_WARN_EMPTY_BODY = YES; 294 | CLANG_WARN_ENUM_CONVERSION = YES; 295 | CLANG_WARN_INT_CONVERSION = YES; 296 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 297 | CLANG_WARN_UNREACHABLE_CODE = YES; 298 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 299 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 300 | COPY_PHASE_STRIP = NO; 301 | DEBUG_INFORMATION_FORMAT = dwarf; 302 | ENABLE_STRICT_OBJC_MSGSEND = YES; 303 | ENABLE_TESTABILITY = YES; 304 | GCC_C_LANGUAGE_STANDARD = gnu99; 305 | GCC_DYNAMIC_NO_PIC = NO; 306 | GCC_NO_COMMON_BLOCKS = YES; 307 | GCC_OPTIMIZATION_LEVEL = 0; 308 | GCC_PREPROCESSOR_DEFINITIONS = ( 309 | "DEBUG=1", 310 | "$(inherited)", 311 | ); 312 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 313 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 314 | GCC_WARN_UNDECLARED_SELECTOR = YES; 315 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 316 | GCC_WARN_UNUSED_FUNCTION = YES; 317 | GCC_WARN_UNUSED_VARIABLE = YES; 318 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 319 | MTL_ENABLE_DEBUG_INFO = YES; 320 | ONLY_ACTIVE_ARCH = YES; 321 | SDKROOT = iphoneos; 322 | }; 323 | name = Debug; 324 | }; 325 | EC9BDD8B1D951F4A006CE977 /* Release */ = { 326 | isa = XCBuildConfiguration; 327 | buildSettings = { 328 | ALWAYS_SEARCH_USER_PATHS = NO; 329 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 330 | CLANG_CXX_LIBRARY = "libc++"; 331 | CLANG_ENABLE_MODULES = YES; 332 | CLANG_ENABLE_OBJC_ARC = YES; 333 | CLANG_WARN_BOOL_CONVERSION = YES; 334 | CLANG_WARN_CONSTANT_CONVERSION = YES; 335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 336 | CLANG_WARN_EMPTY_BODY = YES; 337 | CLANG_WARN_ENUM_CONVERSION = YES; 338 | CLANG_WARN_INT_CONVERSION = YES; 339 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 340 | CLANG_WARN_UNREACHABLE_CODE = YES; 341 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 342 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 343 | COPY_PHASE_STRIP = NO; 344 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 345 | ENABLE_NS_ASSERTIONS = NO; 346 | ENABLE_STRICT_OBJC_MSGSEND = YES; 347 | GCC_C_LANGUAGE_STANDARD = gnu99; 348 | GCC_NO_COMMON_BLOCKS = YES; 349 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 350 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 351 | GCC_WARN_UNDECLARED_SELECTOR = YES; 352 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 353 | GCC_WARN_UNUSED_FUNCTION = YES; 354 | GCC_WARN_UNUSED_VARIABLE = YES; 355 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 356 | MTL_ENABLE_DEBUG_INFO = NO; 357 | SDKROOT = iphoneos; 358 | VALIDATE_PRODUCT = YES; 359 | }; 360 | name = Release; 361 | }; 362 | EC9BDD8D1D951F4A006CE977 /* Debug */ = { 363 | isa = XCBuildConfiguration; 364 | baseConfigurationReference = 2E213C811AF53189E93B6D3E /* Pods-GPUImgeDemo.debug.xcconfig */; 365 | buildSettings = { 366 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 367 | INFOPLIST_FILE = GPUImgeDemo/Info.plist; 368 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 369 | PRODUCT_BUNDLE_IDENTIFIER = iThinker.GPUImgeDemo; 370 | PRODUCT_NAME = "$(TARGET_NAME)"; 371 | }; 372 | name = Debug; 373 | }; 374 | EC9BDD8E1D951F4A006CE977 /* Release */ = { 375 | isa = XCBuildConfiguration; 376 | baseConfigurationReference = 8CD3FEC939E3EDB89DFE8D44 /* Pods-GPUImgeDemo.release.xcconfig */; 377 | buildSettings = { 378 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 379 | INFOPLIST_FILE = GPUImgeDemo/Info.plist; 380 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 381 | PRODUCT_BUNDLE_IDENTIFIER = iThinker.GPUImgeDemo; 382 | PRODUCT_NAME = "$(TARGET_NAME)"; 383 | }; 384 | name = Release; 385 | }; 386 | /* End XCBuildConfiguration section */ 387 | 388 | /* Begin XCConfigurationList section */ 389 | EC9BDD701D951F4A006CE977 /* Build configuration list for PBXProject "GPUImgeDemo" */ = { 390 | isa = XCConfigurationList; 391 | buildConfigurations = ( 392 | EC9BDD8A1D951F4A006CE977 /* Debug */, 393 | EC9BDD8B1D951F4A006CE977 /* Release */, 394 | ); 395 | defaultConfigurationIsVisible = 0; 396 | defaultConfigurationName = Release; 397 | }; 398 | EC9BDD8C1D951F4A006CE977 /* Build configuration list for PBXNativeTarget "GPUImgeDemo" */ = { 399 | isa = XCConfigurationList; 400 | buildConfigurations = ( 401 | EC9BDD8D1D951F4A006CE977 /* Debug */, 402 | EC9BDD8E1D951F4A006CE977 /* Release */, 403 | ); 404 | defaultConfigurationIsVisible = 0; 405 | defaultConfigurationName = Release; 406 | }; 407 | /* End XCConfigurationList section */ 408 | }; 409 | rootObject = EC9BDD6D1D951F4A006CE977 /* Project object */; 410 | } 411 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/23. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/23. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/Assets.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" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/Base.lproj/LaunchScreen.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 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 30 | 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 | 72 | 73 | 74 | 75 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 138 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/BeautifyFilterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BeautifyFilterViewController.h 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/25. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface BeautifyFilterViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/BeautifyFilterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BeautifyFilterViewController.m 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/25. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import "BeautifyFilterViewController.h" 10 | #import 11 | #import "GPUImageBeautifyFilter.h" 12 | @interface BeautifyFilterViewController () 13 | @property (nonatomic, strong) GPUImageVideoCamera *videoCamera; 14 | @property (nonatomic, weak) GPUImageView *captureVideoPreview; 15 | @end 16 | 17 | @implementation BeautifyFilterViewController 18 | - (IBAction)openBeautifyFilter:(UISwitch *)sender { 19 | 20 | // 切换美颜效果原理:移除之前所有处理链,重新设置处理链 21 | if (sender.on) { 22 | 23 | // 移除之前所有处理链 24 | [_videoCamera removeAllTargets]; 25 | 26 | // 创建美颜滤镜 27 | GPUImageBeautifyFilter *beautifyFilter = [[GPUImageBeautifyFilter alloc] init]; 28 | 29 | // 设置GPUImage处理链,从数据源 => 滤镜 => 最终界面效果 30 | [_videoCamera addTarget:beautifyFilter]; 31 | [beautifyFilter addTarget:_captureVideoPreview]; 32 | 33 | } else { 34 | 35 | // 移除之前所有处理链 36 | [_videoCamera removeAllTargets]; 37 | [_videoCamera addTarget:_captureVideoPreview]; 38 | } 39 | 40 | 41 | } 42 | 43 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 44 | { 45 | [self dismissViewControllerAnimated:YES completion:nil]; 46 | } 47 | 48 | - (void)viewDidLoad { 49 | [super viewDidLoad]; 50 | // Do any additional setup after loading the view. 51 | // 创建视频源 52 | // SessionPreset:屏幕分辨率,AVCaptureSessionPresetHigh会自适应高分辨率 53 | // cameraPosition:摄像头方向 54 | GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetHigh cameraPosition:AVCaptureDevicePositionFront]; 55 | videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; 56 | _videoCamera = videoCamera; 57 | 58 | // 创建最终预览View 59 | GPUImageView *captureVideoPreview = [[GPUImageView alloc] initWithFrame:self.view.bounds]; 60 | [self.view insertSubview:captureVideoPreview atIndex:0]; 61 | _captureVideoPreview = captureVideoPreview; 62 | 63 | // 设置处理链 64 | [_videoCamera addTarget:_captureVideoPreview]; 65 | 66 | // 必须调用startCameraCapture,底层才会把采集到的视频源,渲染到GPUImageView中,就能显示了。 67 | // 开始采集视频 68 | [videoCamera startCameraCapture]; 69 | 70 | } 71 | 72 | 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/GPUImageBeautifyFilter/GPUImageBeautifyFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageBeautifyFilter.h 3 | // BeautifyFaceDemo 4 | // 5 | // Created by guikz on 16/4/28. 6 | // Copyright © 2016年 guikz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GPUImageCombinationFilter; 12 | 13 | @interface GPUImageBeautifyFilter : GPUImageFilterGroup { 14 | GPUImageBilateralFilter *bilateralFilter; 15 | GPUImageCannyEdgeDetectionFilter *cannyEdgeFilter; 16 | GPUImageCombinationFilter *combinationFilter; 17 | GPUImageHSBFilter *hsbFilter; 18 | } 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/GPUImageBeautifyFilter/GPUImageBeautifyFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageBeautifyFilter.m 3 | // BeautifyFaceDemo 4 | // 5 | // Created by guikz on 16/4/28. 6 | // Copyright © 2016年 guikz. All rights reserved. 7 | // 8 | 9 | #import "GPUImageBeautifyFilter.h" 10 | 11 | // Internal CombinationFilter(It should not be used outside) 12 | @interface GPUImageCombinationFilter : GPUImageThreeInputFilter 13 | { 14 | GLint smoothDegreeUniform; 15 | } 16 | 17 | @property (nonatomic, assign) CGFloat intensity; 18 | 19 | @end 20 | 21 | NSString *const kGPUImageBeautifyFragmentShaderString = SHADER_STRING 22 | ( 23 | varying highp vec2 textureCoordinate; 24 | varying highp vec2 textureCoordinate2; 25 | varying highp vec2 textureCoordinate3; 26 | 27 | uniform sampler2D inputImageTexture; 28 | uniform sampler2D inputImageTexture2; 29 | uniform sampler2D inputImageTexture3; 30 | uniform mediump float smoothDegree; 31 | 32 | void main() 33 | { 34 | highp vec4 bilateral = texture2D(inputImageTexture, textureCoordinate); 35 | highp vec4 canny = texture2D(inputImageTexture2, textureCoordinate2); 36 | highp vec4 origin = texture2D(inputImageTexture3,textureCoordinate3); 37 | highp vec4 smooth; 38 | lowp float r = origin.r; 39 | lowp float g = origin.g; 40 | lowp float b = origin.b; 41 | if (canny.r < 0.2 && r > 0.3725 && g > 0.1568 && b > 0.0784 && r > b && (max(max(r, g), b) - min(min(r, g), b)) > 0.0588 && abs(r-g) > 0.0588) { 42 | smooth = (1.0 - smoothDegree) * (origin - bilateral) + bilateral; 43 | } 44 | else { 45 | smooth = origin; 46 | } 47 | smooth.r = log(1.0 + 0.2 * smooth.r)/log(1.2); 48 | smooth.g = log(1.0 + 0.2 * smooth.g)/log(1.2); 49 | smooth.b = log(1.0 + 0.2 * smooth.b)/log(1.2); 50 | gl_FragColor = smooth; 51 | } 52 | ); 53 | 54 | @implementation GPUImageCombinationFilter 55 | 56 | - (id)init { 57 | if (self = [super initWithFragmentShaderFromString:kGPUImageBeautifyFragmentShaderString]) { 58 | smoothDegreeUniform = [filterProgram uniformIndex:@"smoothDegree"]; 59 | } 60 | self.intensity = 0.5; 61 | return self; 62 | } 63 | 64 | - (void)setIntensity:(CGFloat)intensity { 65 | _intensity = intensity; 66 | [self setFloat:intensity forUniform:smoothDegreeUniform program:filterProgram]; 67 | } 68 | 69 | @end 70 | 71 | @implementation GPUImageBeautifyFilter 72 | 73 | - (id)init; 74 | { 75 | if (!(self = [super init])) 76 | { 77 | return nil; 78 | } 79 | 80 | // First pass: face smoothing filter 81 | bilateralFilter = [[GPUImageBilateralFilter alloc] init]; 82 | bilateralFilter.distanceNormalizationFactor = 4.0; 83 | [self addFilter:bilateralFilter]; 84 | 85 | // Second pass: edge detection 86 | cannyEdgeFilter = [[GPUImageCannyEdgeDetectionFilter alloc] init]; 87 | [self addFilter:cannyEdgeFilter]; 88 | 89 | // Third pass: combination bilateral, edge detection and origin 90 | combinationFilter = [[GPUImageCombinationFilter alloc] init]; 91 | [self addFilter:combinationFilter]; 92 | 93 | // Adjust HSB 94 | hsbFilter = [[GPUImageHSBFilter alloc] init]; 95 | [hsbFilter adjustBrightness:1.1]; 96 | [hsbFilter adjustSaturation:1.1]; 97 | 98 | [bilateralFilter addTarget:combinationFilter]; 99 | [cannyEdgeFilter addTarget:combinationFilter]; 100 | 101 | [combinationFilter addTarget:hsbFilter]; 102 | 103 | self.initialFilters = [NSArray arrayWithObjects:bilateralFilter,cannyEdgeFilter,combinationFilter,nil]; 104 | self.terminalFilter = hsbFilter; 105 | 106 | return self; 107 | } 108 | 109 | #pragma mark - 110 | #pragma mark GPUImageInput protocol 111 | 112 | - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex; 113 | { 114 | for (GPUImageOutput *currentFilter in self.initialFilters) 115 | { 116 | if (currentFilter != self.inputFilterToIgnoreForUpdates) 117 | { 118 | if (currentFilter == combinationFilter) { 119 | textureIndex = 2; 120 | } 121 | [currentFilter newFrameReadyAtTime:frameTime atIndex:textureIndex]; 122 | } 123 | } 124 | } 125 | 126 | - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex; 127 | { 128 | for (GPUImageOutput *currentFilter in self.initialFilters) 129 | { 130 | if (currentFilter == combinationFilter) { 131 | textureIndex = 2; 132 | } 133 | [currentFilter setInputFramebuffer:newInputFramebuffer atIndex:textureIndex]; 134 | } 135 | } 136 | 137 | @end 138 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/GPUImageFilterViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFilterViewController.h 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/25. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GPUImageFilterViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/GPUImageFilterViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFilterViewController.m 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/25. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import "GPUImageFilterViewController.h" 10 | #import 11 | @interface GPUImageFilterViewController () 12 | @property (nonatomic, weak) GPUImageBilateralFilter *bilateralFilter; 13 | @property (nonatomic, weak) GPUImageBrightnessFilter *brightnessFilter; 14 | @property (nonatomic, strong) GPUImageVideoCamera *videoCamera; 15 | @end 16 | 17 | @implementation GPUImageFilterViewController 18 | 19 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event 20 | { 21 | [self dismissViewControllerAnimated:YES completion:nil]; 22 | } 23 | 24 | - (IBAction)brightnessFilter:(UISlider *)sender { 25 | _brightnessFilter.brightness = sender.value; 26 | } 27 | 28 | - (IBAction)bilateralFilter:(UISlider *)sender { 29 | // 值越小,磨皮效果越好 30 | CGFloat maxValue = 10; 31 | [_bilateralFilter setDistanceNormalizationFactor:(maxValue - sender.value)]; 32 | } 33 | 34 | - (void)viewDidLoad { 35 | [super viewDidLoad]; 36 | // Do any additional setup after loading the view. 37 | // 创建视频源 38 | // SessionPreset:屏幕分辨率,AVCaptureSessionPresetHigh会自适应高分辨率 39 | // cameraPosition:摄像头方向 40 | // 最好使用AVCaptureSessionPresetHigh,会自动识别,如果用太高分辨率,当前设备不支持会直接报错 41 | GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetHigh cameraPosition:AVCaptureDevicePositionFront]; 42 | videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; 43 | _videoCamera = videoCamera; 44 | 45 | // 创建最终预览View 46 | GPUImageView *captureVideoPreview = [[GPUImageView alloc] initWithFrame:self.view.bounds]; 47 | [self.view insertSubview:captureVideoPreview atIndex:0]; 48 | 49 | // 创建滤镜:磨皮,美白,组合滤镜 50 | GPUImageFilterGroup *groupFilter = [[GPUImageFilterGroup alloc] init]; 51 | 52 | // 磨皮滤镜 53 | GPUImageBilateralFilter *bilateralFilter = [[GPUImageBilateralFilter alloc] init]; 54 | [groupFilter addTarget:bilateralFilter]; 55 | _bilateralFilter = bilateralFilter; 56 | 57 | // 美白滤镜 58 | GPUImageBrightnessFilter *brightnessFilter = [[GPUImageBrightnessFilter alloc] init]; 59 | [groupFilter addTarget:brightnessFilter]; 60 | _brightnessFilter = brightnessFilter; 61 | 62 | // 设置滤镜组链 63 | [bilateralFilter addTarget:brightnessFilter]; 64 | [groupFilter setInitialFilters:@[bilateralFilter]]; 65 | groupFilter.terminalFilter = brightnessFilter; 66 | 67 | // 设置GPUImage处理链,从数据源 => 滤镜 => 最终界面效果 68 | [videoCamera addTarget:groupFilter]; 69 | [groupFilter addTarget:captureVideoPreview]; 70 | 71 | // 必须调用startCameraCapture,底层才会把采集到的视频源,渲染到GPUImageView中,就能显示了。 72 | // 开始采集视频 73 | [videoCamera startCameraCapture]; 74 | 75 | } 76 | 77 | 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/23. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/23. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | } 24 | 25 | 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /GPUImgeDemo/GPUImgeDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GPUImgeDemo 4 | // 5 | // Created by yz on 16/9/23. 6 | // Copyright © 2016年 yz. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /GPUImgeDemo/Podfile: -------------------------------------------------------------------------------- 1 | 2 | target 'GPUImgeDemo' do 3 | 4 | pod 'GPUImage', '~> 0.1.7' 5 | 6 | end 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 iThinker_YZ 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 | # GPUImgeDemo 2 | 主要讲解利用GPUImage美颜 3 | --------------------------------------------------------------------------------