├── .gitignore ├── .travis.yml ├── Example ├── GPUImageBeautifyFilter.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── xcshareddata │ │ └── xcschemes │ │ └── GPUImageBeautifyFilter-Example.xcscheme ├── GPUImageBeautifyFilter.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── GPUImageBeautifyFilter │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── GPUAppDelegate.h │ ├── GPUAppDelegate.m │ ├── GPUImageBeautifyFilter-Info.plist │ ├── GPUImageBeautifyFilter-Prefix.pch │ ├── GPUViewController.h │ ├── GPUViewController.m │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m ├── Podfile ├── Podfile.lock └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── GPUImageBeautifyFilter.podspec ├── GPUImageBeautifyFilter ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── GPUImageBeautifyFilter.h │ ├── GPUImageBeautifyFilter.m │ ├── GPUImageBeautyFilter.h │ └── GPUImageBeautyFilter.m ├── LICENSE ├── README.md └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | # Pods/ 38 | Example/Pods/ -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/GPUImageBeautifyFilter.xcworkspace -scheme GPUImageBeautifyFilter-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 11 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 12 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 13 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 14 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 15 | 6003F59E195388D20070C39A /* GPUAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* GPUAppDelegate.m */; }; 16 | 6003F5A7195388D20070C39A /* GPUViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* GPUViewController.m */; }; 17 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 18 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 19 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 20 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 21 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 22 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 23 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 24 | 77152BD15043A80A82EE72AD /* Pods_GPUImageBeautifyFilter_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2732797898887E7BCF9CBB2A /* Pods_GPUImageBeautifyFilter_Tests.framework */; }; 25 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 26 | CF1A9C4C13FD092B76105025 /* Pods_GPUImageBeautifyFilter_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F770E0EFB618F9340D8191C /* Pods_GPUImageBeautifyFilter_Example.framework */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = 6003F582195388D10070C39A /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = 6003F589195388D20070C39A; 35 | remoteInfo = GPUImageBeautifyFilter; 36 | }; 37 | /* End PBXContainerItemProxy section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 0F770E0EFB618F9340D8191C /* Pods_GPUImageBeautifyFilter_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GPUImageBeautifyFilter_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 41 | 2732797898887E7BCF9CBB2A /* Pods_GPUImageBeautifyFilter_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_GPUImageBeautifyFilter_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 4B8A4790D122519BD0C32542 /* Pods-GPUImageBeautifyFilter_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageBeautifyFilter_Tests.release.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Tests/Pods-GPUImageBeautifyFilter_Tests.release.xcconfig"; sourceTree = ""; }; 43 | 6003F58A195388D20070C39A /* GPUImageBeautifyFilter_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GPUImageBeautifyFilter_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 45 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 46 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 47 | 6003F595195388D20070C39A /* GPUImageBeautifyFilter-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GPUImageBeautifyFilter-Info.plist"; sourceTree = ""; }; 48 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 49 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 50 | 6003F59B195388D20070C39A /* GPUImageBeautifyFilter-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GPUImageBeautifyFilter-Prefix.pch"; sourceTree = ""; }; 51 | 6003F59C195388D20070C39A /* GPUAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUAppDelegate.h; sourceTree = ""; }; 52 | 6003F59D195388D20070C39A /* GPUAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPUAppDelegate.m; sourceTree = ""; }; 53 | 6003F5A5195388D20070C39A /* GPUViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GPUViewController.h; sourceTree = ""; }; 54 | 6003F5A6195388D20070C39A /* GPUViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GPUViewController.m; sourceTree = ""; }; 55 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 56 | 6003F5AE195388D20070C39A /* GPUImageBeautifyFilter_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GPUImageBeautifyFilter_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 57 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 58 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 59 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 60 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 61 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 62 | 6FD2D844C52D4E77231645FD /* Pods-GPUImageBeautifyFilter_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageBeautifyFilter_Example.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Example/Pods-GPUImageBeautifyFilter_Example.debug.xcconfig"; sourceTree = ""; }; 63 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 64 | 8284883431E4B7E029C5168F /* GPUImageBeautifyFilter.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = GPUImageBeautifyFilter.podspec; path = ../GPUImageBeautifyFilter.podspec; sourceTree = ""; }; 65 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 66 | A3891D175EA4AD8BC7B2E390 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 67 | B3FD083DE0DC447E40FB78DF /* Pods-GPUImageBeautifyFilter_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageBeautifyFilter_Example.release.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Example/Pods-GPUImageBeautifyFilter_Example.release.xcconfig"; sourceTree = ""; }; 68 | D611629E3A0729B21BFA5E99 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 69 | ECA91ACCE48159F46E42AA27 /* Pods-GPUImageBeautifyFilter_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImageBeautifyFilter_Tests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Tests/Pods-GPUImageBeautifyFilter_Tests.debug.xcconfig"; sourceTree = ""; }; 70 | /* End PBXFileReference section */ 71 | 72 | /* Begin PBXFrameworksBuildPhase section */ 73 | 6003F587195388D20070C39A /* Frameworks */ = { 74 | isa = PBXFrameworksBuildPhase; 75 | buildActionMask = 2147483647; 76 | files = ( 77 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 78 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 79 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 80 | CF1A9C4C13FD092B76105025 /* Pods_GPUImageBeautifyFilter_Example.framework in Frameworks */, 81 | ); 82 | runOnlyForDeploymentPostprocessing = 0; 83 | }; 84 | 6003F5AB195388D20070C39A /* Frameworks */ = { 85 | isa = PBXFrameworksBuildPhase; 86 | buildActionMask = 2147483647; 87 | files = ( 88 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 89 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 90 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 91 | 77152BD15043A80A82EE72AD /* Pods_GPUImageBeautifyFilter_Tests.framework in Frameworks */, 92 | ); 93 | runOnlyForDeploymentPostprocessing = 0; 94 | }; 95 | /* End PBXFrameworksBuildPhase section */ 96 | 97 | /* Begin PBXGroup section */ 98 | 6003F581195388D10070C39A = { 99 | isa = PBXGroup; 100 | children = ( 101 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 102 | 6003F593195388D20070C39A /* Example for GPUImageBeautifyFilter */, 103 | 6003F5B5195388D20070C39A /* Tests */, 104 | 6003F58C195388D20070C39A /* Frameworks */, 105 | 6003F58B195388D20070C39A /* Products */, 106 | FACCF9AF73E7DC72E73590B6 /* Pods */, 107 | ); 108 | sourceTree = ""; 109 | }; 110 | 6003F58B195388D20070C39A /* Products */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | 6003F58A195388D20070C39A /* GPUImageBeautifyFilter_Example.app */, 114 | 6003F5AE195388D20070C39A /* GPUImageBeautifyFilter_Tests.xctest */, 115 | ); 116 | name = Products; 117 | sourceTree = ""; 118 | }; 119 | 6003F58C195388D20070C39A /* Frameworks */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 6003F58D195388D20070C39A /* Foundation.framework */, 123 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 124 | 6003F591195388D20070C39A /* UIKit.framework */, 125 | 6003F5AF195388D20070C39A /* XCTest.framework */, 126 | 0F770E0EFB618F9340D8191C /* Pods_GPUImageBeautifyFilter_Example.framework */, 127 | 2732797898887E7BCF9CBB2A /* Pods_GPUImageBeautifyFilter_Tests.framework */, 128 | ); 129 | name = Frameworks; 130 | sourceTree = ""; 131 | }; 132 | 6003F593195388D20070C39A /* Example for GPUImageBeautifyFilter */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | 6003F59C195388D20070C39A /* GPUAppDelegate.h */, 136 | 6003F59D195388D20070C39A /* GPUAppDelegate.m */, 137 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 138 | 6003F5A5195388D20070C39A /* GPUViewController.h */, 139 | 6003F5A6195388D20070C39A /* GPUViewController.m */, 140 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 141 | 6003F5A8195388D20070C39A /* Images.xcassets */, 142 | 6003F594195388D20070C39A /* Supporting Files */, 143 | ); 144 | name = "Example for GPUImageBeautifyFilter"; 145 | path = GPUImageBeautifyFilter; 146 | sourceTree = ""; 147 | }; 148 | 6003F594195388D20070C39A /* Supporting Files */ = { 149 | isa = PBXGroup; 150 | children = ( 151 | 6003F595195388D20070C39A /* GPUImageBeautifyFilter-Info.plist */, 152 | 6003F596195388D20070C39A /* InfoPlist.strings */, 153 | 6003F599195388D20070C39A /* main.m */, 154 | 6003F59B195388D20070C39A /* GPUImageBeautifyFilter-Prefix.pch */, 155 | ); 156 | name = "Supporting Files"; 157 | sourceTree = ""; 158 | }; 159 | 6003F5B5195388D20070C39A /* Tests */ = { 160 | isa = PBXGroup; 161 | children = ( 162 | 6003F5BB195388D20070C39A /* Tests.m */, 163 | 6003F5B6195388D20070C39A /* Supporting Files */, 164 | ); 165 | path = Tests; 166 | sourceTree = ""; 167 | }; 168 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 172 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 173 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 174 | ); 175 | name = "Supporting Files"; 176 | sourceTree = ""; 177 | }; 178 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 179 | isa = PBXGroup; 180 | children = ( 181 | 8284883431E4B7E029C5168F /* GPUImageBeautifyFilter.podspec */, 182 | A3891D175EA4AD8BC7B2E390 /* README.md */, 183 | D611629E3A0729B21BFA5E99 /* LICENSE */, 184 | ); 185 | name = "Podspec Metadata"; 186 | sourceTree = ""; 187 | }; 188 | FACCF9AF73E7DC72E73590B6 /* Pods */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | 6FD2D844C52D4E77231645FD /* Pods-GPUImageBeautifyFilter_Example.debug.xcconfig */, 192 | B3FD083DE0DC447E40FB78DF /* Pods-GPUImageBeautifyFilter_Example.release.xcconfig */, 193 | ECA91ACCE48159F46E42AA27 /* Pods-GPUImageBeautifyFilter_Tests.debug.xcconfig */, 194 | 4B8A4790D122519BD0C32542 /* Pods-GPUImageBeautifyFilter_Tests.release.xcconfig */, 195 | ); 196 | name = Pods; 197 | sourceTree = ""; 198 | }; 199 | /* End PBXGroup section */ 200 | 201 | /* Begin PBXNativeTarget section */ 202 | 6003F589195388D20070C39A /* GPUImageBeautifyFilter_Example */ = { 203 | isa = PBXNativeTarget; 204 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "GPUImageBeautifyFilter_Example" */; 205 | buildPhases = ( 206 | E5FC8BF180A7E900DFE3C466 /* [CP] Check Pods Manifest.lock */, 207 | 6003F586195388D20070C39A /* Sources */, 208 | 6003F587195388D20070C39A /* Frameworks */, 209 | 6003F588195388D20070C39A /* Resources */, 210 | 5AC895FF83D3F6ABA10AE6C3 /* [CP] Embed Pods Frameworks */, 211 | ); 212 | buildRules = ( 213 | ); 214 | dependencies = ( 215 | ); 216 | name = GPUImageBeautifyFilter_Example; 217 | productName = GPUImageBeautifyFilter; 218 | productReference = 6003F58A195388D20070C39A /* GPUImageBeautifyFilter_Example.app */; 219 | productType = "com.apple.product-type.application"; 220 | }; 221 | 6003F5AD195388D20070C39A /* GPUImageBeautifyFilter_Tests */ = { 222 | isa = PBXNativeTarget; 223 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "GPUImageBeautifyFilter_Tests" */; 224 | buildPhases = ( 225 | AB08AC724DB74BA9AA0418BA /* [CP] Check Pods Manifest.lock */, 226 | 6003F5AA195388D20070C39A /* Sources */, 227 | 6003F5AB195388D20070C39A /* Frameworks */, 228 | 6003F5AC195388D20070C39A /* Resources */, 229 | ); 230 | buildRules = ( 231 | ); 232 | dependencies = ( 233 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 234 | ); 235 | name = GPUImageBeautifyFilter_Tests; 236 | productName = GPUImageBeautifyFilterTests; 237 | productReference = 6003F5AE195388D20070C39A /* GPUImageBeautifyFilter_Tests.xctest */; 238 | productType = "com.apple.product-type.bundle.unit-test"; 239 | }; 240 | /* End PBXNativeTarget section */ 241 | 242 | /* Begin PBXProject section */ 243 | 6003F582195388D10070C39A /* Project object */ = { 244 | isa = PBXProject; 245 | attributes = { 246 | CLASSPREFIX = GPU; 247 | LastUpgradeCheck = 0720; 248 | ORGANIZATIONNAME = "claudeli@yeah.net"; 249 | TargetAttributes = { 250 | 6003F589195388D20070C39A = { 251 | DevelopmentTeam = H7TE95ETHE; 252 | }; 253 | 6003F5AD195388D20070C39A = { 254 | TestTargetID = 6003F589195388D20070C39A; 255 | }; 256 | }; 257 | }; 258 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "GPUImageBeautifyFilter" */; 259 | compatibilityVersion = "Xcode 3.2"; 260 | developmentRegion = English; 261 | hasScannedForEncodings = 0; 262 | knownRegions = ( 263 | en, 264 | Base, 265 | ); 266 | mainGroup = 6003F581195388D10070C39A; 267 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 268 | projectDirPath = ""; 269 | projectRoot = ""; 270 | targets = ( 271 | 6003F589195388D20070C39A /* GPUImageBeautifyFilter_Example */, 272 | 6003F5AD195388D20070C39A /* GPUImageBeautifyFilter_Tests */, 273 | ); 274 | }; 275 | /* End PBXProject section */ 276 | 277 | /* Begin PBXResourcesBuildPhase section */ 278 | 6003F588195388D20070C39A /* Resources */ = { 279 | isa = PBXResourcesBuildPhase; 280 | buildActionMask = 2147483647; 281 | files = ( 282 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 283 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 284 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 285 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 286 | ); 287 | runOnlyForDeploymentPostprocessing = 0; 288 | }; 289 | 6003F5AC195388D20070C39A /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 294 | ); 295 | runOnlyForDeploymentPostprocessing = 0; 296 | }; 297 | /* End PBXResourcesBuildPhase section */ 298 | 299 | /* Begin PBXShellScriptBuildPhase section */ 300 | 5AC895FF83D3F6ABA10AE6C3 /* [CP] Embed Pods Frameworks */ = { 301 | isa = PBXShellScriptBuildPhase; 302 | buildActionMask = 2147483647; 303 | files = ( 304 | ); 305 | inputPaths = ( 306 | "${SRCROOT}/Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Example/Pods-GPUImageBeautifyFilter_Example-frameworks.sh", 307 | "${BUILT_PRODUCTS_DIR}/GPUImage/GPUImage.framework", 308 | "${BUILT_PRODUCTS_DIR}/GPUImageBeautifyFilter/GPUImageBeautifyFilter.framework", 309 | ); 310 | name = "[CP] Embed Pods Frameworks"; 311 | outputPaths = ( 312 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GPUImage.framework", 313 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/GPUImageBeautifyFilter.framework", 314 | ); 315 | runOnlyForDeploymentPostprocessing = 0; 316 | shellPath = /bin/sh; 317 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImageBeautifyFilter_Example/Pods-GPUImageBeautifyFilter_Example-frameworks.sh\"\n"; 318 | showEnvVarsInLog = 0; 319 | }; 320 | AB08AC724DB74BA9AA0418BA /* [CP] Check Pods Manifest.lock */ = { 321 | isa = PBXShellScriptBuildPhase; 322 | buildActionMask = 2147483647; 323 | files = ( 324 | ); 325 | inputPaths = ( 326 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 327 | "${PODS_ROOT}/Manifest.lock", 328 | ); 329 | name = "[CP] Check Pods Manifest.lock"; 330 | outputPaths = ( 331 | "$(DERIVED_FILE_DIR)/Pods-GPUImageBeautifyFilter_Tests-checkManifestLockResult.txt", 332 | ); 333 | runOnlyForDeploymentPostprocessing = 0; 334 | shellPath = /bin/sh; 335 | 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"; 336 | showEnvVarsInLog = 0; 337 | }; 338 | E5FC8BF180A7E900DFE3C466 /* [CP] Check Pods Manifest.lock */ = { 339 | isa = PBXShellScriptBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | ); 343 | inputPaths = ( 344 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 345 | "${PODS_ROOT}/Manifest.lock", 346 | ); 347 | name = "[CP] Check Pods Manifest.lock"; 348 | outputPaths = ( 349 | "$(DERIVED_FILE_DIR)/Pods-GPUImageBeautifyFilter_Example-checkManifestLockResult.txt", 350 | ); 351 | runOnlyForDeploymentPostprocessing = 0; 352 | shellPath = /bin/sh; 353 | 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"; 354 | showEnvVarsInLog = 0; 355 | }; 356 | /* End PBXShellScriptBuildPhase section */ 357 | 358 | /* Begin PBXSourcesBuildPhase section */ 359 | 6003F586195388D20070C39A /* Sources */ = { 360 | isa = PBXSourcesBuildPhase; 361 | buildActionMask = 2147483647; 362 | files = ( 363 | 6003F59E195388D20070C39A /* GPUAppDelegate.m in Sources */, 364 | 6003F5A7195388D20070C39A /* GPUViewController.m in Sources */, 365 | 6003F59A195388D20070C39A /* main.m in Sources */, 366 | ); 367 | runOnlyForDeploymentPostprocessing = 0; 368 | }; 369 | 6003F5AA195388D20070C39A /* Sources */ = { 370 | isa = PBXSourcesBuildPhase; 371 | buildActionMask = 2147483647; 372 | files = ( 373 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 374 | ); 375 | runOnlyForDeploymentPostprocessing = 0; 376 | }; 377 | /* End PBXSourcesBuildPhase section */ 378 | 379 | /* Begin PBXTargetDependency section */ 380 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 381 | isa = PBXTargetDependency; 382 | target = 6003F589195388D20070C39A /* GPUImageBeautifyFilter_Example */; 383 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 384 | }; 385 | /* End PBXTargetDependency section */ 386 | 387 | /* Begin PBXVariantGroup section */ 388 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 389 | isa = PBXVariantGroup; 390 | children = ( 391 | 6003F597195388D20070C39A /* en */, 392 | ); 393 | name = InfoPlist.strings; 394 | sourceTree = ""; 395 | }; 396 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 397 | isa = PBXVariantGroup; 398 | children = ( 399 | 6003F5B9195388D20070C39A /* en */, 400 | ); 401 | name = InfoPlist.strings; 402 | sourceTree = ""; 403 | }; 404 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 405 | isa = PBXVariantGroup; 406 | children = ( 407 | 71719F9E1E33DC2100824A3D /* Base */, 408 | ); 409 | name = LaunchScreen.storyboard; 410 | sourceTree = ""; 411 | }; 412 | /* End PBXVariantGroup section */ 413 | 414 | /* Begin XCBuildConfiguration section */ 415 | 6003F5BD195388D20070C39A /* Debug */ = { 416 | isa = XCBuildConfiguration; 417 | buildSettings = { 418 | ALWAYS_SEARCH_USER_PATHS = NO; 419 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 420 | CLANG_CXX_LIBRARY = "libc++"; 421 | CLANG_ENABLE_MODULES = YES; 422 | CLANG_ENABLE_OBJC_ARC = YES; 423 | CLANG_WARN_BOOL_CONVERSION = YES; 424 | CLANG_WARN_CONSTANT_CONVERSION = YES; 425 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 426 | CLANG_WARN_EMPTY_BODY = YES; 427 | CLANG_WARN_ENUM_CONVERSION = YES; 428 | CLANG_WARN_INT_CONVERSION = YES; 429 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 430 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 431 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 432 | COPY_PHASE_STRIP = NO; 433 | ENABLE_TESTABILITY = YES; 434 | GCC_C_LANGUAGE_STANDARD = gnu99; 435 | GCC_DYNAMIC_NO_PIC = NO; 436 | GCC_OPTIMIZATION_LEVEL = 0; 437 | GCC_PREPROCESSOR_DEFINITIONS = ( 438 | "DEBUG=1", 439 | "$(inherited)", 440 | ); 441 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 442 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 443 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 444 | GCC_WARN_UNDECLARED_SELECTOR = YES; 445 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 446 | GCC_WARN_UNUSED_FUNCTION = YES; 447 | GCC_WARN_UNUSED_VARIABLE = YES; 448 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 449 | ONLY_ACTIVE_ARCH = YES; 450 | SDKROOT = iphoneos; 451 | TARGETED_DEVICE_FAMILY = "1,2"; 452 | }; 453 | name = Debug; 454 | }; 455 | 6003F5BE195388D20070C39A /* Release */ = { 456 | isa = XCBuildConfiguration; 457 | buildSettings = { 458 | ALWAYS_SEARCH_USER_PATHS = NO; 459 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 460 | CLANG_CXX_LIBRARY = "libc++"; 461 | CLANG_ENABLE_MODULES = YES; 462 | CLANG_ENABLE_OBJC_ARC = YES; 463 | CLANG_WARN_BOOL_CONVERSION = YES; 464 | CLANG_WARN_CONSTANT_CONVERSION = YES; 465 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 466 | CLANG_WARN_EMPTY_BODY = YES; 467 | CLANG_WARN_ENUM_CONVERSION = YES; 468 | CLANG_WARN_INT_CONVERSION = YES; 469 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 470 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 471 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 472 | COPY_PHASE_STRIP = YES; 473 | ENABLE_NS_ASSERTIONS = NO; 474 | GCC_C_LANGUAGE_STANDARD = gnu99; 475 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 476 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 477 | GCC_WARN_UNDECLARED_SELECTOR = YES; 478 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 479 | GCC_WARN_UNUSED_FUNCTION = YES; 480 | GCC_WARN_UNUSED_VARIABLE = YES; 481 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 482 | SDKROOT = iphoneos; 483 | TARGETED_DEVICE_FAMILY = "1,2"; 484 | VALIDATE_PRODUCT = YES; 485 | }; 486 | name = Release; 487 | }; 488 | 6003F5C0195388D20070C39A /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | baseConfigurationReference = 6FD2D844C52D4E77231645FD /* Pods-GPUImageBeautifyFilter_Example.debug.xcconfig */; 491 | buildSettings = { 492 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 493 | DEVELOPMENT_TEAM = H7TE95ETHE; 494 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 495 | GCC_PREFIX_HEADER = "GPUImageBeautifyFilter/GPUImageBeautifyFilter-Prefix.pch"; 496 | INFOPLIST_FILE = "GPUImageBeautifyFilter/GPUImageBeautifyFilter-Info.plist"; 497 | MODULE_NAME = ExampleApp; 498 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 499 | PRODUCT_NAME = "$(TARGET_NAME)"; 500 | WRAPPER_EXTENSION = app; 501 | }; 502 | name = Debug; 503 | }; 504 | 6003F5C1195388D20070C39A /* Release */ = { 505 | isa = XCBuildConfiguration; 506 | baseConfigurationReference = B3FD083DE0DC447E40FB78DF /* Pods-GPUImageBeautifyFilter_Example.release.xcconfig */; 507 | buildSettings = { 508 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 509 | DEVELOPMENT_TEAM = H7TE95ETHE; 510 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 511 | GCC_PREFIX_HEADER = "GPUImageBeautifyFilter/GPUImageBeautifyFilter-Prefix.pch"; 512 | INFOPLIST_FILE = "GPUImageBeautifyFilter/GPUImageBeautifyFilter-Info.plist"; 513 | MODULE_NAME = ExampleApp; 514 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 515 | PRODUCT_NAME = "$(TARGET_NAME)"; 516 | WRAPPER_EXTENSION = app; 517 | }; 518 | name = Release; 519 | }; 520 | 6003F5C3195388D20070C39A /* Debug */ = { 521 | isa = XCBuildConfiguration; 522 | baseConfigurationReference = ECA91ACCE48159F46E42AA27 /* Pods-GPUImageBeautifyFilter_Tests.debug.xcconfig */; 523 | buildSettings = { 524 | BUNDLE_LOADER = "$(TEST_HOST)"; 525 | FRAMEWORK_SEARCH_PATHS = ( 526 | "$(SDKROOT)/Developer/Library/Frameworks", 527 | "$(inherited)", 528 | "$(DEVELOPER_FRAMEWORKS_DIR)", 529 | ); 530 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 531 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 532 | GCC_PREPROCESSOR_DEFINITIONS = ( 533 | "DEBUG=1", 534 | "$(inherited)", 535 | ); 536 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 537 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 538 | PRODUCT_NAME = "$(TARGET_NAME)"; 539 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GPUImageBeautifyFilter_Example.app/GPUImageBeautifyFilter_Example"; 540 | WRAPPER_EXTENSION = xctest; 541 | }; 542 | name = Debug; 543 | }; 544 | 6003F5C4195388D20070C39A /* Release */ = { 545 | isa = XCBuildConfiguration; 546 | baseConfigurationReference = 4B8A4790D122519BD0C32542 /* Pods-GPUImageBeautifyFilter_Tests.release.xcconfig */; 547 | buildSettings = { 548 | BUNDLE_LOADER = "$(TEST_HOST)"; 549 | FRAMEWORK_SEARCH_PATHS = ( 550 | "$(SDKROOT)/Developer/Library/Frameworks", 551 | "$(inherited)", 552 | "$(DEVELOPER_FRAMEWORKS_DIR)", 553 | ); 554 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 555 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 556 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 557 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 558 | PRODUCT_NAME = "$(TARGET_NAME)"; 559 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/GPUImageBeautifyFilter_Example.app/GPUImageBeautifyFilter_Example"; 560 | WRAPPER_EXTENSION = xctest; 561 | }; 562 | name = Release; 563 | }; 564 | /* End XCBuildConfiguration section */ 565 | 566 | /* Begin XCConfigurationList section */ 567 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "GPUImageBeautifyFilter" */ = { 568 | isa = XCConfigurationList; 569 | buildConfigurations = ( 570 | 6003F5BD195388D20070C39A /* Debug */, 571 | 6003F5BE195388D20070C39A /* Release */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "GPUImageBeautifyFilter_Example" */ = { 577 | isa = XCConfigurationList; 578 | buildConfigurations = ( 579 | 6003F5C0195388D20070C39A /* Debug */, 580 | 6003F5C1195388D20070C39A /* Release */, 581 | ); 582 | defaultConfigurationIsVisible = 0; 583 | defaultConfigurationName = Release; 584 | }; 585 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "GPUImageBeautifyFilter_Tests" */ = { 586 | isa = XCConfigurationList; 587 | buildConfigurations = ( 588 | 6003F5C3195388D20070C39A /* Debug */, 589 | 6003F5C4195388D20070C39A /* Release */, 590 | ); 591 | defaultConfigurationIsVisible = 0; 592 | defaultConfigurationName = Release; 593 | }; 594 | /* End XCConfigurationList section */ 595 | }; 596 | rootObject = 6003F582195388D10070C39A /* Project object */; 597 | } 598 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter.xcodeproj/xcshareddata/xcschemes/GPUImageBeautifyFilter-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/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 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUAppDelegate.h 3 | // GPUImageBeautifyFilter 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface GPUAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUAppDelegate.m 3 | // GPUImageBeautifyFilter 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | #import "GPUAppDelegate.h" 10 | 11 | @implementation GPUAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | // Override point for customization after application launch. 16 | return YES; 17 | } 18 | 19 | - (void)applicationWillResignActive:(UIApplication *)application 20 | { 21 | // 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. 22 | // 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. 23 | } 24 | 25 | - (void)applicationDidEnterBackground:(UIApplication *)application 26 | { 27 | // 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. 28 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 29 | } 30 | 31 | - (void)applicationWillEnterForeground:(UIApplication *)application 32 | { 33 | // 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. 34 | } 35 | 36 | - (void)applicationDidBecomeActive:(UIApplication *)application 37 | { 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 | { 43 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUImageBeautifyFilter-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | NSCameraUsageDescription 28 | 请允许访问相机 29 | NSMicrophoneUsageDescription 30 | 请允许访问麦克风 31 | NSPhotoLibraryAddUsageDescription 32 | 请允许访问相册 33 | NSPhotoLibraryUsageDescription 34 | 请允许访问相册 35 | UILaunchStoryboardName 36 | LaunchScreen 37 | UIMainStoryboardFile 38 | Main 39 | UIRequiredDeviceCapabilities 40 | 41 | armv7 42 | 43 | UISupportedInterfaceOrientations 44 | 45 | UIInterfaceOrientationPortrait 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | UISupportedInterfaceOrientations~ipad 50 | 51 | UIInterfaceOrientationPortrait 52 | UIInterfaceOrientationPortraitUpsideDown 53 | UIInterfaceOrientationLandscapeLeft 54 | UIInterfaceOrientationLandscapeRight 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUImageBeautifyFilter-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUViewController.h 3 | // GPUImageBeautifyFilter 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface GPUViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/GPUViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUViewController.m 3 | // GPUImageBeautifyFilter 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | #import "GPUViewController.h" 10 | #import "GPUImageBeautifyFilter.h" 11 | #import "GPUImage.h" 12 | 13 | @interface GPUViewController () 14 | 15 | @property (nonatomic, strong) GPUImageVideoCamera *videoCamera; 16 | @property (nonatomic, strong) GPUImageView *filterView; 17 | @property (nonatomic, strong) UIButton *beautifyButton; 18 | 19 | @end 20 | 21 | @implementation GPUViewController 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | self.videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset1280x720 cameraPosition:AVCaptureDevicePositionFront]; 28 | self.videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; 29 | self.videoCamera.horizontallyMirrorFrontFacingCamera = YES; 30 | self.filterView = [[GPUImageView alloc] initWithFrame:self.view.frame]; 31 | self.filterView.center = self.view.center; 32 | 33 | [self.view addSubview:self.filterView]; 34 | [self.videoCamera addTarget:self.filterView]; 35 | [self.videoCamera startCameraCapture]; 36 | 37 | self.beautifyButton = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | self.beautifyButton.frame = CGRectMake(0, self.view.frame.size.height - 40, self.view.frame.size.width, 40); 39 | self.beautifyButton.backgroundColor = [UIColor whiteColor]; 40 | [self.beautifyButton setTitle:@"开启" forState:UIControlStateNormal]; 41 | [self.beautifyButton setTitle:@"关闭" forState:UIControlStateSelected]; 42 | [self.beautifyButton setTitleColor:[UIColor blueColor] forState:UIControlStateNormal]; 43 | [self.beautifyButton addTarget:self action:@selector(beautify) forControlEvents:UIControlEventTouchUpInside]; 44 | [self.view addSubview:self.beautifyButton]; 45 | 46 | } 47 | 48 | - (void)beautify { 49 | if (self.beautifyButton.selected) { 50 | self.beautifyButton.selected = NO; 51 | [self.videoCamera removeAllTargets]; 52 | [self.videoCamera addTarget:self.filterView]; 53 | } 54 | else { 55 | self.beautifyButton.selected = YES; 56 | [self.videoCamera removeAllTargets]; 57 | GPUImageBeautifyFilter *beautifyFilter = [[GPUImageBeautifyFilter alloc] init]; 58 | // [beautifyFilter setBrightness:2 saturation:2]; 59 | [self.videoCamera addTarget:beautifyFilter]; 60 | [beautifyFilter addTarget:self.filterView]; 61 | } 62 | } 63 | 64 | - (void)didReceiveMemoryWarning 65 | { 66 | [super didReceiveMemoryWarning]; 67 | // Dispose of any resources that can be recreated. 68 | } 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/Images.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 | } 99 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/GPUImageBeautifyFilter/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GPUImageBeautifyFilter 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "GPUAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([GPUAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'GPUImageBeautifyFilter_Example' do 4 | pod 'GPUImageBeautifyFilter', :path => '../' 5 | 6 | target 'GPUImageBeautifyFilter_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GPUImage (0.1.7) 3 | - GPUImageBeautifyFilter (1.0.0): 4 | - GPUImage 5 | 6 | DEPENDENCIES: 7 | - GPUImageBeautifyFilter (from `../`) 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - GPUImage 12 | 13 | EXTERNAL SOURCES: 14 | GPUImageBeautifyFilter: 15 | :path: "../" 16 | 17 | SPEC CHECKSUMS: 18 | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d 19 | GPUImageBeautifyFilter: f5a4886f2f27956d45454f8b458674ed003ebd6e 20 | 21 | PODFILE CHECKSUM: 5db8aa422fe15d0edc37627f271c9ad9de466359 22 | 23 | COCOAPODS: 1.5.3 24 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageBeautifyFilterTests.m 3 | // GPUImageBeautifyFilterTests 4 | // 5 | // Created by claudeli@yeah.net on 10/10/2018. 6 | // Copyright (c) 2018 claudeli@yeah.net. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /GPUImageBeautifyFilter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint GPUImageBeautifyFilter.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'GPUImageBeautifyFilter' 11 | s.version = '1.0.0' 12 | s.summary = 'GPUImageBeautyFilter using GPUImage' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/ClaudeLi/GPUImageBeautifyFilter' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'ClaudeLi' => 'claudeli@yeah.net' } 28 | s.source = { :git => 'https://github.com/ClaudeLi/GPUImageBeautifyFilter.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '8.0' 32 | 33 | s.source_files = 'GPUImageBeautifyFilter/Classes/**/*' 34 | 35 | # s.resource_bundles = { 36 | # 'GPUImageBeautifyFilter' => ['GPUImageBeautifyFilter/Assets/*.png'] 37 | # } 38 | 39 | # s.public_header_files = 'Pod/Classes/**/*.h' 40 | # s.frameworks = 'UIKit', 'MapKit' 41 | s.dependency 'GPUImage' 42 | end 43 | -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClaudeLi/GPUImageBeautifyFilter/282a2975e71a7ff657bebdc1cbbf93a701027314/GPUImageBeautifyFilter/Assets/.gitkeep -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ClaudeLi/GPUImageBeautifyFilter/282a2975e71a7ff657bebdc1cbbf93a701027314/GPUImageBeautifyFilter/Classes/.gitkeep -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Classes/GPUImageBeautifyFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageBeautifyFilter.h 3 | // BeautifyFace 4 | // 5 | // Created by ClaudeLi on 16/5/19. 6 | // Copyright © 2016年 ClaudeLi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class GPUImageCombinationFilter; 12 | @interface GPUImageBeautifyFilter : GPUImageFilterGroup{ 13 | GPUImageBilateralFilter *bilateralFilter; 14 | GPUImageCannyEdgeDetectionFilter *cannyEdgeFilter; 15 | GPUImageCombinationFilter *combinationFilter; 16 | GPUImageHSBFilter *hsbFilter; 17 | } 18 | 19 | /** 20 | * A normalization factor for the distance between central color and sample color 21 | * 22 | * @param value default 2.0 23 | */ 24 | - (void)setDistanceNormalizationFactor:(CGFloat)value; 25 | 26 | /** 27 | * Set brightness and saturation 28 | * 29 | * @param brightness [0.0, 2.0], default 1.05 30 | * @param saturation [0.0, 2.0], default 1.05 31 | */ 32 | - (void)setBrightness:(CGFloat)brightness saturation:(CGFloat)saturation; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Classes/GPUImageBeautifyFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageBeautifyFilter.m 3 | // BeautifyFace 4 | // 5 | // Created by ClaudeLi on 16/5/19. 6 | // Copyright © 2016年 ClaudeLi. 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 = 2.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.05]; 96 | [hsbFilter adjustSaturation:1.05]; 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 | - (void)setDistanceNormalizationFactor:(CGFloat)value{ 138 | bilateralFilter.distanceNormalizationFactor = value; 139 | } 140 | 141 | - (void)setBrightness:(CGFloat)brightness saturation:(CGFloat)saturation{ 142 | [hsbFilter adjustBrightness:brightness]; 143 | [hsbFilter adjustSaturation:saturation]; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Classes/GPUImageBeautyFilter.h: -------------------------------------------------------------------------------- 1 | #if __has_include() 2 | #import 3 | #elif __has_include("GPUImage/GPUImage.h") 4 | #import "GPUImage/GPUImage.h" 5 | #else 6 | #import "GPUImage.h" 7 | #endif 8 | @interface GPUImageBeautyFilter : GPUImageFilter 9 | 10 | /** 11 | 美颜程度 12 | */ 13 | @property (nonatomic, assign) CGFloat beautyLevel; 14 | 15 | /** 16 | 美白程度 17 | */ 18 | @property (nonatomic, assign) CGFloat brightLevel; 19 | 20 | /** 21 | 色调强度 22 | */ 23 | @property (nonatomic, assign) CGFloat toneLevel; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /GPUImageBeautifyFilter/Classes/GPUImageBeautyFilter.m: -------------------------------------------------------------------------------- 1 | #import "GPUImageBeautyFilter.h" 2 | 3 | #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE 4 | NSString *const GPUImageBeautyFragmentShaderString = SHADER_STRING 5 | ( 6 | varying highp vec2 textureCoordinate; 7 | 8 | uniform sampler2D inputImageTexture; 9 | 10 | uniform highp vec2 singleStepOffset; 11 | uniform highp vec4 params; 12 | uniform highp float brightness; 13 | 14 | const highp vec3 W = vec3(0.299, 0.587, 0.114); 15 | const highp mat3 saturateMatrix = mat3( 16 | 1.1102, -0.0598, -0.061, 17 | -0.0774, 1.0826, -0.1186, 18 | -0.0228, -0.0228, 1.1772); 19 | highp vec2 blurCoordinates[24]; 20 | 21 | highp float hardLight(highp float color) { 22 | if (color <= 0.5) 23 | color = color * color * 2.0; 24 | else 25 | color = 1.0 - ((1.0 - color)*(1.0 - color) * 2.0); 26 | return color; 27 | } 28 | 29 | void main(){ 30 | highp vec3 centralColor = texture2D(inputImageTexture, textureCoordinate).rgb; 31 | blurCoordinates[0] = textureCoordinate.xy + singleStepOffset * vec2(0.0, -10.0); 32 | blurCoordinates[1] = textureCoordinate.xy + singleStepOffset * vec2(0.0, 10.0); 33 | blurCoordinates[2] = textureCoordinate.xy + singleStepOffset * vec2(-10.0, 0.0); 34 | blurCoordinates[3] = textureCoordinate.xy + singleStepOffset * vec2(10.0, 0.0); 35 | blurCoordinates[4] = textureCoordinate.xy + singleStepOffset * vec2(5.0, -8.0); 36 | blurCoordinates[5] = textureCoordinate.xy + singleStepOffset * vec2(5.0, 8.0); 37 | blurCoordinates[6] = textureCoordinate.xy + singleStepOffset * vec2(-5.0, 8.0); 38 | blurCoordinates[7] = textureCoordinate.xy + singleStepOffset * vec2(-5.0, -8.0); 39 | blurCoordinates[8] = textureCoordinate.xy + singleStepOffset * vec2(8.0, -5.0); 40 | blurCoordinates[9] = textureCoordinate.xy + singleStepOffset * vec2(8.0, 5.0); 41 | blurCoordinates[10] = textureCoordinate.xy + singleStepOffset * vec2(-8.0, 5.0); 42 | blurCoordinates[11] = textureCoordinate.xy + singleStepOffset * vec2(-8.0, -5.0); 43 | blurCoordinates[12] = textureCoordinate.xy + singleStepOffset * vec2(0.0, -6.0); 44 | blurCoordinates[13] = textureCoordinate.xy + singleStepOffset * vec2(0.0, 6.0); 45 | blurCoordinates[14] = textureCoordinate.xy + singleStepOffset * vec2(6.0, 0.0); 46 | blurCoordinates[15] = textureCoordinate.xy + singleStepOffset * vec2(-6.0, 0.0); 47 | blurCoordinates[16] = textureCoordinate.xy + singleStepOffset * vec2(-4.0, -4.0); 48 | blurCoordinates[17] = textureCoordinate.xy + singleStepOffset * vec2(-4.0, 4.0); 49 | blurCoordinates[18] = textureCoordinate.xy + singleStepOffset * vec2(4.0, -4.0); 50 | blurCoordinates[19] = textureCoordinate.xy + singleStepOffset * vec2(4.0, 4.0); 51 | blurCoordinates[20] = textureCoordinate.xy + singleStepOffset * vec2(-2.0, -2.0); 52 | blurCoordinates[21] = textureCoordinate.xy + singleStepOffset * vec2(-2.0, 2.0); 53 | blurCoordinates[22] = textureCoordinate.xy + singleStepOffset * vec2(2.0, -2.0); 54 | blurCoordinates[23] = textureCoordinate.xy + singleStepOffset * vec2(2.0, 2.0); 55 | 56 | highp float sampleColor = centralColor.g * 22.0; 57 | sampleColor += texture2D(inputImageTexture, blurCoordinates[0]).g; 58 | sampleColor += texture2D(inputImageTexture, blurCoordinates[1]).g; 59 | sampleColor += texture2D(inputImageTexture, blurCoordinates[2]).g; 60 | sampleColor += texture2D(inputImageTexture, blurCoordinates[3]).g; 61 | sampleColor += texture2D(inputImageTexture, blurCoordinates[4]).g; 62 | sampleColor += texture2D(inputImageTexture, blurCoordinates[5]).g; 63 | sampleColor += texture2D(inputImageTexture, blurCoordinates[6]).g; 64 | sampleColor += texture2D(inputImageTexture, blurCoordinates[7]).g; 65 | sampleColor += texture2D(inputImageTexture, blurCoordinates[8]).g; 66 | sampleColor += texture2D(inputImageTexture, blurCoordinates[9]).g; 67 | sampleColor += texture2D(inputImageTexture, blurCoordinates[10]).g; 68 | sampleColor += texture2D(inputImageTexture, blurCoordinates[11]).g; 69 | sampleColor += texture2D(inputImageTexture, blurCoordinates[12]).g * 2.0; 70 | sampleColor += texture2D(inputImageTexture, blurCoordinates[13]).g * 2.0; 71 | sampleColor += texture2D(inputImageTexture, blurCoordinates[14]).g * 2.0; 72 | sampleColor += texture2D(inputImageTexture, blurCoordinates[15]).g * 2.0; 73 | sampleColor += texture2D(inputImageTexture, blurCoordinates[16]).g * 2.0; 74 | sampleColor += texture2D(inputImageTexture, blurCoordinates[17]).g * 2.0; 75 | sampleColor += texture2D(inputImageTexture, blurCoordinates[18]).g * 2.0; 76 | sampleColor += texture2D(inputImageTexture, blurCoordinates[19]).g * 2.0; 77 | sampleColor += texture2D(inputImageTexture, blurCoordinates[20]).g * 3.0; 78 | sampleColor += texture2D(inputImageTexture, blurCoordinates[21]).g * 3.0; 79 | sampleColor += texture2D(inputImageTexture, blurCoordinates[22]).g * 3.0; 80 | sampleColor += texture2D(inputImageTexture, blurCoordinates[23]).g * 3.0; 81 | 82 | sampleColor = sampleColor / 62.0; 83 | 84 | highp float highPass = centralColor.g - sampleColor + 0.5; 85 | 86 | for (int i = 0; i < 5; i++) { 87 | highPass = hardLight(highPass); 88 | } 89 | highp float lumance = dot(centralColor, W); 90 | 91 | highp float alpha = pow(lumance, params.r); 92 | 93 | highp vec3 smoothColor = centralColor + (centralColor-vec3(highPass))*alpha*0.1; 94 | 95 | smoothColor.r = clamp(pow(smoothColor.r, params.g), 0.0, 1.0); 96 | smoothColor.g = clamp(pow(smoothColor.g, params.g), 0.0, 1.0); 97 | smoothColor.b = clamp(pow(smoothColor.b, params.g), 0.0, 1.0); 98 | 99 | highp vec3 lvse = vec3(1.0)-(vec3(1.0)-smoothColor)*(vec3(1.0)-centralColor); 100 | highp vec3 bianliang = max(smoothColor, centralColor); 101 | highp vec3 rouguang = 2.0*centralColor*smoothColor + centralColor*centralColor - 2.0*centralColor*centralColor*smoothColor; 102 | 103 | gl_FragColor = vec4(mix(centralColor, lvse, alpha), 1.0); 104 | gl_FragColor.rgb = mix(gl_FragColor.rgb, bianliang, alpha); 105 | gl_FragColor.rgb = mix(gl_FragColor.rgb, rouguang, params.b); 106 | 107 | highp vec3 satcolor = gl_FragColor.rgb * saturateMatrix; 108 | gl_FragColor.rgb = mix(gl_FragColor.rgb, satcolor, params.a); 109 | gl_FragColor.rgb = vec3(gl_FragColor.rgb + vec3(brightness)); 110 | } 111 | 112 | ); 113 | #else 114 | NSString *const beautyLevel = SHADER_STRING 115 | ( 116 | varying vec2 textureCoordinate; 117 | 118 | uniform sampler2D inputImageTexture; 119 | 120 | uniform mediump vec2 singleStepOffset; 121 | uniform mediump vec4 params; 122 | uniform mediump float brightness; 123 | const mediump mat3 saturateMatrix = mat3( 124 | 1.1102, -0.0598, -0.061, 125 | -0.0774, 1.0826, -0.1186, 126 | -0.0228, -0.0228, 1.1772); 127 | const mediump vec3 W = vec3(0.299, 0.587, 0.114); 128 | mediump vec2 blurCoordinates[24]; 129 | 130 | mediump float hardLight(mediump float color){ 131 | if (color <= 0.5) 132 | color = color * color * 2.0; 133 | else 134 | color = 1.0 - ((1.0 - color)*(1.0 - color) * 2.0); 135 | return color; 136 | } 137 | 138 | void main(){ 139 | mediump vec3 centralColor = texture2D(inputImageTexture, textureCoordinate).rgb; 140 | blurCoordinates[0] = textureCoordinate.xy + singleStepOffset * vec2(0.0, -10.0); 141 | blurCoordinates[1] = textureCoordinate.xy + singleStepOffset * vec2(0.0, 10.0); 142 | blurCoordinates[2] = textureCoordinate.xy + singleStepOffset * vec2(-10.0, 0.0); 143 | blurCoordinates[3] = textureCoordinate.xy + singleStepOffset * vec2(10.0, 0.0); 144 | blurCoordinates[4] = textureCoordinate.xy + singleStepOffset * vec2(5.0, -8.0); 145 | blurCoordinates[5] = textureCoordinate.xy + singleStepOffset * vec2(5.0, 8.0); 146 | blurCoordinates[6] = textureCoordinate.xy + singleStepOffset * vec2(-5.0, 8.0); 147 | blurCoordinates[7] = textureCoordinate.xy + singleStepOffset * vec2(-5.0, -8.0); 148 | blurCoordinates[8] = textureCoordinate.xy + singleStepOffset * vec2(8.0, -5.0); 149 | blurCoordinates[9] = textureCoordinate.xy + singleStepOffset * vec2(8.0, 5.0); 150 | blurCoordinates[10] = textureCoordinate.xy + singleStepOffset * vec2(-8.0, 5.0); 151 | blurCoordinates[11] = textureCoordinate.xy + singleStepOffset * vec2(-8.0, -5.0); 152 | blurCoordinates[12] = textureCoordinate.xy + singleStepOffset * vec2(0.0, -6.0); 153 | blurCoordinates[13] = textureCoordinate.xy + singleStepOffset * vec2(0.0, 6.0); 154 | blurCoordinates[14] = textureCoordinate.xy + singleStepOffset * vec2(6.0, 0.0); 155 | blurCoordinates[15] = textureCoordinate.xy + singleStepOffset * vec2(-6.0, 0.0); 156 | blurCoordinates[16] = textureCoordinate.xy + singleStepOffset * vec2(-4.0, -4.0); 157 | blurCoordinates[17] = textureCoordinate.xy + singleStepOffset * vec2(-4.0, 4.0); 158 | blurCoordinates[18] = textureCoordinate.xy + singleStepOffset * vec2(4.0, -4.0); 159 | blurCoordinates[19] = textureCoordinate.xy + singleStepOffset * vec2(4.0, 4.0); 160 | blurCoordinates[20] = textureCoordinate.xy + singleStepOffset * vec2(-2.0, -2.0); 161 | blurCoordinates[21] = textureCoordinate.xy + singleStepOffset * vec2(-2.0, 2.0); 162 | blurCoordinates[22] = textureCoordinate.xy + singleStepOffset * vec2(2.0, -2.0); 163 | blurCoordinates[23] = textureCoordinate.xy + singleStepOffset * vec2(2.0, 2.0); 164 | 165 | mediump float sampleColor = centralColor.g * 22.0; 166 | sampleColor += texture2D(inputImageTexture, blurCoordinates[0]).g; 167 | sampleColor += texture2D(inputImageTexture, blurCoordinates[1]).g; 168 | sampleColor += texture2D(inputImageTexture, blurCoordinates[2]).g; 169 | sampleColor += texture2D(inputImageTexture, blurCoordinates[3]).g; 170 | sampleColor += texture2D(inputImageTexture, blurCoordinates[4]).g; 171 | sampleColor += texture2D(inputImageTexture, blurCoordinates[5]).g; 172 | sampleColor += texture2D(inputImageTexture, blurCoordinates[6]).g; 173 | sampleColor += texture2D(inputImageTexture, blurCoordinates[7]).g; 174 | sampleColor += texture2D(inputImageTexture, blurCoordinates[8]).g; 175 | sampleColor += texture2D(inputImageTexture, blurCoordinates[9]).g; 176 | sampleColor += texture2D(inputImageTexture, blurCoordinates[10]).g; 177 | sampleColor += texture2D(inputImageTexture, blurCoordinates[11]).g; 178 | sampleColor += texture2D(inputImageTexture, blurCoordinates[12]).g * 2.0; 179 | sampleColor += texture2D(inputImageTexture, blurCoordinates[13]).g * 2.0; 180 | sampleColor += texture2D(inputImageTexture, blurCoordinates[14]).g * 2.0; 181 | sampleColor += texture2D(inputImageTexture, blurCoordinates[15]).g * 2.0; 182 | sampleColor += texture2D(inputImageTexture, blurCoordinates[16]).g * 2.0; 183 | sampleColor += texture2D(inputImageTexture, blurCoordinates[17]).g * 2.0; 184 | sampleColor += texture2D(inputImageTexture, blurCoordinates[18]).g * 2.0; 185 | sampleColor += texture2D(inputImageTexture, blurCoordinates[19]).g * 2.0; 186 | sampleColor += texture2D(inputImageTexture, blurCoordinates[20]).g * 3.0; 187 | sampleColor += texture2D(inputImageTexture, blurCoordinates[21]).g * 3.0; 188 | sampleColor += texture2D(inputImageTexture, blurCoordinates[22]).g * 3.0; 189 | sampleColor += texture2D(inputImageTexture, blurCoordinates[23]).g * 3.0; 190 | 191 | sampleColor = sampleColor / 62.0; 192 | 193 | mediump float highPass = centralColor.g - sampleColor + 0.5; 194 | 195 | for (int i = 0; i < 5; i++) { 196 | highPass = hardLight(highPass); 197 | } 198 | mediump float luminance = dot(centralColor, W); 199 | 200 | mediump float alpha = pow(luminance, params); 201 | 202 | mediump vec3 smoothColor = centralColor + (centralColor-vec3(highPass))*alpha*0.1; 203 | 204 | smoothColor.r = clamp(pow(smoothColor.r, params.g), 0.0, 1.0); 205 | smoothColor.g = clamp(pow(smoothColor.g, params.g), 0.0, 1.0); 206 | smoothColor.b = clamp(pow(smoothColor.b, params.g), 0.0, 1.0); 207 | 208 | mediump vec3 lvse = vec3(1.0)-(vec3(1.0)-smoothColor)*(vec3(1.0)-centralColor); 209 | mediump vec3 bianliang = max(smoothColor, centralColor); 210 | mediump vec3 rouguang = 2.0*centralColor*smoothColor + centralColor*centralColor - 2.0*centralColor*centralColor*smoothColor; 211 | 212 | gl_FragColor = vec4(mix(centralColor, lvse, alpha), 1.0); 213 | gl_FragColor.rgb = mix(gl_FragColor.rgb, bianliang, alpha); 214 | gl_FragColor.rgb = mix(gl_FragColor.rgb, rouguang, params.b); 215 | 216 | mediump vec3 satcolor = gl_FragColor.rgb * saturateMatrix; 217 | gl_FragColor.rgb = mix(gl_FragColor.rgb, satcolor, params.a); 218 | gl_FragColor.rgb = vec3(gl_FragColor.rgb + vec3(brightness)); 219 | } 220 | 221 | ); 222 | #endif 223 | 224 | @implementation GPUImageBeautyFilter 225 | 226 | - (id)init; 227 | { 228 | if (!(self = [super initWithFragmentShaderFromString:GPUImageBeautyFragmentShaderString])) { 229 | return nil; 230 | } 231 | 232 | _toneLevel = 0.47; 233 | _beautyLevel = 0.42; 234 | _brightLevel = 0.34; 235 | [self setParams:_beautyLevel tone:_toneLevel]; 236 | [self setBrightLevel:_brightLevel]; 237 | return self; 238 | } 239 | 240 | - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex { 241 | [super setInputSize:newSize atIndex:textureIndex]; 242 | inputTextureSize = newSize; 243 | 244 | CGPoint offset = CGPointMake(2.0f / inputTextureSize.width, 2.0 / inputTextureSize.height); 245 | [self setPoint:offset forUniformName:@"singleStepOffset"]; 246 | } 247 | 248 | - (void)setBeautyLevel:(CGFloat)beautyLevel { 249 | _beautyLevel = beautyLevel; 250 | [self setParams:_beautyLevel tone:_toneLevel]; 251 | } 252 | 253 | - (void)setBrightLevel:(CGFloat)brightLevel { 254 | _brightLevel = brightLevel; 255 | [self setFloat:0.6 * (-0.5 + brightLevel) forUniformName:@"brightness"]; 256 | } 257 | 258 | - (void)setParams:(CGFloat)beauty tone:(CGFloat)tone { 259 | GPUVector4 fBeautyParam; 260 | fBeautyParam.one = 1.0 - 0.6 * beauty; 261 | fBeautyParam.two = 1.0 - 0.3 * beauty; 262 | fBeautyParam.three = 0.1 + 0.3 * tone; 263 | fBeautyParam.four = 0.1 + 0.3 * tone; 264 | [self setFloatVec4:fBeautyParam forUniform:@"params"]; 265 | } 266 | 267 | @end 268 | 269 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2018 claudeli@yeah.net 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GPUImageBeautifyFilter 2 | 3 | [![CI Status](https://img.shields.io/travis/claudeli@yeah.net/GPUImageBeautifyFilter.svg?style=flat)](https://travis-ci.org/claudeli@yeah.net/GPUImageBeautifyFilter) 4 | [![Version](https://img.shields.io/cocoapods/v/GPUImageBeautifyFilter.svg?style=flat)](https://cocoapods.org/pods/GPUImageBeautifyFilter) 5 | [![License](https://img.shields.io/cocoapods/l/GPUImageBeautifyFilter.svg?style=flat)](https://cocoapods.org/pods/GPUImageBeautifyFilter) 6 | [![Platform](https://img.shields.io/cocoapods/p/GPUImageBeautifyFilter.svg?style=flat)](https://cocoapods.org/pods/GPUImageBeautifyFilter) 7 | 8 | ## Example 9 | 10 | To run the example project, clone the repo, and run `pod install` from the Example directory first. 11 | 12 | ## Requirements 13 | 14 | ## Installation 15 | 16 | GPUImageBeautifyFilter is available through [CocoaPods](https://cocoapods.org). To install 17 | it, simply add the following line to your Podfile: 18 | 19 | ```ruby 20 | pod 'GPUImageBeautifyFilter' 21 | ``` 22 | 23 | ## Author 24 | 25 | claudeli@yeah.net, claudeli@yeah.net 26 | 27 | ## License 28 | 29 | GPUImageBeautifyFilter is available under the MIT license. See the LICENSE file for more info. 30 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------