├── README.md ├── DotGPUBeautyFilterDemo ├── DotGPUBeautyFilterDemo.xcodeproj │ ├── project.xcworkspace │ │ └── contents.xcworkspacedata │ └── project.pbxproj └── DotGPUBeautyFilterDemo │ ├── ViewController.h │ ├── AppDelegate.h │ ├── main.m │ ├── Sources │ ├── DotGPUImageBeautyFilter.h │ └── DotGPUImageBeautyFilter.m │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard │ ├── ViewController.m │ └── AppDelegate.m ├── DotGPUBeautyFilterDemo.xcworkspace └── contents.xcworkspacedata ├── Sources ├── DotGPUImageBeautyFilter.h └── DotGPUImageBeautyFilter.m ├── Podfile ├── .gitignore └── DotGPUBeautyFilter.podspec /README.md: -------------------------------------------------------------------------------- 1 | # DotGPUBeautyFilter 2 | face beauty filter for GUPImage 3 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DotGPUBeautyFilterDemo 4 | // 5 | // Created by xiang on 09/01/2017. 6 | // Copyright © 2017 dotEngine. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DotGPUBeautyFilterDemo 4 | // 5 | // Created by xiang on 09/01/2017. 6 | // Copyright © 2017 dotEngine. 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 | -------------------------------------------------------------------------------- /Sources/DotGPUImageBeautyFilter.h: -------------------------------------------------------------------------------- 1 | #if __has_include() 2 | #import 3 | #else 4 | #import "GPUImage.h" 5 | #endif 6 | 7 | @interface DotGPUImageBeautyFilter : GPUImageFilter { 8 | } 9 | 10 | @property (nonatomic, assign) CGFloat beautyLevel; 11 | @property (nonatomic, assign) CGFloat brightLevel; 12 | @property (nonatomic, assign) CGFloat toneLevel; 13 | @end 14 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | project 'DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo.xcodeproj' 2 | 3 | # Uncomment the next line to define a global platform for your project 4 | # platform :ios, '9.0' 5 | 6 | target 'DotGPUBeautyFilterDemo' do 7 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 8 | # use_frameworks! 9 | 10 | # Pods for DotGPUBeautyFilterDemo 11 | # 12 | pod 'GPUImage' 13 | end 14 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DotGPUBeautyFilterDemo 4 | // 5 | // Created by xiang on 09/01/2017. 6 | // Copyright © 2017 dotEngine. 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 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/Sources/DotGPUImageBeautyFilter.h: -------------------------------------------------------------------------------- 1 | #if __has_include() 2 | #import 3 | #else 4 | #import "GPUImage.h" 5 | #endif 6 | 7 | @interface DotGPUImageBeautyFilter : GPUImageFilter { 8 | } 9 | 10 | @property (nonatomic, assign) CGFloat beautyLevel; 11 | @property (nonatomic, assign) CGFloat brightLevel; 12 | @property (nonatomic, assign) CGFloat toneLevel; 13 | @end 14 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSCameraUsageDescription 6 | get camera 7 | CFBundleDevelopmentRegion 8 | en 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 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | 31 | 32 | .DS_Store 33 | 34 | *.lock 35 | 36 | # CocoaPods 37 | # 38 | # We recommend against adding the Pods directory to your .gitignore. However 39 | # you should judge for yourself, the pros and cons are mentioned at: 40 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 41 | # 42 | Pods/ 43 | 44 | # Carthage 45 | # 46 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 47 | # Carthage/Checkouts 48 | 49 | Carthage/Build 50 | 51 | # fastlane 52 | # 53 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 54 | # screenshots whenever they are needed. 55 | # For more information about the recommended setup visit: 56 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 57 | 58 | fastlane/report.xml 59 | fastlane/screenshots 60 | 61 | #Code Injection 62 | # 63 | # After new code Injection tools there's a generated folder /iOSInjectionProject 64 | # https://github.com/johnno1962/injectionforxcode 65 | 66 | iOSInjectionProject/ 67 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/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 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/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 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DotGPUBeautyFilterDemo 4 | // 5 | // Created by xiang on 09/01/2017. 6 | // Copyright © 2017 dotEngine. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | #import 12 | 13 | #import "DotGPUImageBeautyFilter.h" 14 | 15 | @interface ViewController () 16 | { 17 | 18 | GPUImageView *cameraView; 19 | GPUImageVideoCamera *videoCamera; 20 | } 21 | 22 | @end 23 | 24 | @implementation ViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | // Do any additional setup after loading the view, typically from a nib. 29 | 30 | videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionFront]; 31 | videoCamera.outputImageOrientation = UIInterfaceOrientationPortrait; 32 | 33 | videoCamera.horizontallyMirrorFrontFacingCamera = YES; 34 | 35 | cameraView = [[GPUImageView alloc] initWithFrame:CGRectMake(0, 0, 360, 360)]; 36 | 37 | DotGPUImageBeautyFilter *filter = [[DotGPUImageBeautyFilter alloc] init]; 38 | 39 | filter.beautyLevel = 1.0; 40 | 41 | filter.toneLevel = 0.8; 42 | 43 | 44 | GPUImageCropFilter *cropfilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0, 0, 1, 0.75)]; 45 | 46 | //[filter forceProcessingAtSize:cameraView.sizeInPixels]; 47 | 48 | 49 | [videoCamera addTarget:filter]; 50 | 51 | [filter addTarget:cropfilter]; 52 | 53 | [cropfilter addTarget:cameraView]; 54 | 55 | [self.view addSubview:cameraView]; 56 | 57 | 58 | [videoCamera startCameraCapture]; 59 | 60 | } 61 | 62 | 63 | - (void)didReceiveMemoryWarning { 64 | [super didReceiveMemoryWarning]; 65 | // Dispose of any resources that can be recreated. 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // DotGPUBeautyFilterDemo 4 | // 5 | // Created by xiang on 09/01/2017. 6 | // Copyright © 2017 dotEngine. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // 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. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // 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. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // 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. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // 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. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /DotGPUBeautyFilter.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint DotGPUBeautyFilter.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "DotGPUBeautyFilter" 19 | s.version = "0.0.1" 20 | s.summary = "DotGPUBeautyFilter GPUImage based filter" 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | s.description = <<-DESC 28 | DotGPUBeautyFilter GPUImage based filter 29 | DESC 30 | 31 | s.homepage = "https://github.com/dotEngine/DotGPUBeautyFilter" 32 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 33 | 34 | 35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 36 | # 37 | # Licensing your code is important. See http://choosealicense.com for more info. 38 | # CocoaPods will detect a license file if there is a named LICENSE* 39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 40 | # 41 | 42 | #s.license = "MIT (example)" 43 | s.license = { :type => "MIT" } 44 | 45 | 46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # Specify the authors of the library, with email addresses. Email addresses 49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 50 | # accepts just a name if you'd rather not provide an email address. 51 | # 52 | # Specify a social_media_url where others can refer to, for example a twitter 53 | # profile URL. 54 | # 55 | 56 | s.author = { "notedit" => "notedit@gmail.com" } 57 | # Or just: s.author = "notedit" 58 | # s.authors = { "notedit" => "notedit@gmail.com" } 59 | # s.social_media_url = "http://twitter.com/notedit" 60 | 61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 62 | # 63 | # If this Pod runs only on iOS or OS X, then specify the platform and 64 | # the deployment target. You can optionally include the target after the platform. 65 | # 66 | 67 | # s.platform = :ios 68 | # s.platform = :ios, "5.0" 69 | 70 | # When using multiple platforms 71 | # s.ios.deployment_target = "5.0" 72 | # s.osx.deployment_target = "10.7" 73 | # s.watchos.deployment_target = "2.0" 74 | # s.tvos.deployment_target = "9.0" 75 | 76 | 77 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 78 | # 79 | # Specify the location from where the source should be retrieved. 80 | # Supports git, hg, bzr, svn and HTTP. 81 | # 82 | 83 | s.source = { :git => "https://github.com/dotEngine/DotGPUBeautyFilter.git", :tag => "#{s.version}" } 84 | 85 | 86 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 87 | # 88 | # CocoaPods is smart about how it includes source code. For source files 89 | # giving a folder will include any swift, h, m, mm, c & cpp files. 90 | # For header files it will include any header in the folder. 91 | # Not including the public_header_files will make all headers public. 92 | # 93 | 94 | s.source_files = "Sources", "Sources/*.{h,m}" 95 | 96 | # s.public_header_files = "Classes/**/*.h" 97 | 98 | 99 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 100 | # 101 | # A list of resources included with the Pod. These are copied into the 102 | # target bundle with a build phase script. Anything else will be cleaned. 103 | # You can preserve files from being cleaned, please don't preserve 104 | # non-essential files like tests, examples and documentation. 105 | # 106 | 107 | # s.resource = "icon.png" 108 | # s.resources = "Resources/*.png" 109 | 110 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 111 | 112 | 113 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 114 | # 115 | # Link your library with frameworks, or libraries. Libraries do not include 116 | # the lib prefix of their name. 117 | # 118 | 119 | # s.framework = "SomeFramework" 120 | # s.frameworks = "SomeFramework", "AnotherFramework" 121 | 122 | # s.library = "iconv" 123 | # s.libraries = "iconv", "xml2" 124 | 125 | 126 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 127 | # 128 | # If your library depends on compiler flags you can set them in the xcconfig hash 129 | # where they will only apply to your library. If you depend on other Podspecs 130 | # you can include multiple dependencies to ensure it works. 131 | 132 | # s.requires_arc = true 133 | 134 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 135 | # s.dependency "JSONKit", "~> 1.4" 136 | 137 | end 138 | -------------------------------------------------------------------------------- /Sources/DotGPUImageBeautyFilter.m: -------------------------------------------------------------------------------- 1 | #import "DotGPUImageBeautyFilter.h" 2 | 3 | #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE 4 | NSString *const kDOTGPUImageBeautyFragmentShaderString = 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 kDOTGPUImageBeautyFragmentShaderString = 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 DotGPUImageBeautyFilter 225 | 226 | - (id)init; 227 | { 228 | if (!(self = [super initWithFragmentShaderFromString:kDOTGPUImageBeautyFragmentShaderString])) { 229 | return nil; 230 | } 231 | 232 | _toneLevel = 0.5; 233 | _beautyLevel = 0.5; 234 | _brightLevel = 0.5; 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 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo/Sources/DotGPUImageBeautyFilter.m: -------------------------------------------------------------------------------- 1 | #import "DotGPUImageBeautyFilter.h" 2 | 3 | #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE 4 | NSString *const kDOTGPUImageBeautyFragmentShaderString = 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 kDOTGPUImageBeautyFragmentShaderString = 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 DotGPUImageBeautyFilter 225 | 226 | - (id)init; 227 | { 228 | if (!(self = [super initWithFragmentShaderFromString:kDOTGPUImageBeautyFragmentShaderString])) { 229 | return nil; 230 | } 231 | 232 | _toneLevel = 0.5; 233 | _beautyLevel = 0.5; 234 | _brightLevel = 0.5; 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 | -------------------------------------------------------------------------------- /DotGPUBeautyFilterDemo/DotGPUBeautyFilterDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1BAE57FDF36CB1DAB9D0B5F4 /* libPods-DotGPUBeautyFilterDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FFD684A274DC1DB09CFA73F5 /* libPods-DotGPUBeautyFilterDemo.a */; }; 11 | F09C36451E23D5AA009DEEC4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F09C36441E23D5A9009DEEC4 /* main.m */; }; 12 | F09C36481E23D5AA009DEEC4 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = F09C36471E23D5AA009DEEC4 /* AppDelegate.m */; }; 13 | F09C364B1E23D5AA009DEEC4 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F09C364A1E23D5AA009DEEC4 /* ViewController.m */; }; 14 | F09C364E1E23D5AA009DEEC4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F09C364C1E23D5AA009DEEC4 /* Main.storyboard */; }; 15 | F09C36501E23D5AA009DEEC4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F09C364F1E23D5AA009DEEC4 /* Assets.xcassets */; }; 16 | F09C36531E23D5AA009DEEC4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F09C36511E23D5AA009DEEC4 /* LaunchScreen.storyboard */; }; 17 | F09C365F1E24907A009DEEC4 /* DotGPUImageBeautyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = F09C365C1E24907A009DEEC4 /* DotGPUImageBeautyFilter.m */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | A3D59CCF0C7C9602D4D20E61 /* Pods-DotGPUBeautyFilterDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DotGPUBeautyFilterDemo.release.xcconfig"; path = "../Pods/Target Support Files/Pods-DotGPUBeautyFilterDemo/Pods-DotGPUBeautyFilterDemo.release.xcconfig"; sourceTree = ""; }; 22 | C737A5941DFB90F49DF1CDA3 /* Pods-DotGPUBeautyFilterDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DotGPUBeautyFilterDemo.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-DotGPUBeautyFilterDemo/Pods-DotGPUBeautyFilterDemo.debug.xcconfig"; sourceTree = ""; }; 23 | F09C36401E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DotGPUBeautyFilterDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | F09C36441E23D5A9009DEEC4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 25 | F09C36461E23D5AA009DEEC4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 26 | F09C36471E23D5AA009DEEC4 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 27 | F09C36491E23D5AA009DEEC4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 28 | F09C364A1E23D5AA009DEEC4 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 29 | F09C364D1E23D5AA009DEEC4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 30 | F09C364F1E23D5AA009DEEC4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 31 | F09C36521E23D5AA009DEEC4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 32 | F09C36541E23D5AA009DEEC4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 33 | F09C365B1E24907A009DEEC4 /* DotGPUImageBeautyFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DotGPUImageBeautyFilter.h; sourceTree = ""; }; 34 | F09C365C1E24907A009DEEC4 /* DotGPUImageBeautyFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DotGPUImageBeautyFilter.m; sourceTree = ""; }; 35 | FFD684A274DC1DB09CFA73F5 /* libPods-DotGPUBeautyFilterDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-DotGPUBeautyFilterDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | /* End PBXFileReference section */ 37 | 38 | /* Begin PBXFrameworksBuildPhase section */ 39 | F09C363D1E23D5A9009DEEC4 /* Frameworks */ = { 40 | isa = PBXFrameworksBuildPhase; 41 | buildActionMask = 2147483647; 42 | files = ( 43 | 1BAE57FDF36CB1DAB9D0B5F4 /* libPods-DotGPUBeautyFilterDemo.a in Frameworks */, 44 | ); 45 | runOnlyForDeploymentPostprocessing = 0; 46 | }; 47 | /* End PBXFrameworksBuildPhase section */ 48 | 49 | /* Begin PBXGroup section */ 50 | 66407877CA5AB02D2EC70CA0 /* Pods */ = { 51 | isa = PBXGroup; 52 | children = ( 53 | C737A5941DFB90F49DF1CDA3 /* Pods-DotGPUBeautyFilterDemo.debug.xcconfig */, 54 | A3D59CCF0C7C9602D4D20E61 /* Pods-DotGPUBeautyFilterDemo.release.xcconfig */, 55 | ); 56 | name = Pods; 57 | sourceTree = ""; 58 | }; 59 | ACF14E1420444B51A83214B5 /* Frameworks */ = { 60 | isa = PBXGroup; 61 | children = ( 62 | FFD684A274DC1DB09CFA73F5 /* libPods-DotGPUBeautyFilterDemo.a */, 63 | ); 64 | name = Frameworks; 65 | sourceTree = ""; 66 | }; 67 | F09C36371E23D5A9009DEEC4 = { 68 | isa = PBXGroup; 69 | children = ( 70 | F09C36421E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo */, 71 | F09C36411E23D5A9009DEEC4 /* Products */, 72 | 66407877CA5AB02D2EC70CA0 /* Pods */, 73 | ACF14E1420444B51A83214B5 /* Frameworks */, 74 | ); 75 | sourceTree = ""; 76 | }; 77 | F09C36411E23D5A9009DEEC4 /* Products */ = { 78 | isa = PBXGroup; 79 | children = ( 80 | F09C36401E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo.app */, 81 | ); 82 | name = Products; 83 | sourceTree = ""; 84 | }; 85 | F09C36421E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | F09C365A1E24907A009DEEC4 /* Sources */, 89 | F09C36461E23D5AA009DEEC4 /* AppDelegate.h */, 90 | F09C36471E23D5AA009DEEC4 /* AppDelegate.m */, 91 | F09C36491E23D5AA009DEEC4 /* ViewController.h */, 92 | F09C364A1E23D5AA009DEEC4 /* ViewController.m */, 93 | F09C364C1E23D5AA009DEEC4 /* Main.storyboard */, 94 | F09C364F1E23D5AA009DEEC4 /* Assets.xcassets */, 95 | F09C36511E23D5AA009DEEC4 /* LaunchScreen.storyboard */, 96 | F09C36541E23D5AA009DEEC4 /* Info.plist */, 97 | F09C36431E23D5A9009DEEC4 /* Supporting Files */, 98 | ); 99 | path = DotGPUBeautyFilterDemo; 100 | sourceTree = ""; 101 | }; 102 | F09C36431E23D5A9009DEEC4 /* Supporting Files */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | F09C36441E23D5A9009DEEC4 /* main.m */, 106 | ); 107 | name = "Supporting Files"; 108 | sourceTree = ""; 109 | }; 110 | F09C365A1E24907A009DEEC4 /* Sources */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | F09C365B1E24907A009DEEC4 /* DotGPUImageBeautyFilter.h */, 114 | F09C365C1E24907A009DEEC4 /* DotGPUImageBeautyFilter.m */, 115 | ); 116 | path = Sources; 117 | sourceTree = ""; 118 | }; 119 | /* End PBXGroup section */ 120 | 121 | /* Begin PBXNativeTarget section */ 122 | F09C363F1E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo */ = { 123 | isa = PBXNativeTarget; 124 | buildConfigurationList = F09C36571E23D5AA009DEEC4 /* Build configuration list for PBXNativeTarget "DotGPUBeautyFilterDemo" */; 125 | buildPhases = ( 126 | D115015BF4036F8DF67D3944 /* [CP] Check Pods Manifest.lock */, 127 | F09C363C1E23D5A9009DEEC4 /* Sources */, 128 | F09C363D1E23D5A9009DEEC4 /* Frameworks */, 129 | F09C363E1E23D5A9009DEEC4 /* Resources */, 130 | 93CE8CA99DA626DB31845ED9 /* [CP] Embed Pods Frameworks */, 131 | 45396CAB856603473F0060A6 /* [CP] Copy Pods Resources */, 132 | ); 133 | buildRules = ( 134 | ); 135 | dependencies = ( 136 | ); 137 | name = DotGPUBeautyFilterDemo; 138 | productName = DotGPUBeautyFilterDemo; 139 | productReference = F09C36401E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo.app */; 140 | productType = "com.apple.product-type.application"; 141 | }; 142 | /* End PBXNativeTarget section */ 143 | 144 | /* Begin PBXProject section */ 145 | F09C36381E23D5A9009DEEC4 /* Project object */ = { 146 | isa = PBXProject; 147 | attributes = { 148 | LastUpgradeCheck = 0800; 149 | ORGANIZATIONNAME = dotEngine; 150 | TargetAttributes = { 151 | F09C363F1E23D5A9009DEEC4 = { 152 | CreatedOnToolsVersion = 8.0; 153 | DevelopmentTeam = CLKRLU8RPY; 154 | ProvisioningStyle = Automatic; 155 | }; 156 | }; 157 | }; 158 | buildConfigurationList = F09C363B1E23D5A9009DEEC4 /* Build configuration list for PBXProject "DotGPUBeautyFilterDemo" */; 159 | compatibilityVersion = "Xcode 3.2"; 160 | developmentRegion = English; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | Base, 165 | ); 166 | mainGroup = F09C36371E23D5A9009DEEC4; 167 | productRefGroup = F09C36411E23D5A9009DEEC4 /* Products */; 168 | projectDirPath = ""; 169 | projectRoot = ""; 170 | targets = ( 171 | F09C363F1E23D5A9009DEEC4 /* DotGPUBeautyFilterDemo */, 172 | ); 173 | }; 174 | /* End PBXProject section */ 175 | 176 | /* Begin PBXResourcesBuildPhase section */ 177 | F09C363E1E23D5A9009DEEC4 /* Resources */ = { 178 | isa = PBXResourcesBuildPhase; 179 | buildActionMask = 2147483647; 180 | files = ( 181 | F09C36531E23D5AA009DEEC4 /* LaunchScreen.storyboard in Resources */, 182 | F09C36501E23D5AA009DEEC4 /* Assets.xcassets in Resources */, 183 | F09C364E1E23D5AA009DEEC4 /* Main.storyboard in Resources */, 184 | ); 185 | runOnlyForDeploymentPostprocessing = 0; 186 | }; 187 | /* End PBXResourcesBuildPhase section */ 188 | 189 | /* Begin PBXShellScriptBuildPhase section */ 190 | 45396CAB856603473F0060A6 /* [CP] Copy Pods Resources */ = { 191 | isa = PBXShellScriptBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | ); 195 | inputPaths = ( 196 | ); 197 | name = "[CP] Copy Pods Resources"; 198 | outputPaths = ( 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | shellPath = /bin/sh; 202 | shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-DotGPUBeautyFilterDemo/Pods-DotGPUBeautyFilterDemo-resources.sh\"\n"; 203 | showEnvVarsInLog = 0; 204 | }; 205 | 93CE8CA99DA626DB31845ED9 /* [CP] Embed Pods Frameworks */ = { 206 | isa = PBXShellScriptBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | ); 210 | inputPaths = ( 211 | ); 212 | name = "[CP] Embed Pods Frameworks"; 213 | outputPaths = ( 214 | ); 215 | runOnlyForDeploymentPostprocessing = 0; 216 | shellPath = /bin/sh; 217 | shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-DotGPUBeautyFilterDemo/Pods-DotGPUBeautyFilterDemo-frameworks.sh\"\n"; 218 | showEnvVarsInLog = 0; 219 | }; 220 | D115015BF4036F8DF67D3944 /* [CP] Check Pods Manifest.lock */ = { 221 | isa = PBXShellScriptBuildPhase; 222 | buildActionMask = 2147483647; 223 | files = ( 224 | ); 225 | inputPaths = ( 226 | ); 227 | name = "[CP] Check Pods Manifest.lock"; 228 | outputPaths = ( 229 | ); 230 | runOnlyForDeploymentPostprocessing = 0; 231 | shellPath = /bin/sh; 232 | shellScript = "diff \"${PODS_ROOT}/../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"; 233 | showEnvVarsInLog = 0; 234 | }; 235 | /* End PBXShellScriptBuildPhase section */ 236 | 237 | /* Begin PBXSourcesBuildPhase section */ 238 | F09C363C1E23D5A9009DEEC4 /* Sources */ = { 239 | isa = PBXSourcesBuildPhase; 240 | buildActionMask = 2147483647; 241 | files = ( 242 | F09C365F1E24907A009DEEC4 /* DotGPUImageBeautyFilter.m in Sources */, 243 | F09C364B1E23D5AA009DEEC4 /* ViewController.m in Sources */, 244 | F09C36481E23D5AA009DEEC4 /* AppDelegate.m in Sources */, 245 | F09C36451E23D5AA009DEEC4 /* main.m in Sources */, 246 | ); 247 | runOnlyForDeploymentPostprocessing = 0; 248 | }; 249 | /* End PBXSourcesBuildPhase section */ 250 | 251 | /* Begin PBXVariantGroup section */ 252 | F09C364C1E23D5AA009DEEC4 /* Main.storyboard */ = { 253 | isa = PBXVariantGroup; 254 | children = ( 255 | F09C364D1E23D5AA009DEEC4 /* Base */, 256 | ); 257 | name = Main.storyboard; 258 | sourceTree = ""; 259 | }; 260 | F09C36511E23D5AA009DEEC4 /* LaunchScreen.storyboard */ = { 261 | isa = PBXVariantGroup; 262 | children = ( 263 | F09C36521E23D5AA009DEEC4 /* Base */, 264 | ); 265 | name = LaunchScreen.storyboard; 266 | sourceTree = ""; 267 | }; 268 | /* End PBXVariantGroup section */ 269 | 270 | /* Begin XCBuildConfiguration section */ 271 | F09C36551E23D5AA009DEEC4 /* Debug */ = { 272 | isa = XCBuildConfiguration; 273 | buildSettings = { 274 | ALWAYS_SEARCH_USER_PATHS = NO; 275 | CLANG_ANALYZER_NONNULL = YES; 276 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 277 | CLANG_CXX_LIBRARY = "libc++"; 278 | CLANG_ENABLE_MODULES = YES; 279 | CLANG_ENABLE_OBJC_ARC = YES; 280 | CLANG_WARN_BOOL_CONVERSION = YES; 281 | CLANG_WARN_CONSTANT_CONVERSION = YES; 282 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 283 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 284 | CLANG_WARN_EMPTY_BODY = YES; 285 | CLANG_WARN_ENUM_CONVERSION = YES; 286 | CLANG_WARN_INFINITE_RECURSION = YES; 287 | CLANG_WARN_INT_CONVERSION = YES; 288 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 289 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 290 | CLANG_WARN_UNREACHABLE_CODE = YES; 291 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 292 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 293 | COPY_PHASE_STRIP = NO; 294 | DEBUG_INFORMATION_FORMAT = dwarf; 295 | ENABLE_STRICT_OBJC_MSGSEND = YES; 296 | ENABLE_TESTABILITY = YES; 297 | GCC_C_LANGUAGE_STANDARD = gnu99; 298 | GCC_DYNAMIC_NO_PIC = NO; 299 | GCC_NO_COMMON_BLOCKS = YES; 300 | GCC_OPTIMIZATION_LEVEL = 0; 301 | GCC_PREPROCESSOR_DEFINITIONS = ( 302 | "DEBUG=1", 303 | "$(inherited)", 304 | ); 305 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 306 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 307 | GCC_WARN_UNDECLARED_SELECTOR = YES; 308 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 309 | GCC_WARN_UNUSED_FUNCTION = YES; 310 | GCC_WARN_UNUSED_VARIABLE = YES; 311 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 312 | MTL_ENABLE_DEBUG_INFO = YES; 313 | ONLY_ACTIVE_ARCH = YES; 314 | SDKROOT = iphoneos; 315 | }; 316 | name = Debug; 317 | }; 318 | F09C36561E23D5AA009DEEC4 /* Release */ = { 319 | isa = XCBuildConfiguration; 320 | buildSettings = { 321 | ALWAYS_SEARCH_USER_PATHS = NO; 322 | CLANG_ANALYZER_NONNULL = YES; 323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 324 | CLANG_CXX_LIBRARY = "libc++"; 325 | CLANG_ENABLE_MODULES = YES; 326 | CLANG_ENABLE_OBJC_ARC = YES; 327 | CLANG_WARN_BOOL_CONVERSION = YES; 328 | CLANG_WARN_CONSTANT_CONVERSION = YES; 329 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 330 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 331 | CLANG_WARN_EMPTY_BODY = YES; 332 | CLANG_WARN_ENUM_CONVERSION = YES; 333 | CLANG_WARN_INFINITE_RECURSION = YES; 334 | CLANG_WARN_INT_CONVERSION = YES; 335 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 336 | CLANG_WARN_SUSPICIOUS_MOVES = YES; 337 | CLANG_WARN_UNREACHABLE_CODE = YES; 338 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 339 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 340 | COPY_PHASE_STRIP = NO; 341 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 342 | ENABLE_NS_ASSERTIONS = NO; 343 | ENABLE_STRICT_OBJC_MSGSEND = YES; 344 | GCC_C_LANGUAGE_STANDARD = gnu99; 345 | GCC_NO_COMMON_BLOCKS = YES; 346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 348 | GCC_WARN_UNDECLARED_SELECTOR = YES; 349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 350 | GCC_WARN_UNUSED_FUNCTION = YES; 351 | GCC_WARN_UNUSED_VARIABLE = YES; 352 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 353 | MTL_ENABLE_DEBUG_INFO = NO; 354 | SDKROOT = iphoneos; 355 | VALIDATE_PRODUCT = YES; 356 | }; 357 | name = Release; 358 | }; 359 | F09C36581E23D5AA009DEEC4 /* Debug */ = { 360 | isa = XCBuildConfiguration; 361 | baseConfigurationReference = C737A5941DFB90F49DF1CDA3 /* Pods-DotGPUBeautyFilterDemo.debug.xcconfig */; 362 | buildSettings = { 363 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 364 | DEVELOPMENT_TEAM = CLKRLU8RPY; 365 | INFOPLIST_FILE = DotGPUBeautyFilterDemo/Info.plist; 366 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 367 | PRODUCT_BUNDLE_IDENTIFIER = cc.dot.engine.DotGPUBeautyFilterDemo; 368 | PRODUCT_NAME = "$(TARGET_NAME)"; 369 | }; 370 | name = Debug; 371 | }; 372 | F09C36591E23D5AA009DEEC4 /* Release */ = { 373 | isa = XCBuildConfiguration; 374 | baseConfigurationReference = A3D59CCF0C7C9602D4D20E61 /* Pods-DotGPUBeautyFilterDemo.release.xcconfig */; 375 | buildSettings = { 376 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 377 | DEVELOPMENT_TEAM = CLKRLU8RPY; 378 | INFOPLIST_FILE = DotGPUBeautyFilterDemo/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 380 | PRODUCT_BUNDLE_IDENTIFIER = cc.dot.engine.DotGPUBeautyFilterDemo; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | }; 383 | name = Release; 384 | }; 385 | /* End XCBuildConfiguration section */ 386 | 387 | /* Begin XCConfigurationList section */ 388 | F09C363B1E23D5A9009DEEC4 /* Build configuration list for PBXProject "DotGPUBeautyFilterDemo" */ = { 389 | isa = XCConfigurationList; 390 | buildConfigurations = ( 391 | F09C36551E23D5AA009DEEC4 /* Debug */, 392 | F09C36561E23D5AA009DEEC4 /* Release */, 393 | ); 394 | defaultConfigurationIsVisible = 0; 395 | defaultConfigurationName = Release; 396 | }; 397 | F09C36571E23D5AA009DEEC4 /* Build configuration list for PBXNativeTarget "DotGPUBeautyFilterDemo" */ = { 398 | isa = XCConfigurationList; 399 | buildConfigurations = ( 400 | F09C36581E23D5AA009DEEC4 /* Debug */, 401 | F09C36591E23D5AA009DEEC4 /* Release */, 402 | ); 403 | defaultConfigurationIsVisible = 0; 404 | defaultConfigurationName = Release; 405 | }; 406 | /* End XCConfigurationList section */ 407 | }; 408 | rootObject = F09C36381E23D5A9009DEEC4 /* Project object */; 409 | } 410 | --------------------------------------------------------------------------------