├── .gitignore ├── GPUImageDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── chuzhaozhi.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── chuzhaozhi.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── GPUImageDemo.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ └── chuzhaozhi.xcuserdatad │ └── UserInterfaceState.xcuserstate ├── GPUImageDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ └── lzl.imageset │ │ ├── Contents.json │ │ └── lzl.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ShowViewController.h ├── ShowViewController.m ├── ViewController.h ├── ViewController.m └── main.m ├── GPUImageDemoTests ├── GPUImageDemoTests.m └── Info.plist ├── GPUImageDemoUITests ├── GPUImageDemoUITests.m └── Info.plist ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md └── 效果图.gif /.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 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots/**/*.png 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /GPUImageDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 50; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 031346512150CBE80054F1D4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 031346502150CBE80054F1D4 /* AppDelegate.m */; }; 11 | 031346542150CBE80054F1D4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 031346532150CBE80054F1D4 /* ViewController.m */; }; 12 | 031346572150CBE80054F1D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 031346552150CBE80054F1D4 /* Main.storyboard */; }; 13 | 031346592150CBE90054F1D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 031346582150CBE90054F1D4 /* Assets.xcassets */; }; 14 | 0313465C2150CBE90054F1D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0313465A2150CBE90054F1D4 /* LaunchScreen.storyboard */; }; 15 | 0313465F2150CBE90054F1D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0313465E2150CBE90054F1D4 /* main.m */; }; 16 | 031346692150CBE90054F1D4 /* GPUImageDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 031346682150CBE90054F1D4 /* GPUImageDemoTests.m */; }; 17 | 031346742150CBE90054F1D4 /* GPUImageDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 031346732150CBE90054F1D4 /* GPUImageDemoUITests.m */; }; 18 | 031346832150D29E0054F1D4 /* ShowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 031346822150D29E0054F1D4 /* ShowViewController.m */; }; 19 | 469528EF57898AE1A1531E63 /* libPods-GPUImageDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FCB4210E67F695F228D273EE /* libPods-GPUImageDemo.a */; }; 20 | /* End PBXBuildFile section */ 21 | 22 | /* Begin PBXContainerItemProxy section */ 23 | 031346652150CBE90054F1D4 /* PBXContainerItemProxy */ = { 24 | isa = PBXContainerItemProxy; 25 | containerPortal = 031346442150CBE70054F1D4 /* Project object */; 26 | proxyType = 1; 27 | remoteGlobalIDString = 0313464B2150CBE70054F1D4; 28 | remoteInfo = GPUImageDemo; 29 | }; 30 | 031346702150CBE90054F1D4 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 031346442150CBE70054F1D4 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 0313464B2150CBE70054F1D4; 35 | remoteInfo = GPUImageDemo; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 0313464C2150CBE70054F1D4 /* GPUImageDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GPUImageDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 0313464F2150CBE70054F1D4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 42 | 031346502150CBE80054F1D4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 43 | 031346522150CBE80054F1D4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 44 | 031346532150CBE80054F1D4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 45 | 031346562150CBE80054F1D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 46 | 031346582150CBE90054F1D4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 47 | 0313465B2150CBE90054F1D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 48 | 0313465D2150CBE90054F1D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 49 | 0313465E2150CBE90054F1D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | 031346642150CBE90054F1D4 /* GPUImageDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GPUImageDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 51 | 031346682150CBE90054F1D4 /* GPUImageDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPUImageDemoTests.m; sourceTree = ""; }; 52 | 0313466A2150CBE90054F1D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 0313466F2150CBE90054F1D4 /* GPUImageDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GPUImageDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 031346732150CBE90054F1D4 /* GPUImageDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPUImageDemoUITests.m; sourceTree = ""; }; 55 | 031346752150CBE90054F1D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 56 | 031346812150D29E0054F1D4 /* ShowViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShowViewController.h; sourceTree = ""; }; 57 | 031346822150D29E0054F1D4 /* ShowViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShowViewController.m; sourceTree = ""; }; 58 | 6C48BB6929CFCF11E4A7ACDC /* Pods-GPUImageDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageDemo/Pods-GPUImageDemo.debug.xcconfig"; sourceTree = ""; }; 59 | BF2AF8E931C7E466681FC0F9 /* Pods-GPUImageDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageDemo/Pods-GPUImageDemo.release.xcconfig"; sourceTree = ""; }; 60 | FCB4210E67F695F228D273EE /* libPods-GPUImageDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GPUImageDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 61 | /* End PBXFileReference section */ 62 | 63 | /* Begin PBXFrameworksBuildPhase section */ 64 | 031346492150CBE70054F1D4 /* Frameworks */ = { 65 | isa = PBXFrameworksBuildPhase; 66 | buildActionMask = 2147483647; 67 | files = ( 68 | 469528EF57898AE1A1531E63 /* libPods-GPUImageDemo.a in Frameworks */, 69 | ); 70 | runOnlyForDeploymentPostprocessing = 0; 71 | }; 72 | 031346612150CBE90054F1D4 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | ); 77 | runOnlyForDeploymentPostprocessing = 0; 78 | }; 79 | 0313466C2150CBE90054F1D4 /* Frameworks */ = { 80 | isa = PBXFrameworksBuildPhase; 81 | buildActionMask = 2147483647; 82 | files = ( 83 | ); 84 | runOnlyForDeploymentPostprocessing = 0; 85 | }; 86 | /* End PBXFrameworksBuildPhase section */ 87 | 88 | /* Begin PBXGroup section */ 89 | 031346432150CBE70054F1D4 = { 90 | isa = PBXGroup; 91 | children = ( 92 | 0313464E2150CBE70054F1D4 /* GPUImageDemo */, 93 | 031346672150CBE90054F1D4 /* GPUImageDemoTests */, 94 | 031346722150CBE90054F1D4 /* GPUImageDemoUITests */, 95 | 0313464D2150CBE70054F1D4 /* Products */, 96 | 4760DC8F09F2D76C2CD578CB /* Pods */, 97 | 5FB14B35FBA55EDF09A0D51B /* Frameworks */, 98 | ); 99 | sourceTree = ""; 100 | }; 101 | 0313464D2150CBE70054F1D4 /* Products */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 0313464C2150CBE70054F1D4 /* GPUImageDemo.app */, 105 | 031346642150CBE90054F1D4 /* GPUImageDemoTests.xctest */, 106 | 0313466F2150CBE90054F1D4 /* GPUImageDemoUITests.xctest */, 107 | ); 108 | name = Products; 109 | sourceTree = ""; 110 | }; 111 | 0313464E2150CBE70054F1D4 /* GPUImageDemo */ = { 112 | isa = PBXGroup; 113 | children = ( 114 | 0313464F2150CBE70054F1D4 /* AppDelegate.h */, 115 | 031346502150CBE80054F1D4 /* AppDelegate.m */, 116 | 031346522150CBE80054F1D4 /* ViewController.h */, 117 | 031346532150CBE80054F1D4 /* ViewController.m */, 118 | 031346812150D29E0054F1D4 /* ShowViewController.h */, 119 | 031346822150D29E0054F1D4 /* ShowViewController.m */, 120 | 031346552150CBE80054F1D4 /* Main.storyboard */, 121 | 031346582150CBE90054F1D4 /* Assets.xcassets */, 122 | 0313465A2150CBE90054F1D4 /* LaunchScreen.storyboard */, 123 | 0313465D2150CBE90054F1D4 /* Info.plist */, 124 | 0313465E2150CBE90054F1D4 /* main.m */, 125 | ); 126 | path = GPUImageDemo; 127 | sourceTree = ""; 128 | }; 129 | 031346672150CBE90054F1D4 /* GPUImageDemoTests */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 031346682150CBE90054F1D4 /* GPUImageDemoTests.m */, 133 | 0313466A2150CBE90054F1D4 /* Info.plist */, 134 | ); 135 | path = GPUImageDemoTests; 136 | sourceTree = ""; 137 | }; 138 | 031346722150CBE90054F1D4 /* GPUImageDemoUITests */ = { 139 | isa = PBXGroup; 140 | children = ( 141 | 031346732150CBE90054F1D4 /* GPUImageDemoUITests.m */, 142 | 031346752150CBE90054F1D4 /* Info.plist */, 143 | ); 144 | path = GPUImageDemoUITests; 145 | sourceTree = ""; 146 | }; 147 | 4760DC8F09F2D76C2CD578CB /* Pods */ = { 148 | isa = PBXGroup; 149 | children = ( 150 | 6C48BB6929CFCF11E4A7ACDC /* Pods-GPUImageDemo.debug.xcconfig */, 151 | BF2AF8E931C7E466681FC0F9 /* Pods-GPUImageDemo.release.xcconfig */, 152 | ); 153 | name = Pods; 154 | sourceTree = ""; 155 | }; 156 | 5FB14B35FBA55EDF09A0D51B /* Frameworks */ = { 157 | isa = PBXGroup; 158 | children = ( 159 | FCB4210E67F695F228D273EE /* libPods-GPUImageDemo.a */, 160 | ); 161 | name = Frameworks; 162 | sourceTree = ""; 163 | }; 164 | /* End PBXGroup section */ 165 | 166 | /* Begin PBXNativeTarget section */ 167 | 0313464B2150CBE70054F1D4 /* GPUImageDemo */ = { 168 | isa = PBXNativeTarget; 169 | buildConfigurationList = 031346782150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemo" */; 170 | buildPhases = ( 171 | 65847D48CA1D8CFAAD0D7B5F /* [CP] Check Pods Manifest.lock */, 172 | 031346482150CBE70054F1D4 /* Sources */, 173 | 031346492150CBE70054F1D4 /* Frameworks */, 174 | 0313464A2150CBE70054F1D4 /* Resources */, 175 | E875ECA8A5EACB3849471871 /* [CP] Copy Pods Resources */, 176 | ); 177 | buildRules = ( 178 | ); 179 | dependencies = ( 180 | ); 181 | name = GPUImageDemo; 182 | productName = GPUImageDemo; 183 | productReference = 0313464C2150CBE70054F1D4 /* GPUImageDemo.app */; 184 | productType = "com.apple.product-type.application"; 185 | }; 186 | 031346632150CBE90054F1D4 /* GPUImageDemoTests */ = { 187 | isa = PBXNativeTarget; 188 | buildConfigurationList = 0313467B2150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemoTests" */; 189 | buildPhases = ( 190 | 031346602150CBE90054F1D4 /* Sources */, 191 | 031346612150CBE90054F1D4 /* Frameworks */, 192 | 031346622150CBE90054F1D4 /* Resources */, 193 | ); 194 | buildRules = ( 195 | ); 196 | dependencies = ( 197 | 031346662150CBE90054F1D4 /* PBXTargetDependency */, 198 | ); 199 | name = GPUImageDemoTests; 200 | productName = GPUImageDemoTests; 201 | productReference = 031346642150CBE90054F1D4 /* GPUImageDemoTests.xctest */; 202 | productType = "com.apple.product-type.bundle.unit-test"; 203 | }; 204 | 0313466E2150CBE90054F1D4 /* GPUImageDemoUITests */ = { 205 | isa = PBXNativeTarget; 206 | buildConfigurationList = 0313467E2150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemoUITests" */; 207 | buildPhases = ( 208 | 0313466B2150CBE90054F1D4 /* Sources */, 209 | 0313466C2150CBE90054F1D4 /* Frameworks */, 210 | 0313466D2150CBE90054F1D4 /* Resources */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | 031346712150CBE90054F1D4 /* PBXTargetDependency */, 216 | ); 217 | name = GPUImageDemoUITests; 218 | productName = GPUImageDemoUITests; 219 | productReference = 0313466F2150CBE90054F1D4 /* GPUImageDemoUITests.xctest */; 220 | productType = "com.apple.product-type.bundle.ui-testing"; 221 | }; 222 | /* End PBXNativeTarget section */ 223 | 224 | /* Begin PBXProject section */ 225 | 031346442150CBE70054F1D4 /* Project object */ = { 226 | isa = PBXProject; 227 | attributes = { 228 | LastUpgradeCheck = 1000; 229 | ORGANIZATIONNAME = JackerooChu; 230 | TargetAttributes = { 231 | 0313464B2150CBE70054F1D4 = { 232 | CreatedOnToolsVersion = 10.0; 233 | }; 234 | 031346632150CBE90054F1D4 = { 235 | CreatedOnToolsVersion = 10.0; 236 | TestTargetID = 0313464B2150CBE70054F1D4; 237 | }; 238 | 0313466E2150CBE90054F1D4 = { 239 | CreatedOnToolsVersion = 10.0; 240 | TestTargetID = 0313464B2150CBE70054F1D4; 241 | }; 242 | }; 243 | }; 244 | buildConfigurationList = 031346472150CBE70054F1D4 /* Build configuration list for PBXProject "GPUImageDemo" */; 245 | compatibilityVersion = "Xcode 9.3"; 246 | developmentRegion = en; 247 | hasScannedForEncodings = 0; 248 | knownRegions = ( 249 | en, 250 | Base, 251 | ); 252 | mainGroup = 031346432150CBE70054F1D4; 253 | productRefGroup = 0313464D2150CBE70054F1D4 /* Products */; 254 | projectDirPath = ""; 255 | projectRoot = ""; 256 | targets = ( 257 | 0313464B2150CBE70054F1D4 /* GPUImageDemo */, 258 | 031346632150CBE90054F1D4 /* GPUImageDemoTests */, 259 | 0313466E2150CBE90054F1D4 /* GPUImageDemoUITests */, 260 | ); 261 | }; 262 | /* End PBXProject section */ 263 | 264 | /* Begin PBXResourcesBuildPhase section */ 265 | 0313464A2150CBE70054F1D4 /* Resources */ = { 266 | isa = PBXResourcesBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | 0313465C2150CBE90054F1D4 /* LaunchScreen.storyboard in Resources */, 270 | 031346592150CBE90054F1D4 /* Assets.xcassets in Resources */, 271 | 031346572150CBE80054F1D4 /* Main.storyboard in Resources */, 272 | ); 273 | runOnlyForDeploymentPostprocessing = 0; 274 | }; 275 | 031346622150CBE90054F1D4 /* Resources */ = { 276 | isa = PBXResourcesBuildPhase; 277 | buildActionMask = 2147483647; 278 | files = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | }; 282 | 0313466D2150CBE90054F1D4 /* Resources */ = { 283 | isa = PBXResourcesBuildPhase; 284 | buildActionMask = 2147483647; 285 | files = ( 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | /* End PBXResourcesBuildPhase section */ 290 | 291 | /* Begin PBXShellScriptBuildPhase section */ 292 | 65847D48CA1D8CFAAD0D7B5F /* [CP] Check Pods Manifest.lock */ = { 293 | isa = PBXShellScriptBuildPhase; 294 | buildActionMask = 2147483647; 295 | files = ( 296 | ); 297 | inputPaths = ( 298 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 299 | "${PODS_ROOT}/Manifest.lock", 300 | ); 301 | name = "[CP] Check Pods Manifest.lock"; 302 | outputPaths = ( 303 | "$(DERIVED_FILE_DIR)/Pods-GPUImageDemo-checkManifestLockResult.txt", 304 | ); 305 | runOnlyForDeploymentPostprocessing = 0; 306 | shellPath = /bin/sh; 307 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 308 | showEnvVarsInLog = 0; 309 | }; 310 | E875ECA8A5EACB3849471871 /* [CP] Copy Pods Resources */ = { 311 | isa = PBXShellScriptBuildPhase; 312 | buildActionMask = 2147483647; 313 | files = ( 314 | ); 315 | inputPaths = ( 316 | "${SRCROOT}/Pods/Target Support Files/Pods-GPUImageDemo/Pods-GPUImageDemo-resources.sh", 317 | "${PODS_ROOT}/GPUImage/framework/Resources/lookup.png", 318 | "${PODS_ROOT}/GPUImage/framework/Resources/lookup_amatorka.png", 319 | "${PODS_ROOT}/GPUImage/framework/Resources/lookup_miss_etikate.png", 320 | "${PODS_ROOT}/GPUImage/framework/Resources/lookup_soft_elegance_1.png", 321 | "${PODS_ROOT}/GPUImage/framework/Resources/lookup_soft_elegance_2.png", 322 | ); 323 | name = "[CP] Copy Pods Resources"; 324 | outputPaths = ( 325 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lookup.png", 326 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lookup_amatorka.png", 327 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lookup_miss_etikate.png", 328 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lookup_soft_elegance_1.png", 329 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/lookup_soft_elegance_2.png", 330 | ); 331 | runOnlyForDeploymentPostprocessing = 0; 332 | shellPath = /bin/sh; 333 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImageDemo/Pods-GPUImageDemo-resources.sh\"\n"; 334 | showEnvVarsInLog = 0; 335 | }; 336 | /* End PBXShellScriptBuildPhase section */ 337 | 338 | /* Begin PBXSourcesBuildPhase section */ 339 | 031346482150CBE70054F1D4 /* Sources */ = { 340 | isa = PBXSourcesBuildPhase; 341 | buildActionMask = 2147483647; 342 | files = ( 343 | 031346542150CBE80054F1D4 /* ViewController.m in Sources */, 344 | 0313465F2150CBE90054F1D4 /* main.m in Sources */, 345 | 031346512150CBE80054F1D4 /* AppDelegate.m in Sources */, 346 | 031346832150D29E0054F1D4 /* ShowViewController.m in Sources */, 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | 031346602150CBE90054F1D4 /* Sources */ = { 351 | isa = PBXSourcesBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | 031346692150CBE90054F1D4 /* GPUImageDemoTests.m in Sources */, 355 | ); 356 | runOnlyForDeploymentPostprocessing = 0; 357 | }; 358 | 0313466B2150CBE90054F1D4 /* Sources */ = { 359 | isa = PBXSourcesBuildPhase; 360 | buildActionMask = 2147483647; 361 | files = ( 362 | 031346742150CBE90054F1D4 /* GPUImageDemoUITests.m in Sources */, 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | }; 366 | /* End PBXSourcesBuildPhase section */ 367 | 368 | /* Begin PBXTargetDependency section */ 369 | 031346662150CBE90054F1D4 /* PBXTargetDependency */ = { 370 | isa = PBXTargetDependency; 371 | target = 0313464B2150CBE70054F1D4 /* GPUImageDemo */; 372 | targetProxy = 031346652150CBE90054F1D4 /* PBXContainerItemProxy */; 373 | }; 374 | 031346712150CBE90054F1D4 /* PBXTargetDependency */ = { 375 | isa = PBXTargetDependency; 376 | target = 0313464B2150CBE70054F1D4 /* GPUImageDemo */; 377 | targetProxy = 031346702150CBE90054F1D4 /* PBXContainerItemProxy */; 378 | }; 379 | /* End PBXTargetDependency section */ 380 | 381 | /* Begin PBXVariantGroup section */ 382 | 031346552150CBE80054F1D4 /* Main.storyboard */ = { 383 | isa = PBXVariantGroup; 384 | children = ( 385 | 031346562150CBE80054F1D4 /* Base */, 386 | ); 387 | name = Main.storyboard; 388 | sourceTree = ""; 389 | }; 390 | 0313465A2150CBE90054F1D4 /* LaunchScreen.storyboard */ = { 391 | isa = PBXVariantGroup; 392 | children = ( 393 | 0313465B2150CBE90054F1D4 /* Base */, 394 | ); 395 | name = LaunchScreen.storyboard; 396 | sourceTree = ""; 397 | }; 398 | /* End PBXVariantGroup section */ 399 | 400 | /* Begin XCBuildConfiguration section */ 401 | 031346762150CBE90054F1D4 /* Debug */ = { 402 | isa = XCBuildConfiguration; 403 | buildSettings = { 404 | ALWAYS_SEARCH_USER_PATHS = NO; 405 | CLANG_ANALYZER_NONNULL = YES; 406 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 407 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 408 | CLANG_CXX_LIBRARY = "libc++"; 409 | CLANG_ENABLE_MODULES = YES; 410 | CLANG_ENABLE_OBJC_ARC = YES; 411 | CLANG_ENABLE_OBJC_WEAK = YES; 412 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 413 | CLANG_WARN_BOOL_CONVERSION = YES; 414 | CLANG_WARN_COMMA = YES; 415 | CLANG_WARN_CONSTANT_CONVERSION = YES; 416 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 417 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 418 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 419 | CLANG_WARN_EMPTY_BODY = YES; 420 | CLANG_WARN_ENUM_CONVERSION = YES; 421 | CLANG_WARN_INFINITE_RECURSION = YES; 422 | CLANG_WARN_INT_CONVERSION = YES; 423 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 424 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 425 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 426 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 427 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 428 | CLANG_WARN_STRICT_PROTOTYPES = YES; 429 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 430 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 431 | CLANG_WARN_UNREACHABLE_CODE = YES; 432 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 433 | CODE_SIGN_IDENTITY = "iPhone Developer"; 434 | COPY_PHASE_STRIP = NO; 435 | DEBUG_INFORMATION_FORMAT = dwarf; 436 | ENABLE_STRICT_OBJC_MSGSEND = YES; 437 | ENABLE_TESTABILITY = YES; 438 | GCC_C_LANGUAGE_STANDARD = gnu11; 439 | GCC_DYNAMIC_NO_PIC = NO; 440 | GCC_NO_COMMON_BLOCKS = YES; 441 | GCC_OPTIMIZATION_LEVEL = 0; 442 | GCC_PREPROCESSOR_DEFINITIONS = ( 443 | "DEBUG=1", 444 | "$(inherited)", 445 | ); 446 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 447 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 448 | GCC_WARN_UNDECLARED_SELECTOR = YES; 449 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 450 | GCC_WARN_UNUSED_FUNCTION = YES; 451 | GCC_WARN_UNUSED_VARIABLE = YES; 452 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 453 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 454 | MTL_FAST_MATH = YES; 455 | ONLY_ACTIVE_ARCH = YES; 456 | SDKROOT = iphoneos; 457 | }; 458 | name = Debug; 459 | }; 460 | 031346772150CBE90054F1D4 /* Release */ = { 461 | isa = XCBuildConfiguration; 462 | buildSettings = { 463 | ALWAYS_SEARCH_USER_PATHS = NO; 464 | CLANG_ANALYZER_NONNULL = YES; 465 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 466 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 467 | CLANG_CXX_LIBRARY = "libc++"; 468 | CLANG_ENABLE_MODULES = YES; 469 | CLANG_ENABLE_OBJC_ARC = YES; 470 | CLANG_ENABLE_OBJC_WEAK = YES; 471 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 472 | CLANG_WARN_BOOL_CONVERSION = YES; 473 | CLANG_WARN_COMMA = YES; 474 | CLANG_WARN_CONSTANT_CONVERSION = YES; 475 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 476 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 477 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 478 | CLANG_WARN_EMPTY_BODY = YES; 479 | CLANG_WARN_ENUM_CONVERSION = YES; 480 | CLANG_WARN_INFINITE_RECURSION = YES; 481 | CLANG_WARN_INT_CONVERSION = YES; 482 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 483 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 484 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 485 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 486 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 487 | CLANG_WARN_STRICT_PROTOTYPES = YES; 488 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 489 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 490 | CLANG_WARN_UNREACHABLE_CODE = YES; 491 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 492 | CODE_SIGN_IDENTITY = "iPhone Developer"; 493 | COPY_PHASE_STRIP = NO; 494 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 495 | ENABLE_NS_ASSERTIONS = NO; 496 | ENABLE_STRICT_OBJC_MSGSEND = YES; 497 | GCC_C_LANGUAGE_STANDARD = gnu11; 498 | GCC_NO_COMMON_BLOCKS = YES; 499 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 500 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 501 | GCC_WARN_UNDECLARED_SELECTOR = YES; 502 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 503 | GCC_WARN_UNUSED_FUNCTION = YES; 504 | GCC_WARN_UNUSED_VARIABLE = YES; 505 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 506 | MTL_ENABLE_DEBUG_INFO = NO; 507 | MTL_FAST_MATH = YES; 508 | SDKROOT = iphoneos; 509 | VALIDATE_PRODUCT = YES; 510 | }; 511 | name = Release; 512 | }; 513 | 031346792150CBE90054F1D4 /* Debug */ = { 514 | isa = XCBuildConfiguration; 515 | baseConfigurationReference = 6C48BB6929CFCF11E4A7ACDC /* Pods-GPUImageDemo.debug.xcconfig */; 516 | buildSettings = { 517 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 518 | CODE_SIGN_STYLE = Automatic; 519 | INFOPLIST_FILE = GPUImageDemo/Info.plist; 520 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 521 | LD_RUNPATH_SEARCH_PATHS = ( 522 | "$(inherited)", 523 | "@executable_path/Frameworks", 524 | ); 525 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemo; 526 | PRODUCT_NAME = "$(TARGET_NAME)"; 527 | TARGETED_DEVICE_FAMILY = "1,2"; 528 | }; 529 | name = Debug; 530 | }; 531 | 0313467A2150CBE90054F1D4 /* Release */ = { 532 | isa = XCBuildConfiguration; 533 | baseConfigurationReference = BF2AF8E931C7E466681FC0F9 /* Pods-GPUImageDemo.release.xcconfig */; 534 | buildSettings = { 535 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 536 | CODE_SIGN_STYLE = Automatic; 537 | INFOPLIST_FILE = GPUImageDemo/Info.plist; 538 | IPHONEOS_DEPLOYMENT_TARGET = 9.0; 539 | LD_RUNPATH_SEARCH_PATHS = ( 540 | "$(inherited)", 541 | "@executable_path/Frameworks", 542 | ); 543 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemo; 544 | PRODUCT_NAME = "$(TARGET_NAME)"; 545 | TARGETED_DEVICE_FAMILY = "1,2"; 546 | }; 547 | name = Release; 548 | }; 549 | 0313467C2150CBE90054F1D4 /* Debug */ = { 550 | isa = XCBuildConfiguration; 551 | buildSettings = { 552 | BUNDLE_LOADER = "$(TEST_HOST)"; 553 | CODE_SIGN_STYLE = Automatic; 554 | INFOPLIST_FILE = GPUImageDemoTests/Info.plist; 555 | LD_RUNPATH_SEARCH_PATHS = ( 556 | "$(inherited)", 557 | "@executable_path/Frameworks", 558 | "@loader_path/Frameworks", 559 | ); 560 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemoTests; 561 | PRODUCT_NAME = "$(TARGET_NAME)"; 562 | TARGETED_DEVICE_FAMILY = "1,2"; 563 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GPUImageDemo.app/GPUImageDemo"; 564 | }; 565 | name = Debug; 566 | }; 567 | 0313467D2150CBE90054F1D4 /* Release */ = { 568 | isa = XCBuildConfiguration; 569 | buildSettings = { 570 | BUNDLE_LOADER = "$(TEST_HOST)"; 571 | CODE_SIGN_STYLE = Automatic; 572 | INFOPLIST_FILE = GPUImageDemoTests/Info.plist; 573 | LD_RUNPATH_SEARCH_PATHS = ( 574 | "$(inherited)", 575 | "@executable_path/Frameworks", 576 | "@loader_path/Frameworks", 577 | ); 578 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemoTests; 579 | PRODUCT_NAME = "$(TARGET_NAME)"; 580 | TARGETED_DEVICE_FAMILY = "1,2"; 581 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GPUImageDemo.app/GPUImageDemo"; 582 | }; 583 | name = Release; 584 | }; 585 | 0313467F2150CBE90054F1D4 /* Debug */ = { 586 | isa = XCBuildConfiguration; 587 | buildSettings = { 588 | CODE_SIGN_STYLE = Automatic; 589 | INFOPLIST_FILE = GPUImageDemoUITests/Info.plist; 590 | LD_RUNPATH_SEARCH_PATHS = ( 591 | "$(inherited)", 592 | "@executable_path/Frameworks", 593 | "@loader_path/Frameworks", 594 | ); 595 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemoUITests; 596 | PRODUCT_NAME = "$(TARGET_NAME)"; 597 | TARGETED_DEVICE_FAMILY = "1,2"; 598 | TEST_TARGET_NAME = GPUImageDemo; 599 | }; 600 | name = Debug; 601 | }; 602 | 031346802150CBE90054F1D4 /* Release */ = { 603 | isa = XCBuildConfiguration; 604 | buildSettings = { 605 | CODE_SIGN_STYLE = Automatic; 606 | INFOPLIST_FILE = GPUImageDemoUITests/Info.plist; 607 | LD_RUNPATH_SEARCH_PATHS = ( 608 | "$(inherited)", 609 | "@executable_path/Frameworks", 610 | "@loader_path/Frameworks", 611 | ); 612 | PRODUCT_BUNDLE_IDENTIFIER = com.JackerooChu.www.GPUImageDemoUITests; 613 | PRODUCT_NAME = "$(TARGET_NAME)"; 614 | TARGETED_DEVICE_FAMILY = "1,2"; 615 | TEST_TARGET_NAME = GPUImageDemo; 616 | }; 617 | name = Release; 618 | }; 619 | /* End XCBuildConfiguration section */ 620 | 621 | /* Begin XCConfigurationList section */ 622 | 031346472150CBE70054F1D4 /* Build configuration list for PBXProject "GPUImageDemo" */ = { 623 | isa = XCConfigurationList; 624 | buildConfigurations = ( 625 | 031346762150CBE90054F1D4 /* Debug */, 626 | 031346772150CBE90054F1D4 /* Release */, 627 | ); 628 | defaultConfigurationIsVisible = 0; 629 | defaultConfigurationName = Release; 630 | }; 631 | 031346782150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemo" */ = { 632 | isa = XCConfigurationList; 633 | buildConfigurations = ( 634 | 031346792150CBE90054F1D4 /* Debug */, 635 | 0313467A2150CBE90054F1D4 /* Release */, 636 | ); 637 | defaultConfigurationIsVisible = 0; 638 | defaultConfigurationName = Release; 639 | }; 640 | 0313467B2150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemoTests" */ = { 641 | isa = XCConfigurationList; 642 | buildConfigurations = ( 643 | 0313467C2150CBE90054F1D4 /* Debug */, 644 | 0313467D2150CBE90054F1D4 /* Release */, 645 | ); 646 | defaultConfigurationIsVisible = 0; 647 | defaultConfigurationName = Release; 648 | }; 649 | 0313467E2150CBE90054F1D4 /* Build configuration list for PBXNativeTarget "GPUImageDemoUITests" */ = { 650 | isa = XCConfigurationList; 651 | buildConfigurations = ( 652 | 0313467F2150CBE90054F1D4 /* Debug */, 653 | 031346802150CBE90054F1D4 /* Release */, 654 | ); 655 | defaultConfigurationIsVisible = 0; 656 | defaultConfigurationName = Release; 657 | }; 658 | /* End XCConfigurationList section */ 659 | }; 660 | rootObject = 031346442150CBE70054F1D4 /* Project object */; 661 | } 662 | -------------------------------------------------------------------------------- /GPUImageDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GPUImageDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GPUImageDemo.xcodeproj/project.xcworkspace/xcuserdata/chuzhaozhi.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chuzhaozhi/GPUImageDemo/260c498e866dc82d74009386f475de173c6a49a8/GPUImageDemo.xcodeproj/project.xcworkspace/xcuserdata/chuzhaozhi.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /GPUImageDemo.xcodeproj/xcuserdata/chuzhaozhi.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | GPUImageDemo.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /GPUImageDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /GPUImageDemo.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /GPUImageDemo.xcworkspace/xcuserdata/chuzhaozhi.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chuzhaozhi/GPUImageDemo/260c498e866dc82d74009386f475de173c6a49a8/GPUImageDemo.xcworkspace/xcuserdata/chuzhaozhi.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /GPUImageDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. 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 | -------------------------------------------------------------------------------- /GPUImageDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ViewController.h" 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 20 | self.window.rootViewController =[[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init] ]; 21 | self.window.backgroundColor = [UIColor whiteColor]; 22 | [self.window makeKeyAndVisible]; 23 | // Override point for customization after application launch. 24 | return YES; 25 | } 26 | 27 | 28 | - (void)applicationWillResignActive:(UIApplication *)application { 29 | // 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. 30 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 31 | } 32 | 33 | 34 | - (void)applicationDidEnterBackground:(UIApplication *)application { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | 40 | - (void)applicationWillEnterForeground:(UIApplication *)application { 41 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 42 | } 43 | 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application { 46 | // 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. 47 | } 48 | 49 | 50 | - (void)applicationWillTerminate:(UIApplication *)application { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /GPUImageDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /GPUImageDemo/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /GPUImageDemo/Assets.xcassets/lzl.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "lzl.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /GPUImageDemo/Assets.xcassets/lzl.imageset/lzl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chuzhaozhi/GPUImageDemo/260c498e866dc82d74009386f475de173c6a49a8/GPUImageDemo/Assets.xcassets/lzl.imageset/lzl.png -------------------------------------------------------------------------------- /GPUImageDemo/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 | -------------------------------------------------------------------------------- /GPUImageDemo/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 | -------------------------------------------------------------------------------- /GPUImageDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /GPUImageDemo/ShowViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ShowViewController.h 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface ShowViewController : UIViewController 15 | @property (nonatomic,assign) NSInteger typeId; 16 | @property (nonatomic,copy) NSString *ti; 17 | @property (nonatomic,strong) GPUImageFilter *filter; 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /GPUImageDemo/ShowViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ShowViewController.m 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import "ShowViewController.h" 10 | #import 11 | #import 12 | @interface ShowViewController () 13 | 14 | @end 15 | 16 | @implementation ShowViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.title = self.ti; 21 | self.view.backgroundColor = [UIColor colorWithRed:250/255.0 green:250/255.0 blue:250/255.0 alpha:1]; 22 | UILabel *tip = [[UILabel alloc] initWithFrame:CGRectMake(50, 0, 200, 30)]; 23 | tip.text = @"渲染之后的图"; 24 | tip.textColor = [UIColor redColor]; 25 | [self.view addSubview:tip]; 26 | UIImage *inputImage =[UIImage imageNamed:@"lzl"]; 27 | //设置要渲染的区域 28 | [self.filter forceProcessingAtSize:inputImage.size]; 29 | [self.filter useNextFrameForImageCapture]; 30 | //获取数据源 31 | GPUImagePicture *stillImageSource = [[GPUImagePicture alloc]initWithImage:inputImage]; 32 | //添加上滤镜 33 | [stillImageSource addTarget:self.filter]; 34 | //开始渲染 35 | [stillImageSource processImage]; 36 | //获取渲染后的图片 37 | UIImage *newImage = [self.filter imageFromCurrentFramebuffer]; 38 | //加载出来 39 | UIImageView *imageView = [[UIImageView alloc] initWithImage:newImage]; 40 | imageView.frame = CGRectMake(50,0,250 ,250); 41 | [self.view addSubview:imageView]; 42 | UILabel *tips = [[UILabel alloc] initWithFrame:CGRectMake(50, 250, 200, 30)]; 43 | tips.text = @"原图"; 44 | tips.textColor = [UIColor redColor]; 45 | [self.view addSubview:tips]; 46 | UIImageView *oldImageView = [[UIImageView alloc] initWithImage:inputImage]; 47 | oldImageView.frame = CGRectMake(50,300,250 ,250); 48 | [self.view addSubview:oldImageView]; 49 | 50 | // Do any additional setup after loading the view. 51 | } 52 | 53 | /* 54 | #pragma mark - Navigation 55 | 56 | // In a storyboard-based application, you will often want to do a little preparation before navigation 57 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 58 | // Get the new view controller using [segue destinationViewController]. 59 | // Pass the selected object to the new view controller. 60 | } 61 | */ 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /GPUImageDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /GPUImageDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | #import 12 | #import "ShowViewController.h" 13 | @interface ViewController () 14 | @property (nonatomic,strong) UITableView *tableView; 15 | @property (nonatomic,strong) NSArray *dataSource; 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.navigationController.navigationBar.translucent = NO; 23 | self.title = @"GPUImage使用"; 24 | self.dataSource = @[@"素描",@"阀值素描,形成有噪点的素描",@"卡通效果(黑色粗线描边)",@"伸展失真,哈哈镜",@"桑原(Kuwahara)滤波,水粉画的模糊效果;处理时间比较长,慎用",@"浮雕效果,带有点3d的感觉",@"像素化",@"同心圆像素化",@"交叉线阴影,形成黑白网状画面",@"色彩丢失,模糊(类似监控摄像效果)",@"晕影,形成黑色圆形边缘,突出中间图像的效果",@"漩涡,中间形成卷曲的画面",@"水晶球效果",@"球形折射,图形倒立"]; 25 | [self initTableView]; 26 | 27 | // Do any additional setup after loading the view, typically from a nib. 28 | } 29 | 30 | -(void)initTableView{ 31 | _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) style:UITableViewStylePlain]; 32 | _tableView.dataSource = self; 33 | _tableView.delegate =self; 34 | if (@available(iOS 11.0, *)) { 35 | 36 | _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 37 | 38 | } else { 39 | 40 | self.automaticallyAdjustsScrollViewInsets = NO; 41 | 42 | } 43 | 44 | _tableView.showsVerticalScrollIndicator = NO; 45 | /// 自动关闭估算高度,不想估算那个,就设置那个即可 46 | _tableView.estimatedRowHeight = 0; 47 | _tableView.estimatedSectionHeaderHeight = 0; 48 | _tableView.estimatedSectionFooterHeight = 0; 49 | _tableView.tableFooterView =[[UIView alloc] init]; 50 | [self.view addSubview:_tableView]; 51 | } 52 | -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ 53 | return 1; 54 | } 55 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ 56 | return self.dataSource.count; 57 | } 58 | -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ 59 | static NSString *Identifier =@"UITableViewCellIdentifier"; 60 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Identifier]; 61 | if (!cell) { 62 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:Identifier]; 63 | } 64 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 65 | 66 | cell.textLabel.text = self.dataSource[indexPath.row]; 67 | return cell; 68 | } 69 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 70 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 71 | ShowViewController *showViewController = [[ShowViewController alloc] init]; 72 | showViewController.typeId = indexPath.row; 73 | showViewController.ti = self.dataSource[indexPath.row]; 74 | switch (indexPath.row) { 75 | case 0:{ 76 | showViewController.filter = [[GPUImageSketchFilter alloc] init]; //素描 77 | } 78 | break; 79 | case 1:{ 80 | showViewController.filter = [[GPUImageThresholdSketchFilter alloc] init]; //阀值素描,形成有噪点的素描 81 | } 82 | break; 83 | case 2:{ 84 | showViewController.filter = [[GPUImageToonFilter alloc] init]; //卡通效果(黑色粗线描边) 85 | } 86 | break; 87 | case 3:{ 88 | showViewController.filter = [[GPUImageStretchDistortionFilter alloc] init]; //伸展失真,哈哈镜 89 | } 90 | break; 91 | case 4:{ 92 | showViewController.filter = [[GPUImageKuwaharaFilter alloc] init]; //桑原(Kuwahara)滤波,水粉画的模糊效果;处理时间比较长,慎用 93 | } 94 | break; 95 | case 5:{ 96 | showViewController.filter = [[GPUImageEmbossFilter alloc] init]; //浮雕效果,带有点3d的感觉 97 | } 98 | break; 99 | case 6:{ 100 | showViewController.filter = [[GPUImagePixellateFilter alloc] init]; //像素化 101 | } 102 | break; 103 | case 7:{ 104 | showViewController.filter = [[GPUImagePolarPixellateFilter alloc] init]; //同心圆像素化 105 | } 106 | break; 107 | 108 | case 8:{ 109 | showViewController.filter = [[GPUImageCrosshatchFilter alloc] init]; //交叉线阴影,形成黑白网状画面 110 | } 111 | break; 112 | case 9:{ 113 | showViewController.filter = [[GPUImageColorPackingFilter alloc] init]; //色彩丢失,模糊(类似监控摄像效果) 114 | } 115 | break; 116 | case 10:{ 117 | showViewController.filter = [[GPUImageVignetteFilter alloc] init]; //晕影,形成黑色圆形边缘,突出中间图像的效果 118 | } 119 | break; 120 | case 11:{ 121 | showViewController.filter = [[GPUImageSwirlFilter alloc] init]; //漩涡,中间形成卷曲的画面 122 | } 123 | break; 124 | case 12:{ 125 | showViewController.filter = [[GPUImageGlassSphereFilter alloc] init]; //水晶球效果 126 | } 127 | break; 128 | case 13:{ 129 | showViewController.filter = [[GPUImageSphereRefractionFilter alloc] init]; //球形折射,图形倒立 130 | } 131 | break; 132 | default: 133 | break; 134 | 135 | } 136 | [self.navigationController pushViewController:showViewController animated:YES]; 137 | } 138 | @end 139 | -------------------------------------------------------------------------------- /GPUImageDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GPUImageDemo 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. 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 | -------------------------------------------------------------------------------- /GPUImageDemoTests/GPUImageDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageDemoTests.m 3 | // GPUImageDemoTests 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GPUImageDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GPUImageDemoTests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | } 20 | 21 | - (void)tearDown { 22 | // Put teardown code here. This method is called after the invocation of each test method in the class. 23 | } 24 | 25 | - (void)testExample { 26 | // This is an example of a functional test case. 27 | // Use XCTAssert and related functions to verify your tests produce the correct results. 28 | } 29 | 30 | - (void)testPerformanceExample { 31 | // This is an example of a performance test case. 32 | [self measureBlock:^{ 33 | // Put the code you want to measure the time of here. 34 | }]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /GPUImageDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /GPUImageDemoUITests/GPUImageDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageDemoUITests.m 3 | // GPUImageDemoUITests 4 | // 5 | // Created by chuzhaozhi on 2018/9/18. 6 | // Copyright © 2018年 JackerooChu. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GPUImageDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation GPUImageDemoUITests 16 | 17 | - (void)setUp { 18 | // Put setup code here. This method is called before the invocation of each test method in the class. 19 | 20 | // In UI tests it is usually best to stop immediately when a failure occurs. 21 | self.continueAfterFailure = NO; 22 | 23 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 24 | [[[XCUIApplication alloc] init] launch]; 25 | 26 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 27 | } 28 | 29 | - (void)tearDown { 30 | // Put teardown code here. This method is called after the invocation of each test method in the class. 31 | } 32 | 33 | - (void)testExample { 34 | // Use recording to get started writing UI tests. 35 | // Use XCTAssert and related functions to verify your tests produce the correct results. 36 | } 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /GPUImageDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | target 'GPUImageDemo' do 3 | pod 'GPUImage' 4 | end 5 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GPUImage (0.1.7) 3 | 4 | DEPENDENCIES: 5 | - GPUImage 6 | 7 | SPEC REPOS: 8 | https://github.com/cocoapods/specs.git: 9 | - GPUImage 10 | 11 | SPEC CHECKSUMS: 12 | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d 13 | 14 | PODFILE CHECKSUM: ac4ec0840fd362521c8ccd022aef9ba9f2317ecf 15 | 16 | COCOAPODS: 1.5.3 17 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GPUImageDemo 2 | 3 | ## 一、介绍 4 |        ` GPUImage `是一个基于` OpenGL ES 2.0 `的开源的图像处理库,作者是[Brad Larson](https://link.jianshu.com/?t=https://github.com/BradLarson)。` GPUImage `将` OpenGL ES `封装为简洁的` Objective-C `或` Swift `接口,可以用来给图像、实时相机视频、电影等添加滤镜。 5 | ## 二、使用 6 | ### 1.导入GPUImage两种方式 7 | #### a.使用 ` cocopods `导入 8 | ``` 9 | platform :ios, '9.0' 10 | target 'GPUImageDemo' do 11 | pod 'GPUImage' 12 | end 13 | ``` 14 | >注:给项目添加cocopods等操作在此不做多余赘述 15 | 16 | #### b.手动导入 17 | (1).首先下载GPUImage,[下载地址](https://github.com/BradLarson/GPUImage) 18 | (2).解压后,在framework 目录下,打开` GPUImage.xcodeproj `工程 19 | ![图片来源于网络.png](https://upload-images.jianshu.io/upload_images/4905848-7f593efff167175f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) 20 | (3).因为 GPUImage是一个开源的库 ,所以需要自己生成 静态库(以前的笨方法把整个工程加入项目,这在使用中出现了很不不必要的麻烦) 21 | (4).运行该工程(生成 用于真机和模拟器的lib) 22 | 23 | (5).点击Products下的 libGPUImage.a,右键, show in finder 将 两个lib 合并(方法,详见关于 [创建静态库的博文](https://www.jianshu.com/p/ca2f329254e8)) 24 | 25 | (6).将 GPUImage.h文件中包含的头文件全部 提取到 header文件中 26 | 27 | ### 2.使用 28 | 29 | (1).导入头文件 30 | ``` 31 | #import 32 | #import 33 | ``` 34 | (2).使用滤镜 35 | ``` 36 | 37 | UIImage *inputImage =[UIImage imageNamed:@"lzl"]; 38 | // 创建滤镜 39 | GPUImageVignetteFilter *disFilter = [[GPUImageVignetteFilter alloc] init]; 40 | //设置要渲染的区域 41 | [self.filter forceProcessingAtSize:inputImage.size]; 42 | [self.filter useNextFrameForImageCapture]; 43 | //获取数据源 44 | GPUImagePicture *stillImageSource = [[GPUImagePicture alloc]initWithImage:inputImage]; 45 | //添加上滤镜 46 | [stillImageSource addTarget:self.filter]; 47 | //开始渲染 48 | [stillImageSource processImage]; 49 | //获取渲染后的图片 50 | UIImage *newImage = [self.filter imageFromCurrentFramebuffer]; 51 | //加载出来 52 | UIImageView *imageView = [[UIImageView alloc] initWithImage:newImage]; 53 | imageView.frame = CGRectMake(50,0,250 ,250); 54 | [self.view addSubview:imageView]; 55 | ``` 56 | (3).效果 57 | ![效果图.gif](https://upload-images.jianshu.io/upload_images/4905848-b5a91c4a3cf4494f.gif?imageMogr2/auto-orient/strip) 58 | 59 | ## 三、概念解析 60 | ` output `为输出源 61 | ` intput `为输入源 62 | ` filter `为滤镜 63 | > 以下为滤镜,添加了部分注释 64 | ``` 65 | // Filters 66 | #import "GPUImageFilter.h" 67 | #import "GPUImageTwoInputFilter.h" 68 | #import "GPUImagePixellateFilter.h" //像素化 69 | #import "GPUImagePixellatePositionFilter.h" 70 | #import "GPUImageSepiaFilter.h" // 褐色(怀旧) 71 | #import "GPUImageColorInvertFilter.h" // 反色 72 | #import "GPUImageSaturationFilter.h" // 饱和度 73 | #import "GPUImageContrastFilter.h" // 对比度 74 | #import "GPUImageExposureFilter.h" // 曝光 75 | #import "GPUImageBrightnessFilter.h" // 亮度 76 | #import "GPUImageLevelsFilter.h" // 色阶 77 | #import "GPUImageSharpenFilter.h" //锐化 78 | #import "GPUImageGammaFilter.h" //gamma:要应用的灰度调整(0.0 - 3.0,默认为1.0) 79 | #import "GPUImageSobelEdgeDetectionFilter.h" //Sobel边缘检测算法(白边,黑内容,有点漫画的反色效果) 80 | #import "GPUImageSketchFilter.h" //素描 81 | #import "GPUImageToonFilter.h" //卡通效果(黑色粗线描边) 82 | #import "GPUImageSmoothToonFilter.h" //相比上面的效果更细腻,上面是粗旷的画风 83 | #import "GPUImageMultiplyBlendFilter.h" //通常用于创建阴影和深度效果 84 | #import "GPUImageDissolveBlendFilter.h" //溶解 85 | #import "GPUImageKuwaharaFilter.h" //桑原(Kuwahara)滤波,水粉画的模糊效果;处理时间比较长,慎用 86 | #import "GPUImageKuwaharaRadius3Filter.h" 87 | #import "GPUImageVignetteFilter.h" //晕影,形成黑色圆形边缘,突出中间图像的效果 88 | #import "GPUImageGaussianBlurFilter.h" //高斯模糊 89 | #import "GPUImageGaussianBlurPositionFilter.h" 90 | #import "GPUImageGaussianSelectiveBlurFilter.h" //高斯模糊,选择部分清晰 91 | #import "GPUImageOverlayBlendFilter.h" //叠加,通常用于创建阴影效果 92 | #import "GPUImageDarkenBlendFilter.h" //加深混合,通常用于重叠类型 93 | #import "GPUImageLightenBlendFilter.h" //减淡混合,通常用于重叠类型 94 | #import "GPUImageSwirlFilter.h" //漩涡,中间形成卷曲的画面 95 | #import "GPUImageSourceOverBlendFilter.h" //源混合 96 | #import "GPUImageColorBurnBlendFilter.h" //色彩加深混合 97 | #import "GPUImageColorDodgeBlendFilter.h" //色彩减淡混合 98 | #import "GPUImageScreenBlendFilter.h" //屏幕包裹,通常用于创建亮点和镜头眩光 99 | #import "GPUImageExclusionBlendFilter.h" //排除混合 100 | #import "GPUImageDifferenceBlendFilter.h" //差异混合,通常用于创建更多变动的颜色 101 | #import "GPUImageSubtractBlendFilter.h" //差值混合,通常用于创建两个图像之间的动画变暗模糊效果 102 | #import "GPUImageHardLightBlendFilter.h" //强光混合,通常用于创建阴影效果 103 | #import "GPUImageSoftLightBlendFilter.h" //柔光混合 104 | #import "GPUImageColorBlendFilter.h" 105 | #import "GPUImageHueBlendFilter.h" 106 | #import "GPUImageSaturationBlendFilter.h" 107 | #import "GPUImageLuminosityBlendFilter.h" 108 | #import "GPUImageCropFilter.h" //剪裁 109 | #import "GPUImageGrayscaleFilter.h" // 灰度 110 | #import "GPUImageTransformFilter.h" //形状变化 111 | #import "GPUImageChromaKeyBlendFilter.h" //色度键混合 112 | #import "GPUImageHazeFilter.h" //朦胧加暗 113 | #import "GPUImageLuminanceThresholdFilter.h" //亮度阈 114 | #import "GPUImagePosterizeFilter.h" //色调分离,形成噪点效果 115 | #import "GPUImageBoxBlurFilter.h" //盒状模糊 116 | #import "GPUImageAdaptiveThresholdFilter.h" //自适应阈值 117 | #import "GPUImageUnsharpMaskFilter.h" 118 | #import "GPUImageBulgeDistortionFilter.h" //凸起失真,鱼眼效果 119 | #import "GPUImagePinchDistortionFilter.h" //收缩失真,凹面镜 120 | #import "GPUImageCrosshatchFilter.h" //交叉线阴影,形成黑白网状画面 121 | #import "GPUImageCGAColorspaceFilter.h" //CGA色彩滤镜,形成黑、浅蓝、紫色块的画面 122 | #import "GPUImagePolarPixellateFilter.h" //同心圆像素化 123 | #import "GPUImageStretchDistortionFilter.h" //伸展失真,哈哈镜 124 | #import "GPUImagePerlinNoiseFilter.h" //柏林噪点,花边噪点 125 | #import "GPUImageJFAVoronoiFilter.h" 126 | #import "GPUImageVoronoiConsumerFilter.h" 127 | #import "GPUImageMosaicFilter.h" //黑白马赛克 128 | #import "GPUImageTiltShiftFilter.h" //条纹模糊,中间清晰,上下两端模糊 129 | #import "GPUImage3x3ConvolutionFilter.h" //3x3卷积,高亮大色块变黑,加亮边缘、线条等 130 | #import "GPUImageEmbossFilter.h" //浮雕效果,带有点3d的感觉 131 | #import "GPUImageCannyEdgeDetectionFilter.h" //Canny边缘检测算法 132 | #import "GPUImageThresholdEdgeDetectionFilter.h" //阈值边缘检测(效果与上差别不大) 133 | #import "GPUImageMaskFilter.h" //遮罩混合 134 | #import "GPUImageHistogramFilter.h" // 色彩直方图,显示在图片上 135 | #import "GPUImageHistogramGenerator.h" // 色彩直方图 136 | #import "GPUImageHistogramEqualizationFilter.h" 137 | #import "GPUImagePrewittEdgeDetectionFilter.h" //普瑞维特(Prewitt)边缘检测(效果与Sobel差不多,貌似更平滑) 138 | #import "GPUImageXYDerivativeFilter.h" //XYDerivative边缘检测,画面以蓝色为主,绿色为边缘,带彩色 139 | #import "GPUImageHarrisCornerDetectionFilter.h" //Harris角点检测,会有绿色小十字显示在图片角点处 140 | #import "GPUImageAlphaBlendFilter.h" //透明混合,通常用于在背景上应用前景的透明度 141 | #import "GPUImageNormalBlendFilter.h" //正常 142 | #import "GPUImageNonMaximumSuppressionFilter.h" //非最大抑制,只显示亮度最高的像素,其他为黑 143 | #import "GPUImageRGBFilter.h" // RGB 144 | #import "GPUImageMedianFilter.h" //中间值,有种稍微模糊边缘的效果 145 | #import "GPUImageBilateralFilter.h" //双边模糊 146 | #import "GPUImageCrosshairGenerator.h" //十字 147 | #import "GPUImageToneCurveFilter.h" // 色调曲线 148 | #import "GPUImageNobleCornerDetectionFilter.h" //Noble角点检测,检测点更多 149 | #import "GPUImageShiTomasiFeatureDetectionFilter.h" //ShiTomasi角点检测,与上差别不大 150 | #import "GPUImageErosionFilter.h" //侵蚀边缘模糊,变黑白 151 | #import "GPUImageRGBErosionFilter.h" //RGB侵蚀边缘模糊,有色彩 152 | #import "GPUImageDilationFilter.h" //扩展边缘模糊,变黑白 153 | #import "GPUImageRGBDilationFilter.h" //RGB扩展边缘模糊,有色彩 154 | #import "GPUImageOpeningFilter.h" //黑白色调模糊 155 | #import "GPUImageRGBOpeningFilter.h" //RGB扩展边缘模糊,有色彩 156 | #import "GPUImageClosingFilter.h" //黑白色调模糊,暗色会被提亮 157 | #import "GPUImageRGBClosingFilter.h" //彩色模糊,暗色会被提亮 158 | #import "GPUImageColorPackingFilter.h" //色彩丢失,模糊(类似监控摄像效果) 159 | #import "GPUImageSphereRefractionFilter.h" //球形折射,图形倒立 160 | #import "GPUImageMonochromeFilter.h" // 单色 161 | #import "GPUImageOpacityFilter.h" // 不透明度 162 | #import "GPUImageHighlightShadowFilter.h" // 提亮阴影 163 | #import "GPUImageFalseColorFilter.h" // 色彩替换(替换亮部和暗部色彩) 164 | #import "GPUImageHSBFilter.h" 165 | #import "GPUImageHueFilter.h" //色度 166 | #import "GPUImageGlassSphereFilter.h" //水晶球效果 167 | #import "GPUImageLookupFilter.h" //lookup 色彩调整 168 | #import "GPUImageAmatorkaFilter.h" //Amatorka lookup 169 | #import "GPUImageMissEtikateFilter.h" //MissEtikate lookup 170 | #import "GPUImageSoftEleganceFilter.h" //SoftElegance lookup 171 | #import "GPUImageAddBlendFilter.h" //通常用于创建两个图像之间的动画变亮模糊效果 172 | #import "GPUImageDivideBlendFilter.h" //通常用于创建两个图像之间的动画变暗模糊效果 173 | #import "GPUImagePolkaDotFilter.h" //像素圆点花样 174 | #import "GPUImageLocalBinaryPatternFilter.h" //图像黑白化,并有大量噪点 175 | #import "GPUImageLanczosResamplingFilter.h" //Lanczos重取样,模糊效果 176 | #import "GPUImageAverageColor.h" //像素平均色值 177 | #import "GPUImageSolidColorGenerator.h" //纯色 178 | #import "GPUImageLuminosity.h" //亮度平均 179 | #import "GPUImageAverageLuminanceThresholdFilter.h" //像素色值亮度平均,图像黑白(有类似漫画效果) 180 | #import "GPUImageWhiteBalanceFilter.h" //白平横 181 | #import "GPUImageChromaKeyFilter.h" //色度键 182 | #import "GPUImageLowPassFilter.h" //用于图像加亮 183 | #import "GPUImageHighPassFilter.h" //图像低于某值时显示为黑 184 | #import "GPUImageMotionDetector.h" //动作检测 185 | #import "GPUImageHalftoneFilter.h" //点染,图像黑白化,由黑点构成原图的大致图形 186 | #import "GPUImageThresholdedNonMaximumSuppressionFilter.h" //非最大抑制,只显示亮度最高的像素,其他为黑,像素丢失更多 187 | #import "GPUImageHoughTransformLineDetector.h" //线条检测 188 | #import "GPUImageParallelCoordinateLineTransformFilter.h" //平行线检测 189 | #import "GPUImageThresholdSketchFilter.h" //阀值素描,形成有噪点的素描 190 | #import "GPUImageLineGenerator.h" // 线条 191 | #import "GPUImageLinearBurnBlendFilter.h" 192 | #import "GPUImageGaussianBlurPositionFilter.h" 193 | #import "GPUImagePixellatePositionFilter.h" 194 | #import "GPUImageTwoInputCrossTextureSamplingFilter.h" 195 | #import "GPUImagePoissonBlendFilter.h" 196 | #import "GPUImageMotionBlurFilter.h" 197 | #import "GPUImageZoomBlurFilter.h" 198 | #import "GPUImageLaplacianFilter.h" 199 | #import "GPUImageiOSBlurFilter.h" 200 | #import "GPUImageLuminanceRangeFilter.h" 201 | #import "GPUImageDirectionalNonMaximumSuppressionFilter.h" 202 | #import "GPUImageDirectionalSobelEdgeDetectionFilter.h" 203 | #import "GPUImageSingleComponentGaussianBlurFilter.h" 204 | #import "GPUImageThreeInputFilter.h" 205 | #import "GPUImageWeakPixelInclusionFilter.h" 206 | ``` 207 | > 下载之后进行pod install操作即可运行 208 | > 本文同步至[个人博客](http://chuzhaozhi.cn/)、[简书](https://www.jianshu.com/p/c5c5f806473c)、[掘金](https://juejin.im/post/5ba1b375f265da0ae343eb78) 209 | -------------------------------------------------------------------------------- /效果图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/chuzhaozhi/GPUImageDemo/260c498e866dc82d74009386f475de173c6a49a8/效果图.gif --------------------------------------------------------------------------------