├── .gitignore ├── GPUImage-Instagram.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── GPUImage-Instagram.xcworkspace └── contents.xcworkspacedata ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md └── Sources ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets └── AppIcon.appiconset │ └── Contents.json ├── Base.lproj ├── LaunchScreen.storyboard └── Main.storyboard ├── Filters ├── GPUImageFiveInputFilter.h ├── GPUImageFiveInputFilter.m ├── GPUImageFourInputFilter.h ├── GPUImageFourInputFilter.m ├── GPUImageSixInputFilter.h ├── GPUImageSixInputFilter.m └── Instagram │ ├── GPUImage.InstagramFilter.bundle │ ├── 1977blowout.png │ ├── 1977map.png │ ├── amaroMap.png │ ├── blackboard1024.png │ ├── brannanBlowout.png │ ├── brannanContrast.png │ ├── brannanLuma.png │ ├── brannanProcess.png │ ├── brannanScreen.png │ ├── earlyBirdCurves.png │ ├── earlybirdBlowout.png │ ├── earlybirdMap.png │ ├── earlybirdOverlayMap.png │ ├── edgeBurn.png │ ├── hefeGradientMap.png │ ├── hefeMap.png │ ├── hefeMetal.png │ ├── hefeSoftLight.png │ ├── hudsonBackground.png │ ├── hudsonMap.png │ ├── inkwellMap.png │ ├── kelvinMap.png │ ├── lomoMap.png │ ├── nashvilleMap.png │ ├── overlayMap.png │ ├── riseMap.png │ ├── sierraMap.png │ ├── sierraVignette.png │ ├── softLight.png │ ├── sutroCurves.png │ ├── sutroEdgeBurn.png │ ├── sutroMetal.png │ ├── toasterColorShift.png │ ├── toasterCurves.png │ ├── toasterMetal.png │ ├── toasterOverlayMapWarm.png │ ├── toasterSoftLight.png │ ├── valenciaGradientMap.png │ ├── valenciaMap.png │ ├── vignetteMap.png │ ├── waldenMap.png │ └── xproMap.png │ ├── IF1977Filter.h │ ├── IF1977Filter.m │ ├── IFAmaroFilter.h │ ├── IFAmaroFilter.m │ ├── IFBrannanFilter.h │ ├── IFBrannanFilter.m │ ├── IFEarlybirdFilter.h │ ├── IFEarlybirdFilter.m │ ├── IFHefeFilter.h │ ├── IFHefeFilter.m │ ├── IFHudsonFilter.h │ ├── IFHudsonFilter.m │ ├── IFImageFilter.h │ ├── IFImageFilter.m │ ├── IFInkwellFilter.h │ ├── IFInkwellFilter.m │ ├── IFLomofiFilter.h │ ├── IFLomofiFilter.m │ ├── IFLordKelvinFilter.h │ ├── IFLordKelvinFilter.m │ ├── IFNashvilleFilter.h │ ├── IFNashvilleFilter.m │ ├── IFNormalFilter.h │ ├── IFNormalFilter.m │ ├── IFRiseFilter.h │ ├── IFRiseFilter.m │ ├── IFSierraFilter.h │ ├── IFSierraFilter.m │ ├── IFSutroFilter.h │ ├── IFSutroFilter.m │ ├── IFToasterFilter.h │ ├── IFToasterFilter.m │ ├── IFValenciaFilter.h │ ├── IFValenciaFilter.m │ ├── IFWaldenFilter.h │ ├── IFWaldenFilter.m │ ├── IFXproIIFilter.h │ ├── IFXproIIFilter.m │ └── InstaFilters.h ├── Info.plist ├── ViewController.h ├── ViewController.m ├── main.m └── sample_kuru.jpg /.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 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | -------------------------------------------------------------------------------- /GPUImage-Instagram.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 0870274D1C4A080B0074E87F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870274C1C4A080B0074E87F /* main.m */; }; 11 | 087027501C4A080B0074E87F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870274F1C4A080B0074E87F /* AppDelegate.m */; }; 12 | 087027531C4A080B0074E87F /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027521C4A080B0074E87F /* ViewController.m */; }; 13 | 087027561C4A080B0074E87F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 087027541C4A080B0074E87F /* Main.storyboard */; }; 14 | 087027581C4A080B0074E87F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 087027571C4A080B0074E87F /* Assets.xcassets */; }; 15 | 0870275B1C4A080B0074E87F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 087027591C4A080B0074E87F /* LaunchScreen.storyboard */; }; 16 | 087027931C4A08F40074E87F /* GPUImageFiveInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027651C4A08F40074E87F /* GPUImageFiveInputFilter.m */; }; 17 | 087027941C4A08F40074E87F /* GPUImageFourInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027671C4A08F40074E87F /* GPUImageFourInputFilter.m */; }; 18 | 087027951C4A08F40074E87F /* GPUImageSixInputFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027691C4A08F40074E87F /* GPUImageSixInputFilter.m */; }; 19 | 087027961C4A08F40074E87F /* GPUImage.InstagramFilter.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 0870276B1C4A08F40074E87F /* GPUImage.InstagramFilter.bundle */; }; 20 | 087027971C4A08F40074E87F /* IF1977Filter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870276D1C4A08F40074E87F /* IF1977Filter.m */; }; 21 | 087027981C4A08F40074E87F /* IFAmaroFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870276F1C4A08F40074E87F /* IFAmaroFilter.m */; }; 22 | 087027991C4A08F40074E87F /* IFBrannanFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027711C4A08F40074E87F /* IFBrannanFilter.m */; }; 23 | 0870279A1C4A08F40074E87F /* IFEarlybirdFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027731C4A08F40074E87F /* IFEarlybirdFilter.m */; }; 24 | 0870279B1C4A08F40074E87F /* IFHefeFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027751C4A08F40074E87F /* IFHefeFilter.m */; }; 25 | 0870279C1C4A08F40074E87F /* IFHudsonFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027771C4A08F40074E87F /* IFHudsonFilter.m */; }; 26 | 0870279D1C4A08F40074E87F /* IFImageFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027791C4A08F40074E87F /* IFImageFilter.m */; }; 27 | 0870279E1C4A08F40074E87F /* IFInkwellFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870277B1C4A08F40074E87F /* IFInkwellFilter.m */; }; 28 | 0870279F1C4A08F40074E87F /* IFLomofiFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870277D1C4A08F40074E87F /* IFLomofiFilter.m */; }; 29 | 087027A01C4A08F40074E87F /* IFLordKelvinFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870277F1C4A08F40074E87F /* IFLordKelvinFilter.m */; }; 30 | 087027A11C4A08F40074E87F /* IFNashvilleFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027811C4A08F40074E87F /* IFNashvilleFilter.m */; }; 31 | 087027A21C4A08F40074E87F /* IFNormalFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027831C4A08F40074E87F /* IFNormalFilter.m */; }; 32 | 087027A31C4A08F40074E87F /* IFRiseFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027851C4A08F40074E87F /* IFRiseFilter.m */; }; 33 | 087027A41C4A08F40074E87F /* IFSierraFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027871C4A08F40074E87F /* IFSierraFilter.m */; }; 34 | 087027A51C4A08F40074E87F /* IFSutroFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027891C4A08F40074E87F /* IFSutroFilter.m */; }; 35 | 087027A61C4A08F40074E87F /* IFToasterFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870278B1C4A08F40074E87F /* IFToasterFilter.m */; }; 36 | 087027A71C4A08F40074E87F /* IFValenciaFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870278D1C4A08F40074E87F /* IFValenciaFilter.m */; }; 37 | 087027A81C4A08F40074E87F /* IFWaldenFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 0870278F1C4A08F40074E87F /* IFWaldenFilter.m */; }; 38 | 087027A91C4A08F40074E87F /* IFXproIIFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 087027911C4A08F40074E87F /* IFXproIIFilter.m */; }; 39 | 087027AB1C4A0BDD0074E87F /* sample_kuru.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 087027AA1C4A0BDD0074E87F /* sample_kuru.jpg */; }; 40 | 890E132316B81D8150DFF5EB /* libPods-GPUImage-Instagram.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 36BB7985052ABA6B31D58FE5 /* libPods-GPUImage-Instagram.a */; }; 41 | /* End PBXBuildFile section */ 42 | 43 | /* Begin PBXFileReference section */ 44 | 0870274C1C4A080B0074E87F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 45 | 0870274E1C4A080B0074E87F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 46 | 0870274F1C4A080B0074E87F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 47 | 087027511C4A080B0074E87F /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 48 | 087027521C4A080B0074E87F /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 49 | 087027551C4A080B0074E87F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 50 | 087027571C4A080B0074E87F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 0870275A1C4A080B0074E87F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 52 | 0870275C1C4A080B0074E87F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 53 | 087027621C4A089C0074E87F /* GPUImage-Instagram.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "GPUImage-Instagram.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 54 | 087027641C4A08F40074E87F /* GPUImageFiveInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFiveInputFilter.h; sourceTree = ""; }; 55 | 087027651C4A08F40074E87F /* GPUImageFiveInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPUImageFiveInputFilter.m; sourceTree = ""; }; 56 | 087027661C4A08F40074E87F /* GPUImageFourInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageFourInputFilter.h; sourceTree = ""; }; 57 | 087027671C4A08F40074E87F /* GPUImageFourInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPUImageFourInputFilter.m; sourceTree = ""; }; 58 | 087027681C4A08F40074E87F /* GPUImageSixInputFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GPUImageSixInputFilter.h; sourceTree = ""; }; 59 | 087027691C4A08F40074E87F /* GPUImageSixInputFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GPUImageSixInputFilter.m; sourceTree = ""; }; 60 | 0870276B1C4A08F40074E87F /* GPUImage.InstagramFilter.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = GPUImage.InstagramFilter.bundle; sourceTree = ""; }; 61 | 0870276C1C4A08F40074E87F /* IF1977Filter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IF1977Filter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 62 | 0870276D1C4A08F40074E87F /* IF1977Filter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IF1977Filter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 63 | 0870276E1C4A08F40074E87F /* IFAmaroFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFAmaroFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 64 | 0870276F1C4A08F40074E87F /* IFAmaroFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFAmaroFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 65 | 087027701C4A08F40074E87F /* IFBrannanFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFBrannanFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 66 | 087027711C4A08F40074E87F /* IFBrannanFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFBrannanFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 67 | 087027721C4A08F40074E87F /* IFEarlybirdFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFEarlybirdFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 68 | 087027731C4A08F40074E87F /* IFEarlybirdFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFEarlybirdFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 69 | 087027741C4A08F40074E87F /* IFHefeFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFHefeFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 70 | 087027751C4A08F40074E87F /* IFHefeFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFHefeFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 71 | 087027761C4A08F40074E87F /* IFHudsonFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFHudsonFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 72 | 087027771C4A08F40074E87F /* IFHudsonFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFHudsonFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 73 | 087027781C4A08F40074E87F /* IFImageFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IFImageFilter.h; sourceTree = ""; }; 74 | 087027791C4A08F40074E87F /* IFImageFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IFImageFilter.m; sourceTree = ""; }; 75 | 0870277A1C4A08F40074E87F /* IFInkwellFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFInkwellFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 76 | 0870277B1C4A08F40074E87F /* IFInkwellFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFInkwellFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 77 | 0870277C1C4A08F40074E87F /* IFLomofiFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFLomofiFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 78 | 0870277D1C4A08F40074E87F /* IFLomofiFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFLomofiFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 79 | 0870277E1C4A08F40074E87F /* IFLordKelvinFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFLordKelvinFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 80 | 0870277F1C4A08F40074E87F /* IFLordKelvinFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFLordKelvinFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 81 | 087027801C4A08F40074E87F /* IFNashvilleFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFNashvilleFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 82 | 087027811C4A08F40074E87F /* IFNashvilleFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFNashvilleFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 83 | 087027821C4A08F40074E87F /* IFNormalFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFNormalFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 84 | 087027831C4A08F40074E87F /* IFNormalFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFNormalFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 85 | 087027841C4A08F40074E87F /* IFRiseFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFRiseFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 86 | 087027851C4A08F40074E87F /* IFRiseFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFRiseFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 87 | 087027861C4A08F40074E87F /* IFSierraFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFSierraFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 88 | 087027871C4A08F40074E87F /* IFSierraFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFSierraFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 89 | 087027881C4A08F40074E87F /* IFSutroFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFSutroFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 90 | 087027891C4A08F40074E87F /* IFSutroFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFSutroFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 91 | 0870278A1C4A08F40074E87F /* IFToasterFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFToasterFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 92 | 0870278B1C4A08F40074E87F /* IFToasterFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFToasterFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 93 | 0870278C1C4A08F40074E87F /* IFValenciaFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFValenciaFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 94 | 0870278D1C4A08F40074E87F /* IFValenciaFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFValenciaFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 95 | 0870278E1C4A08F40074E87F /* IFWaldenFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFWaldenFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 96 | 0870278F1C4A08F40074E87F /* IFWaldenFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFWaldenFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 97 | 087027901C4A08F40074E87F /* IFXproIIFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = IFXproIIFilter.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 98 | 087027911C4A08F40074E87F /* IFXproIIFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = IFXproIIFilter.m; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objc; }; 99 | 087027921C4A08F40074E87F /* InstaFilters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = InstaFilters.h; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; }; 100 | 087027AA1C4A0BDD0074E87F /* sample_kuru.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = sample_kuru.jpg; sourceTree = ""; }; 101 | 2894E3A5A558DE0B88698165 /* Pods-GPUImage-Instagram.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImage-Instagram.release.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImage-Instagram/Pods-GPUImage-Instagram.release.xcconfig"; sourceTree = ""; }; 102 | 36BB7985052ABA6B31D58FE5 /* libPods-GPUImage-Instagram.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-GPUImage-Instagram.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 103 | 7FE5B12DDA3A7864BBD108F3 /* Pods-GPUImage-Instagram.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-GPUImage-Instagram.debug.xcconfig"; path = "Pods/Target Support Files/Pods-GPUImage-Instagram/Pods-GPUImage-Instagram.debug.xcconfig"; sourceTree = ""; }; 104 | /* End PBXFileReference section */ 105 | 106 | /* Begin PBXFrameworksBuildPhase section */ 107 | 087027451C4A080B0074E87F /* Frameworks */ = { 108 | isa = PBXFrameworksBuildPhase; 109 | buildActionMask = 2147483647; 110 | files = ( 111 | 890E132316B81D8150DFF5EB /* libPods-GPUImage-Instagram.a in Frameworks */, 112 | ); 113 | runOnlyForDeploymentPostprocessing = 0; 114 | }; 115 | /* End PBXFrameworksBuildPhase section */ 116 | 117 | /* Begin PBXGroup section */ 118 | 0870273F1C4A080B0074E87F = { 119 | isa = PBXGroup; 120 | children = ( 121 | 0870274A1C4A080B0074E87F /* Sources */, 122 | 0870274B1C4A080B0074E87F /* Supporting Files */, 123 | 15E34034F656401029CF8481 /* Pods */, 124 | B200E34BFD105E0A161AECDE /* Frameworks */, 125 | ); 126 | sourceTree = ""; 127 | }; 128 | 0870274A1C4A080B0074E87F /* Sources */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 087027631C4A08F40074E87F /* Filters */, 132 | 087027511C4A080B0074E87F /* ViewController.h */, 133 | 087027521C4A080B0074E87F /* ViewController.m */, 134 | 087027AA1C4A0BDD0074E87F /* sample_kuru.jpg */, 135 | ); 136 | path = Sources; 137 | sourceTree = ""; 138 | }; 139 | 0870274B1C4A080B0074E87F /* Supporting Files */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | 087027621C4A089C0074E87F /* GPUImage-Instagram.app */, 143 | 087027571C4A080B0074E87F /* Assets.xcassets */, 144 | 0870274E1C4A080B0074E87F /* AppDelegate.h */, 145 | 0870274F1C4A080B0074E87F /* AppDelegate.m */, 146 | 087027541C4A080B0074E87F /* Main.storyboard */, 147 | 087027591C4A080B0074E87F /* LaunchScreen.storyboard */, 148 | 0870275C1C4A080B0074E87F /* Info.plist */, 149 | 0870274C1C4A080B0074E87F /* main.m */, 150 | ); 151 | name = "Supporting Files"; 152 | path = Sources; 153 | sourceTree = ""; 154 | }; 155 | 087027631C4A08F40074E87F /* Filters */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 087027641C4A08F40074E87F /* GPUImageFiveInputFilter.h */, 159 | 087027651C4A08F40074E87F /* GPUImageFiveInputFilter.m */, 160 | 087027661C4A08F40074E87F /* GPUImageFourInputFilter.h */, 161 | 087027671C4A08F40074E87F /* GPUImageFourInputFilter.m */, 162 | 087027681C4A08F40074E87F /* GPUImageSixInputFilter.h */, 163 | 087027691C4A08F40074E87F /* GPUImageSixInputFilter.m */, 164 | 0870276A1C4A08F40074E87F /* Instagram */, 165 | ); 166 | path = Filters; 167 | sourceTree = ""; 168 | }; 169 | 0870276A1C4A08F40074E87F /* Instagram */ = { 170 | isa = PBXGroup; 171 | children = ( 172 | 0870276B1C4A08F40074E87F /* GPUImage.InstagramFilter.bundle */, 173 | 0870276C1C4A08F40074E87F /* IF1977Filter.h */, 174 | 0870276D1C4A08F40074E87F /* IF1977Filter.m */, 175 | 0870276E1C4A08F40074E87F /* IFAmaroFilter.h */, 176 | 0870276F1C4A08F40074E87F /* IFAmaroFilter.m */, 177 | 087027701C4A08F40074E87F /* IFBrannanFilter.h */, 178 | 087027711C4A08F40074E87F /* IFBrannanFilter.m */, 179 | 087027721C4A08F40074E87F /* IFEarlybirdFilter.h */, 180 | 087027731C4A08F40074E87F /* IFEarlybirdFilter.m */, 181 | 087027741C4A08F40074E87F /* IFHefeFilter.h */, 182 | 087027751C4A08F40074E87F /* IFHefeFilter.m */, 183 | 087027761C4A08F40074E87F /* IFHudsonFilter.h */, 184 | 087027771C4A08F40074E87F /* IFHudsonFilter.m */, 185 | 087027781C4A08F40074E87F /* IFImageFilter.h */, 186 | 087027791C4A08F40074E87F /* IFImageFilter.m */, 187 | 0870277A1C4A08F40074E87F /* IFInkwellFilter.h */, 188 | 0870277B1C4A08F40074E87F /* IFInkwellFilter.m */, 189 | 0870277C1C4A08F40074E87F /* IFLomofiFilter.h */, 190 | 0870277D1C4A08F40074E87F /* IFLomofiFilter.m */, 191 | 0870277E1C4A08F40074E87F /* IFLordKelvinFilter.h */, 192 | 0870277F1C4A08F40074E87F /* IFLordKelvinFilter.m */, 193 | 087027801C4A08F40074E87F /* IFNashvilleFilter.h */, 194 | 087027811C4A08F40074E87F /* IFNashvilleFilter.m */, 195 | 087027821C4A08F40074E87F /* IFNormalFilter.h */, 196 | 087027831C4A08F40074E87F /* IFNormalFilter.m */, 197 | 087027841C4A08F40074E87F /* IFRiseFilter.h */, 198 | 087027851C4A08F40074E87F /* IFRiseFilter.m */, 199 | 087027861C4A08F40074E87F /* IFSierraFilter.h */, 200 | 087027871C4A08F40074E87F /* IFSierraFilter.m */, 201 | 087027881C4A08F40074E87F /* IFSutroFilter.h */, 202 | 087027891C4A08F40074E87F /* IFSutroFilter.m */, 203 | 0870278A1C4A08F40074E87F /* IFToasterFilter.h */, 204 | 0870278B1C4A08F40074E87F /* IFToasterFilter.m */, 205 | 0870278C1C4A08F40074E87F /* IFValenciaFilter.h */, 206 | 0870278D1C4A08F40074E87F /* IFValenciaFilter.m */, 207 | 0870278E1C4A08F40074E87F /* IFWaldenFilter.h */, 208 | 0870278F1C4A08F40074E87F /* IFWaldenFilter.m */, 209 | 087027901C4A08F40074E87F /* IFXproIIFilter.h */, 210 | 087027911C4A08F40074E87F /* IFXproIIFilter.m */, 211 | 087027921C4A08F40074E87F /* InstaFilters.h */, 212 | ); 213 | path = Instagram; 214 | sourceTree = ""; 215 | }; 216 | 15E34034F656401029CF8481 /* Pods */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 7FE5B12DDA3A7864BBD108F3 /* Pods-GPUImage-Instagram.debug.xcconfig */, 220 | 2894E3A5A558DE0B88698165 /* Pods-GPUImage-Instagram.release.xcconfig */, 221 | ); 222 | name = Pods; 223 | sourceTree = ""; 224 | }; 225 | B200E34BFD105E0A161AECDE /* Frameworks */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 36BB7985052ABA6B31D58FE5 /* libPods-GPUImage-Instagram.a */, 229 | ); 230 | name = Frameworks; 231 | sourceTree = ""; 232 | }; 233 | /* End PBXGroup section */ 234 | 235 | /* Begin PBXNativeTarget section */ 236 | 087027471C4A080B0074E87F /* GPUImage-Instagram */ = { 237 | isa = PBXNativeTarget; 238 | buildConfigurationList = 0870275F1C4A080B0074E87F /* Build configuration list for PBXNativeTarget "GPUImage-Instagram" */; 239 | buildPhases = ( 240 | 38740944DDE9268B356ABA76 /* Check Pods Manifest.lock */, 241 | 087027441C4A080B0074E87F /* Sources */, 242 | 087027451C4A080B0074E87F /* Frameworks */, 243 | 087027461C4A080B0074E87F /* Resources */, 244 | 5AE4C56AB548A6D1BCEC1A70 /* Embed Pods Frameworks */, 245 | 8ECAAA221FB2D64D3AADF1FB /* Copy Pods Resources */, 246 | ); 247 | buildRules = ( 248 | ); 249 | dependencies = ( 250 | ); 251 | name = "GPUImage-Instagram"; 252 | productName = "GPUImage-Instagram"; 253 | productReference = 087027621C4A089C0074E87F /* GPUImage-Instagram.app */; 254 | productType = "com.apple.product-type.application"; 255 | }; 256 | /* End PBXNativeTarget section */ 257 | 258 | /* Begin PBXProject section */ 259 | 087027401C4A080B0074E87F /* Project object */ = { 260 | isa = PBXProject; 261 | attributes = { 262 | LastUpgradeCheck = 0710; 263 | ORGANIZATIONNAME = KimDaewook; 264 | TargetAttributes = { 265 | 087027471C4A080B0074E87F = { 266 | CreatedOnToolsVersion = 7.1; 267 | }; 268 | }; 269 | }; 270 | buildConfigurationList = 087027431C4A080B0074E87F /* Build configuration list for PBXProject "GPUImage-Instagram" */; 271 | compatibilityVersion = "Xcode 3.2"; 272 | developmentRegion = English; 273 | hasScannedForEncodings = 0; 274 | knownRegions = ( 275 | en, 276 | Base, 277 | ); 278 | mainGroup = 0870273F1C4A080B0074E87F; 279 | productRefGroup = 0870273F1C4A080B0074E87F; 280 | projectDirPath = ""; 281 | projectRoot = ""; 282 | targets = ( 283 | 087027471C4A080B0074E87F /* GPUImage-Instagram */, 284 | ); 285 | }; 286 | /* End PBXProject section */ 287 | 288 | /* Begin PBXResourcesBuildPhase section */ 289 | 087027461C4A080B0074E87F /* Resources */ = { 290 | isa = PBXResourcesBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | 087027961C4A08F40074E87F /* GPUImage.InstagramFilter.bundle in Resources */, 294 | 087027AB1C4A0BDD0074E87F /* sample_kuru.jpg in Resources */, 295 | 0870275B1C4A080B0074E87F /* LaunchScreen.storyboard in Resources */, 296 | 087027581C4A080B0074E87F /* Assets.xcassets in Resources */, 297 | 087027561C4A080B0074E87F /* Main.storyboard in Resources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXResourcesBuildPhase section */ 302 | 303 | /* Begin PBXShellScriptBuildPhase section */ 304 | 38740944DDE9268B356ABA76 /* Check Pods Manifest.lock */ = { 305 | isa = PBXShellScriptBuildPhase; 306 | buildActionMask = 2147483647; 307 | files = ( 308 | ); 309 | inputPaths = ( 310 | ); 311 | name = "Check Pods Manifest.lock"; 312 | outputPaths = ( 313 | ); 314 | runOnlyForDeploymentPostprocessing = 0; 315 | shellPath = /bin/sh; 316 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 317 | showEnvVarsInLog = 0; 318 | }; 319 | 5AE4C56AB548A6D1BCEC1A70 /* Embed Pods Frameworks */ = { 320 | isa = PBXShellScriptBuildPhase; 321 | buildActionMask = 2147483647; 322 | files = ( 323 | ); 324 | inputPaths = ( 325 | ); 326 | name = "Embed Pods Frameworks"; 327 | outputPaths = ( 328 | ); 329 | runOnlyForDeploymentPostprocessing = 0; 330 | shellPath = /bin/sh; 331 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImage-Instagram/Pods-GPUImage-Instagram-frameworks.sh\"\n"; 332 | showEnvVarsInLog = 0; 333 | }; 334 | 8ECAAA221FB2D64D3AADF1FB /* Copy Pods Resources */ = { 335 | isa = PBXShellScriptBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | ); 339 | inputPaths = ( 340 | ); 341 | name = "Copy Pods Resources"; 342 | outputPaths = ( 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | shellPath = /bin/sh; 346 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-GPUImage-Instagram/Pods-GPUImage-Instagram-resources.sh\"\n"; 347 | showEnvVarsInLog = 0; 348 | }; 349 | /* End PBXShellScriptBuildPhase section */ 350 | 351 | /* Begin PBXSourcesBuildPhase section */ 352 | 087027441C4A080B0074E87F /* Sources */ = { 353 | isa = PBXSourcesBuildPhase; 354 | buildActionMask = 2147483647; 355 | files = ( 356 | 087027A31C4A08F40074E87F /* IFRiseFilter.m in Sources */, 357 | 087027951C4A08F40074E87F /* GPUImageSixInputFilter.m in Sources */, 358 | 087027A51C4A08F40074E87F /* IFSutroFilter.m in Sources */, 359 | 0870279C1C4A08F40074E87F /* IFHudsonFilter.m in Sources */, 360 | 0870279F1C4A08F40074E87F /* IFLomofiFilter.m in Sources */, 361 | 087027531C4A080B0074E87F /* ViewController.m in Sources */, 362 | 0870279E1C4A08F40074E87F /* IFInkwellFilter.m in Sources */, 363 | 087027941C4A08F40074E87F /* GPUImageFourInputFilter.m in Sources */, 364 | 087027501C4A080B0074E87F /* AppDelegate.m in Sources */, 365 | 087027971C4A08F40074E87F /* IF1977Filter.m in Sources */, 366 | 0870279A1C4A08F40074E87F /* IFEarlybirdFilter.m in Sources */, 367 | 087027A71C4A08F40074E87F /* IFValenciaFilter.m in Sources */, 368 | 087027A41C4A08F40074E87F /* IFSierraFilter.m in Sources */, 369 | 087027991C4A08F40074E87F /* IFBrannanFilter.m in Sources */, 370 | 0870279D1C4A08F40074E87F /* IFImageFilter.m in Sources */, 371 | 0870274D1C4A080B0074E87F /* main.m in Sources */, 372 | 0870279B1C4A08F40074E87F /* IFHefeFilter.m in Sources */, 373 | 087027A21C4A08F40074E87F /* IFNormalFilter.m in Sources */, 374 | 087027931C4A08F40074E87F /* GPUImageFiveInputFilter.m in Sources */, 375 | 087027A91C4A08F40074E87F /* IFXproIIFilter.m in Sources */, 376 | 087027A81C4A08F40074E87F /* IFWaldenFilter.m in Sources */, 377 | 087027A11C4A08F40074E87F /* IFNashvilleFilter.m in Sources */, 378 | 087027A01C4A08F40074E87F /* IFLordKelvinFilter.m in Sources */, 379 | 087027981C4A08F40074E87F /* IFAmaroFilter.m in Sources */, 380 | 087027A61C4A08F40074E87F /* IFToasterFilter.m in Sources */, 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | }; 384 | /* End PBXSourcesBuildPhase section */ 385 | 386 | /* Begin PBXVariantGroup section */ 387 | 087027541C4A080B0074E87F /* Main.storyboard */ = { 388 | isa = PBXVariantGroup; 389 | children = ( 390 | 087027551C4A080B0074E87F /* Base */, 391 | ); 392 | name = Main.storyboard; 393 | sourceTree = ""; 394 | }; 395 | 087027591C4A080B0074E87F /* LaunchScreen.storyboard */ = { 396 | isa = PBXVariantGroup; 397 | children = ( 398 | 0870275A1C4A080B0074E87F /* Base */, 399 | ); 400 | name = LaunchScreen.storyboard; 401 | sourceTree = ""; 402 | }; 403 | /* End PBXVariantGroup section */ 404 | 405 | /* Begin XCBuildConfiguration section */ 406 | 0870275D1C4A080B0074E87F /* Debug */ = { 407 | isa = XCBuildConfiguration; 408 | buildSettings = { 409 | ALWAYS_SEARCH_USER_PATHS = NO; 410 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 411 | CLANG_CXX_LIBRARY = "libc++"; 412 | CLANG_ENABLE_MODULES = YES; 413 | CLANG_ENABLE_OBJC_ARC = YES; 414 | CLANG_WARN_BOOL_CONVERSION = YES; 415 | CLANG_WARN_CONSTANT_CONVERSION = YES; 416 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 417 | CLANG_WARN_EMPTY_BODY = YES; 418 | CLANG_WARN_ENUM_CONVERSION = YES; 419 | CLANG_WARN_INT_CONVERSION = YES; 420 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 421 | CLANG_WARN_UNREACHABLE_CODE = YES; 422 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 423 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 424 | COPY_PHASE_STRIP = NO; 425 | DEBUG_INFORMATION_FORMAT = dwarf; 426 | ENABLE_STRICT_OBJC_MSGSEND = YES; 427 | ENABLE_TESTABILITY = YES; 428 | GCC_C_LANGUAGE_STANDARD = gnu99; 429 | GCC_DYNAMIC_NO_PIC = NO; 430 | GCC_NO_COMMON_BLOCKS = YES; 431 | GCC_OPTIMIZATION_LEVEL = 0; 432 | GCC_PREPROCESSOR_DEFINITIONS = ( 433 | "DEBUG=1", 434 | "$(inherited)", 435 | ); 436 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 437 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 438 | GCC_WARN_UNDECLARED_SELECTOR = YES; 439 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 440 | GCC_WARN_UNUSED_FUNCTION = YES; 441 | GCC_WARN_UNUSED_VARIABLE = YES; 442 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 443 | MTL_ENABLE_DEBUG_INFO = YES; 444 | ONLY_ACTIVE_ARCH = YES; 445 | SDKROOT = iphoneos; 446 | TARGETED_DEVICE_FAMILY = "1,2"; 447 | }; 448 | name = Debug; 449 | }; 450 | 0870275E1C4A080B0074E87F /* Release */ = { 451 | isa = XCBuildConfiguration; 452 | buildSettings = { 453 | ALWAYS_SEARCH_USER_PATHS = NO; 454 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 455 | CLANG_CXX_LIBRARY = "libc++"; 456 | CLANG_ENABLE_MODULES = YES; 457 | CLANG_ENABLE_OBJC_ARC = YES; 458 | CLANG_WARN_BOOL_CONVERSION = YES; 459 | CLANG_WARN_CONSTANT_CONVERSION = YES; 460 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 461 | CLANG_WARN_EMPTY_BODY = YES; 462 | CLANG_WARN_ENUM_CONVERSION = YES; 463 | CLANG_WARN_INT_CONVERSION = YES; 464 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 465 | CLANG_WARN_UNREACHABLE_CODE = YES; 466 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 467 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 468 | COPY_PHASE_STRIP = NO; 469 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 470 | ENABLE_NS_ASSERTIONS = NO; 471 | ENABLE_STRICT_OBJC_MSGSEND = YES; 472 | GCC_C_LANGUAGE_STANDARD = gnu99; 473 | GCC_NO_COMMON_BLOCKS = YES; 474 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 475 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 476 | GCC_WARN_UNDECLARED_SELECTOR = YES; 477 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 478 | GCC_WARN_UNUSED_FUNCTION = YES; 479 | GCC_WARN_UNUSED_VARIABLE = YES; 480 | IPHONEOS_DEPLOYMENT_TARGET = 9.1; 481 | MTL_ENABLE_DEBUG_INFO = NO; 482 | SDKROOT = iphoneos; 483 | TARGETED_DEVICE_FAMILY = "1,2"; 484 | VALIDATE_PRODUCT = YES; 485 | }; 486 | name = Release; 487 | }; 488 | 087027601C4A080B0074E87F /* Debug */ = { 489 | isa = XCBuildConfiguration; 490 | baseConfigurationReference = 7FE5B12DDA3A7864BBD108F3 /* Pods-GPUImage-Instagram.debug.xcconfig */; 491 | buildSettings = { 492 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 493 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 494 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 495 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 496 | PRODUCT_BUNDLE_IDENTIFIER = "works.useless.GPUImage-Instagram"; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | }; 499 | name = Debug; 500 | }; 501 | 087027611C4A080B0074E87F /* Release */ = { 502 | isa = XCBuildConfiguration; 503 | baseConfigurationReference = 2894E3A5A558DE0B88698165 /* Pods-GPUImage-Instagram.release.xcconfig */; 504 | buildSettings = { 505 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 506 | INFOPLIST_FILE = "$(SRCROOT)/Sources/Info.plist"; 507 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 508 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 509 | PRODUCT_BUNDLE_IDENTIFIER = "works.useless.GPUImage-Instagram"; 510 | PRODUCT_NAME = "$(TARGET_NAME)"; 511 | }; 512 | name = Release; 513 | }; 514 | /* End XCBuildConfiguration section */ 515 | 516 | /* Begin XCConfigurationList section */ 517 | 087027431C4A080B0074E87F /* Build configuration list for PBXProject "GPUImage-Instagram" */ = { 518 | isa = XCConfigurationList; 519 | buildConfigurations = ( 520 | 0870275D1C4A080B0074E87F /* Debug */, 521 | 0870275E1C4A080B0074E87F /* Release */, 522 | ); 523 | defaultConfigurationIsVisible = 0; 524 | defaultConfigurationName = Release; 525 | }; 526 | 0870275F1C4A080B0074E87F /* Build configuration list for PBXNativeTarget "GPUImage-Instagram" */ = { 527 | isa = XCConfigurationList; 528 | buildConfigurations = ( 529 | 087027601C4A080B0074E87F /* Debug */, 530 | 087027611C4A080B0074E87F /* Release */, 531 | ); 532 | defaultConfigurationIsVisible = 0; 533 | defaultConfigurationName = Release; 534 | }; 535 | /* End XCConfigurationList section */ 536 | }; 537 | rootObject = 087027401C4A080B0074E87F /* Project object */; 538 | } 539 | -------------------------------------------------------------------------------- /GPUImage-Instagram.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /GPUImage-Instagram.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016, DaeWook, Kim 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '8.0' 3 | # Uncomment this line if you're using Swift 4 | # use_frameworks! 5 | 6 | target 'GPUImage-Instagram' do 7 | pod 'GPUImage' 8 | end 9 | 10 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - GPUImage (0.1.7) 3 | 4 | DEPENDENCIES: 5 | - GPUImage 6 | 7 | SPEC CHECKSUMS: 8 | GPUImage: 733a5f0fab92df9de1c37ba9df520a833ccb406d 9 | 10 | COCOAPODS: 0.39.0 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # GPUImage-Instagram 2 | 3 | **GPUImage-Instagram** is an (almost) fully fledged open sourced implementation of Instagram's real-time filters view controller. It implements Instagram's 17 real-time filters. GPUImage-Instagram is based on **diwu/InstaFilters**. 4 | but **diwu/InstaFilters** repository is no longer maintenance. So i just create new repository and optimize some code. 5 | 6 | ###Filters Gallery 7 | 8 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370893/af3d7c7e-bc65-11e5-9928-2c85c3e38185.png) 9 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370896/afb11382-bc65-11e5-9d97-2c02106dce04.png) 10 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370894/af675d6e-bc65-11e5-893c-881d37a4729a.png) 11 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370895/af907e9c-bc65-11e5-9785-a523a259e66c.png) 12 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370897/afba1bc6-bc65-11e5-8c58-ba6b8676048c.png) 13 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370898/afe4d4e2-bc65-11e5-9ab1-a392c617cdf8.png) 14 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370899/aff1eb28-bc65-11e5-96bb-05d6e7ddd557.png) 15 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370900/b01739be-bc65-11e5-820b-5cc4eafbc2a4.png) 16 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370901/b0b261aa-bc65-11e5-9a73-8d89f25d82c6.png) 17 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370903/b167515a-bc65-11e5-868b-9098517099e1.png) 18 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370906/b1a5351a-bc65-11e5-9010-e1942f868009.png) 19 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370902/b1564b80-bc65-11e5-9766-471f997f2edd.png) 20 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370904/b16ace16-bc65-11e5-9e86-308dd557c3b4.png) 21 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370905/b18cc02a-bc65-11e5-9af3-d0ed1638fe9b.png) 22 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370907/b1b31522-bc65-11e5-9969-6046103854fe.png) 23 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370908/b1b36b4e-bc65-11e5-837d-120144ffac61.png) 24 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370910/b1dc1080-bc65-11e5-8073-38e9e9f7169f.png) 25 | ![filters](https://cloud.githubusercontent.com/assets/4777605/12370911/b559baa0-bc65-11e5-98fa-21049030b3c2.png) 26 | 27 | 28 | ### Yes It's A Hack 29 | The most important part, the OpenGL ES shader files and color mapping files that are critical to all those beautiful colors and effects of real-time video filtering, are literally hacked from the Instagram app. But no, the hacking is not difficult, since Instagram hardly spent any effort in hiding them before they released their 2.1 version. 30 | 31 | ###Requirements 32 | 1. iOS 6.0+ 33 | 2. GPUImage (https://github.com/BradLarson/GPUImage) 34 | 35 | ###License 36 | Since it's a hack, literally. There's no way you could use those Instagram recipes in your project. But feel free to learn from them. Other than that part, you are welcome to use and distribute this project. 37 | -------------------------------------------------------------------------------- /Sources/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by KimDaeWook on 1/16/16. 6 | // Copyright © 2016 KimDaewook. 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/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by KimDaeWook on 1/16/16. 6 | // Copyright © 2016 KimDaewook. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Sources/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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /Sources/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 | -------------------------------------------------------------------------------- /Sources/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 27 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageFiveInputFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFifthInputFilter.h 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/27. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import "GPUImageFourInputFilter.h" 10 | 11 | extern NSString *const kGPUImageFiveInputTextureVertexShaderString; 12 | 13 | @interface GPUImageFiveInputFilter : GPUImageFourInputFilter 14 | { 15 | GPUImageFramebuffer *fifthInputFramebuffer; 16 | 17 | GLint filterFifthTextureCoordinateAttribute; 18 | GLint filterInputTextureUniform5; 19 | GPUImageRotationMode inputRotation5; 20 | GLuint filterSourceTexture5; 21 | CMTime fifthFrameTime; 22 | 23 | BOOL hasSetFourthTexture, hasReceivedFifthFrame, fifthFrameWasVideo; 24 | BOOL fifthFrameCheckDisabled; 25 | } 26 | 27 | - (void)disableFifthFrameCheck; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageFiveInputFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFifthInputFilter.m 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/27. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import "GPUImageFiveInputFilter.h" 10 | 11 | NSString *const kGPUImageFiveInputTextureVertexShaderString = SHADER_STRING 12 | ( 13 | attribute vec4 position; 14 | attribute vec4 inputTextureCoordinate; 15 | attribute vec4 inputTextureCoordinate2; 16 | attribute vec4 inputTextureCoordinate3; 17 | attribute vec4 inputTextureCoordinate4; 18 | attribute vec4 inputTextureCoordinate5; 19 | 20 | varying vec2 textureCoordinate; 21 | varying vec2 textureCoordinate2; 22 | varying vec2 textureCoordinate3; 23 | varying vec2 textureCoordinate4; 24 | varying vec2 textureCoordinate5; 25 | 26 | void main() 27 | { 28 | gl_Position = position; 29 | textureCoordinate = inputTextureCoordinate.xy; 30 | textureCoordinate2 = inputTextureCoordinate2.xy; 31 | textureCoordinate3 = inputTextureCoordinate3.xy; 32 | textureCoordinate4 = inputTextureCoordinate4.xy; 33 | textureCoordinate5 = inputTextureCoordinate5.xy; 34 | } 35 | ); 36 | 37 | @implementation GPUImageFiveInputFilter 38 | 39 | #pragma mark - Initialization and teardown 40 | 41 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString 42 | { 43 | if (!(self = [self initWithVertexShaderFromString:kGPUImageFiveInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) 44 | { 45 | return nil; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString 52 | { 53 | if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) 54 | { 55 | return nil; 56 | } 57 | 58 | inputRotation5 = kGPUImageNoRotation; 59 | 60 | hasSetFourthTexture = NO; 61 | 62 | hasReceivedFifthFrame = NO; 63 | fifthFrameWasVideo = NO; 64 | fifthFrameCheckDisabled = NO; 65 | 66 | fifthFrameTime = kCMTimeInvalid; 67 | 68 | runSynchronouslyOnVideoProcessingQueue(^{ 69 | [GPUImageContext useImageProcessingContext]; 70 | filterFifthTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate5"]; 71 | 72 | filterInputTextureUniform5 = [filterProgram uniformIndex:@"inputImageTexture5"]; // This does assume a name of "inputImageTexture5" for the third input texture in the fragment shader 73 | glEnableVertexAttribArray(filterFifthTextureCoordinateAttribute); 74 | }); 75 | 76 | return self; 77 | } 78 | 79 | - (void)initializeAttributes 80 | { 81 | [super initializeAttributes]; 82 | [filterProgram addAttribute:@"inputTextureCoordinate5"]; 83 | } 84 | 85 | - (void)disableFifthFrameCheck 86 | { 87 | fifthFrameCheckDisabled = YES; 88 | } 89 | 90 | #pragma mark - Rendering 91 | 92 | - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates 93 | { 94 | if (self.preventRendering) 95 | { 96 | [firstInputFramebuffer unlock]; 97 | [secondInputFramebuffer unlock]; 98 | [thirdInputFramebuffer unlock]; 99 | [fourthInputFramebuffer unlock]; 100 | [fifthInputFramebuffer unlock]; 101 | return; 102 | } 103 | 104 | [GPUImageContext setActiveShaderProgram:filterProgram]; 105 | outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; 106 | [outputFramebuffer activateFramebuffer]; 107 | if (usingNextFrameForImageCapture) 108 | { 109 | [outputFramebuffer lock]; 110 | } 111 | 112 | [self setUniformsForProgramAtIndex:0]; 113 | 114 | glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); 115 | glClear(GL_COLOR_BUFFER_BIT); 116 | 117 | glActiveTexture(GL_TEXTURE2); 118 | glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); 119 | glUniform1i(filterInputTextureUniform, 2); 120 | 121 | glActiveTexture(GL_TEXTURE3); 122 | glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); 123 | glUniform1i(filterInputTextureUniform2, 3); 124 | 125 | glActiveTexture(GL_TEXTURE4); 126 | glBindTexture(GL_TEXTURE_2D, [thirdInputFramebuffer texture]); 127 | glUniform1i(filterInputTextureUniform3, 4); 128 | 129 | glActiveTexture(GL_TEXTURE5); 130 | glBindTexture(GL_TEXTURE_2D, [fourthInputFramebuffer texture]); 131 | glUniform1i(filterInputTextureUniform4, 5); 132 | 133 | glActiveTexture(GL_TEXTURE6); 134 | glBindTexture(GL_TEXTURE_2D, [fifthInputFramebuffer texture]); 135 | glUniform1i(filterInputTextureUniform5, 6); 136 | 137 | glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); 138 | glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); 139 | glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); 140 | glVertexAttribPointer(filterThirdTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation3]); 141 | glVertexAttribPointer(filterFourthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation4]); 142 | glVertexAttribPointer(filterFifthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation5]); 143 | 144 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 145 | [firstInputFramebuffer unlock]; 146 | [secondInputFramebuffer unlock]; 147 | [thirdInputFramebuffer unlock]; 148 | [fourthInputFramebuffer unlock]; 149 | [fifthInputFramebuffer unlock]; 150 | if (usingNextFrameForImageCapture) 151 | { 152 | dispatch_semaphore_signal(imageCaptureSemaphore); 153 | } 154 | } 155 | 156 | #pragma mark - GPUImageInput 157 | 158 | - (NSInteger)nextAvailableTextureIndex 159 | { 160 | if (hasSetFourthTexture) { 161 | return 4; 162 | } else if (hasSetThirdTexture) { 163 | return 3; 164 | } else if (hasSetSecondTexture) { 165 | return 2; 166 | } else if (hasSetFirstTexture) { 167 | return 1; 168 | } else { 169 | return 0; 170 | } 171 | } 172 | 173 | - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex 174 | { 175 | if (textureIndex == 0) { 176 | firstInputFramebuffer = newInputFramebuffer; 177 | hasSetFirstTexture = YES; 178 | [firstInputFramebuffer lock]; 179 | } else if (textureIndex == 1) { 180 | secondInputFramebuffer = newInputFramebuffer; 181 | hasSetSecondTexture = YES; 182 | [secondInputFramebuffer lock]; 183 | } else if (textureIndex == 2) { 184 | thirdInputFramebuffer = newInputFramebuffer; 185 | hasSetThirdTexture = YES; 186 | [thirdInputFramebuffer lock]; 187 | } else if (textureIndex == 3) { 188 | fourthInputFramebuffer = newInputFramebuffer; 189 | hasSetFourthTexture = YES; 190 | [fourthInputFramebuffer lock]; 191 | } else { 192 | fifthInputFramebuffer = newInputFramebuffer; 193 | [fifthInputFramebuffer lock]; 194 | } 195 | } 196 | 197 | - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex 198 | { 199 | if (textureIndex == 0) { 200 | [super setInputSize:newSize atIndex:textureIndex]; 201 | 202 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 203 | hasSetFirstTexture = NO; 204 | } 205 | } else if (textureIndex == 1) { 206 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 207 | hasSetSecondTexture = NO; 208 | } 209 | } else if (textureIndex == 2) { 210 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 211 | hasSetThirdTexture = NO; 212 | } 213 | } else if (textureIndex == 3) { 214 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 215 | hasSetFourthTexture = NO; 216 | } 217 | } 218 | } 219 | 220 | - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex 221 | { 222 | if (textureIndex == 0) { 223 | inputRotation = newInputRotation; 224 | } else if (textureIndex == 1) { 225 | inputRotation2 = newInputRotation; 226 | } else if (textureIndex == 2){ 227 | inputRotation3 = newInputRotation; 228 | } else if (textureIndex == 3) { 229 | inputRotation4 = newInputRotation; 230 | } else { 231 | inputRotation5 = newInputRotation; 232 | } 233 | } 234 | 235 | - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex 236 | { 237 | CGSize rotatedSize = sizeToRotate; 238 | 239 | GPUImageRotationMode rotationToCheck; 240 | if (textureIndex == 0) { 241 | rotationToCheck = inputRotation; 242 | } else if (textureIndex == 1) { 243 | rotationToCheck = inputRotation2; 244 | } else if (textureIndex == 2) { 245 | rotationToCheck = inputRotation3; 246 | } else if (textureIndex == 3) { 247 | rotationToCheck = inputRotation4; 248 | } else { 249 | rotationToCheck = inputRotation5; 250 | } 251 | 252 | if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { 253 | rotatedSize.width = sizeToRotate.height; 254 | rotatedSize.height = sizeToRotate.width; 255 | } 256 | 257 | return rotatedSize; 258 | } 259 | 260 | - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex 261 | { 262 | // You can set up infinite update loops, so this helps to short circuit them 263 | if (hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame && hasReceivedFifthFrame) 264 | { 265 | return; 266 | } 267 | 268 | BOOL updatedMovieFrameOppositeStillImage = NO; 269 | 270 | if (textureIndex == 0) { 271 | hasReceivedFirstFrame = YES; 272 | firstFrameTime = frameTime; 273 | if (secondFrameCheckDisabled) { 274 | hasReceivedSecondFrame = YES; 275 | } 276 | if (thirdFrameCheckDisabled) { 277 | hasReceivedThirdFrame = YES; 278 | } 279 | if (fourthFrameCheckDisabled) { 280 | hasReceivedFourthFrame = YES; 281 | } 282 | if (fifthFrameCheckDisabled) { 283 | hasReceivedFifthFrame = YES; 284 | } 285 | 286 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 287 | if CMTIME_IS_INDEFINITE(secondFrameTime) { 288 | updatedMovieFrameOppositeStillImage = YES; 289 | } 290 | } 291 | } else if (textureIndex == 1) { 292 | hasReceivedSecondFrame = YES; 293 | secondFrameTime = frameTime; 294 | if (firstFrameCheckDisabled) { 295 | hasReceivedFirstFrame = YES; 296 | } 297 | if (thirdFrameCheckDisabled) { 298 | hasReceivedThirdFrame = YES; 299 | } 300 | if (fourthFrameCheckDisabled) { 301 | hasReceivedFourthFrame = YES; 302 | } 303 | if (fifthFrameCheckDisabled) { 304 | hasReceivedFifthFrame = YES; 305 | } 306 | 307 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 308 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 309 | updatedMovieFrameOppositeStillImage = YES; 310 | } 311 | } 312 | } else if (textureIndex == 2) { 313 | hasReceivedThirdFrame = YES; 314 | thirdFrameTime = frameTime; 315 | if (firstFrameCheckDisabled) { 316 | hasReceivedFirstFrame = YES; 317 | } 318 | if (secondFrameCheckDisabled) { 319 | hasReceivedSecondFrame = YES; 320 | } 321 | if (fourthFrameCheckDisabled) { 322 | hasReceivedFourthFrame = YES; 323 | } 324 | if (fifthFrameCheckDisabled) { 325 | hasReceivedFifthFrame = YES; 326 | } 327 | 328 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 329 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 330 | updatedMovieFrameOppositeStillImage = YES; 331 | } 332 | } 333 | } else if (textureIndex == 3) { 334 | hasReceivedFourthFrame = YES; 335 | fourthFrameTime = frameTime; 336 | if (firstFrameCheckDisabled) { 337 | hasReceivedFirstFrame = YES; 338 | } 339 | if (secondFrameCheckDisabled) { 340 | hasReceivedSecondFrame = YES; 341 | } 342 | if (thirdFrameCheckDisabled) { 343 | hasReceivedThirdFrame = YES; 344 | } 345 | if (fifthFrameCheckDisabled) { 346 | hasReceivedFifthFrame = YES; 347 | } 348 | 349 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 350 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 351 | updatedMovieFrameOppositeStillImage = YES; 352 | } 353 | } 354 | } else { 355 | hasReceivedFifthFrame = YES; 356 | fifthFrameTime = frameTime; 357 | if (firstFrameCheckDisabled) { 358 | hasReceivedFirstFrame = YES; 359 | } 360 | if (secondFrameCheckDisabled) { 361 | hasReceivedSecondFrame = YES; 362 | } 363 | if (thirdFrameCheckDisabled) { 364 | hasReceivedThirdFrame = YES; 365 | } 366 | if (fourthFrameCheckDisabled) { 367 | hasReceivedFourthFrame = YES; 368 | } 369 | 370 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 371 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 372 | updatedMovieFrameOppositeStillImage = YES; 373 | } 374 | } 375 | } 376 | 377 | // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) 378 | if ((hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame && hasReceivedFifthFrame) || updatedMovieFrameOppositeStillImage) 379 | { 380 | static const GLfloat imageVertices[] = { 381 | -1.0f, -1.0f, 382 | 1.0f, -1.0f, 383 | -1.0f, 1.0f, 384 | 1.0f, 1.0f, 385 | }; 386 | 387 | [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; 388 | 389 | [self informTargetsAboutNewFrameAtTime:frameTime]; 390 | 391 | hasReceivedFirstFrame = NO; 392 | hasReceivedSecondFrame = NO; 393 | hasReceivedThirdFrame = NO; 394 | hasReceivedFourthFrame = NO; 395 | hasReceivedFifthFrame = NO; 396 | } 397 | } 398 | 399 | @end 400 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageFourInputFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFourInputFilter.h 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/26. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | extern NSString *const kGPUImageFourInputTextureVertexShaderString; 12 | 13 | @interface GPUImageFourInputFilter : GPUImageThreeInputFilter 14 | { 15 | GPUImageFramebuffer *fourthInputFramebuffer; 16 | 17 | GLint filterFourthTextureCoordinateAttribute; 18 | GLint filterInputTextureUniform4; 19 | GPUImageRotationMode inputRotation4; 20 | GLuint filterSourceTexture4; 21 | CMTime fourthFrameTime; 22 | 23 | BOOL hasSetThirdTexture, hasReceivedFourthFrame, fourthFrameWasVideo; 24 | BOOL fourthFrameCheckDisabled; 25 | } 26 | 27 | - (void)disableFourthFrameCheck; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageFourInputFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageFourInputFilter.m 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/26. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import "GPUImageFourInputFilter.h" 10 | 11 | NSString *const kGPUImageFourInputTextureVertexShaderString = SHADER_STRING 12 | ( 13 | attribute vec4 position; 14 | attribute vec4 inputTextureCoordinate; 15 | attribute vec4 inputTextureCoordinate2; 16 | attribute vec4 inputTextureCoordinate3; 17 | attribute vec4 inputTextureCoordinate4; 18 | 19 | varying vec2 textureCoordinate; 20 | varying vec2 textureCoordinate2; 21 | varying vec2 textureCoordinate3; 22 | varying vec2 textureCoordinate4; 23 | 24 | void main() 25 | { 26 | gl_Position = position; 27 | textureCoordinate = inputTextureCoordinate.xy; 28 | textureCoordinate2 = inputTextureCoordinate2.xy; 29 | textureCoordinate3 = inputTextureCoordinate3.xy; 30 | textureCoordinate4 = inputTextureCoordinate4.xy; 31 | } 32 | ); 33 | 34 | @implementation GPUImageFourInputFilter 35 | 36 | #pragma mark - Initialization and teardown 37 | 38 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString 39 | { 40 | if (!(self = [self initWithVertexShaderFromString:kGPUImageFourInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) 41 | { 42 | return nil; 43 | } 44 | 45 | return self; 46 | } 47 | 48 | - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString 49 | { 50 | if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) 51 | { 52 | return nil; 53 | } 54 | 55 | inputRotation4 = kGPUImageNoRotation; 56 | 57 | hasSetThirdTexture = NO; 58 | 59 | hasReceivedFourthFrame = NO; 60 | fourthFrameWasVideo = NO; 61 | fourthFrameCheckDisabled = NO; 62 | 63 | fourthFrameTime = kCMTimeInvalid; 64 | 65 | runSynchronouslyOnVideoProcessingQueue(^{ 66 | [GPUImageContext useImageProcessingContext]; 67 | filterFourthTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate4"]; 68 | 69 | filterInputTextureUniform4 = [filterProgram uniformIndex:@"inputImageTexture4"]; // This does assume a name of "inputImageTexture4" for the third input texture in the fragment shader 70 | glEnableVertexAttribArray(filterFourthTextureCoordinateAttribute); 71 | }); 72 | 73 | return self; 74 | } 75 | 76 | - (void)initializeAttributes 77 | { 78 | [super initializeAttributes]; 79 | [filterProgram addAttribute:@"inputTextureCoordinate4"]; 80 | } 81 | 82 | - (void)disableFourthFrameCheck 83 | { 84 | fourthFrameCheckDisabled = YES; 85 | } 86 | 87 | #pragma mark - Rendering 88 | 89 | - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates 90 | { 91 | if (self.preventRendering) 92 | { 93 | [firstInputFramebuffer unlock]; 94 | [secondInputFramebuffer unlock]; 95 | [thirdInputFramebuffer unlock]; 96 | [fourthInputFramebuffer unlock]; 97 | return; 98 | } 99 | 100 | [GPUImageContext setActiveShaderProgram:filterProgram]; 101 | outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; 102 | [outputFramebuffer activateFramebuffer]; 103 | if (usingNextFrameForImageCapture) 104 | { 105 | [outputFramebuffer lock]; 106 | } 107 | 108 | [self setUniformsForProgramAtIndex:0]; 109 | 110 | glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); 111 | glClear(GL_COLOR_BUFFER_BIT); 112 | 113 | glActiveTexture(GL_TEXTURE2); 114 | glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); 115 | glUniform1i(filterInputTextureUniform, 2); 116 | 117 | glActiveTexture(GL_TEXTURE3); 118 | glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); 119 | glUniform1i(filterInputTextureUniform2, 3); 120 | 121 | glActiveTexture(GL_TEXTURE4); 122 | glBindTexture(GL_TEXTURE_2D, [thirdInputFramebuffer texture]); 123 | glUniform1i(filterInputTextureUniform3, 4); 124 | 125 | glActiveTexture(GL_TEXTURE5); 126 | glBindTexture(GL_TEXTURE_2D, [fourthInputFramebuffer texture]); 127 | glUniform1i(filterInputTextureUniform4, 5); 128 | 129 | glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); 130 | glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); 131 | glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); 132 | glVertexAttribPointer(filterThirdTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation3]); 133 | glVertexAttribPointer(filterFourthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation4]); 134 | 135 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 136 | [firstInputFramebuffer unlock]; 137 | [secondInputFramebuffer unlock]; 138 | [thirdInputFramebuffer unlock]; 139 | [fourthInputFramebuffer unlock]; 140 | if (usingNextFrameForImageCapture) 141 | { 142 | dispatch_semaphore_signal(imageCaptureSemaphore); 143 | } 144 | } 145 | 146 | #pragma mark - GPUImageInput 147 | 148 | - (NSInteger)nextAvailableTextureIndex 149 | { 150 | if (hasSetThirdTexture) { 151 | return 3; 152 | } else if (hasSetSecondTexture) { 153 | return 2; 154 | } else if (hasSetFirstTexture) { 155 | return 1; 156 | } else { 157 | return 0; 158 | } 159 | } 160 | 161 | - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex 162 | { 163 | if (textureIndex == 0) { 164 | firstInputFramebuffer = newInputFramebuffer; 165 | hasSetFirstTexture = YES; 166 | [firstInputFramebuffer lock]; 167 | } else if (textureIndex == 1) { 168 | secondInputFramebuffer = newInputFramebuffer; 169 | hasSetSecondTexture = YES; 170 | [secondInputFramebuffer lock]; 171 | } else if (textureIndex == 2) { 172 | thirdInputFramebuffer = newInputFramebuffer; 173 | hasSetThirdTexture = YES; 174 | [thirdInputFramebuffer lock]; 175 | } else { 176 | fourthInputFramebuffer = newInputFramebuffer; 177 | [fourthInputFramebuffer lock]; 178 | } 179 | } 180 | 181 | - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex 182 | { 183 | if (textureIndex == 0) { 184 | [super setInputSize:newSize atIndex:textureIndex]; 185 | 186 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 187 | hasSetFirstTexture = NO; 188 | } 189 | } else if (textureIndex == 1) { 190 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 191 | hasSetSecondTexture = NO; 192 | } 193 | } else if (textureIndex == 2) { 194 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 195 | hasSetThirdTexture = NO; 196 | } 197 | } 198 | } 199 | 200 | - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex 201 | { 202 | if (textureIndex == 0) { 203 | inputRotation = newInputRotation; 204 | } else if (textureIndex == 1) { 205 | inputRotation2 = newInputRotation; 206 | } else if (textureIndex == 2){ 207 | inputRotation3 = newInputRotation; 208 | } else { 209 | inputRotation4 = newInputRotation; 210 | } 211 | } 212 | 213 | - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex 214 | { 215 | CGSize rotatedSize = sizeToRotate; 216 | 217 | GPUImageRotationMode rotationToCheck; 218 | if (textureIndex == 0) { 219 | rotationToCheck = inputRotation; 220 | } else if (textureIndex == 1) { 221 | rotationToCheck = inputRotation2; 222 | } else if (textureIndex == 2) { 223 | rotationToCheck = inputRotation3; 224 | } else { 225 | rotationToCheck = inputRotation4; 226 | } 227 | 228 | if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { 229 | rotatedSize.width = sizeToRotate.height; 230 | rotatedSize.height = sizeToRotate.width; 231 | } 232 | 233 | return rotatedSize; 234 | } 235 | 236 | - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex 237 | { 238 | // You can set up infinite update loops, so this helps to short circuit them 239 | if (hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame) 240 | { 241 | return; 242 | } 243 | 244 | BOOL updatedMovieFrameOppositeStillImage = NO; 245 | 246 | if (textureIndex == 0) { 247 | hasReceivedFirstFrame = YES; 248 | firstFrameTime = frameTime; 249 | if (secondFrameCheckDisabled) { 250 | hasReceivedSecondFrame = YES; 251 | } 252 | if (thirdFrameCheckDisabled) { 253 | hasReceivedThirdFrame = YES; 254 | } 255 | if (fourthFrameCheckDisabled) { 256 | hasReceivedFourthFrame = YES; 257 | } 258 | 259 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 260 | if CMTIME_IS_INDEFINITE(secondFrameTime) { 261 | updatedMovieFrameOppositeStillImage = YES; 262 | } 263 | } 264 | } else if (textureIndex == 1) { 265 | hasReceivedSecondFrame = YES; 266 | secondFrameTime = frameTime; 267 | if (firstFrameCheckDisabled) { 268 | hasReceivedFirstFrame = YES; 269 | } 270 | if (thirdFrameCheckDisabled) { 271 | hasReceivedThirdFrame = YES; 272 | } 273 | if (fourthFrameCheckDisabled) { 274 | hasReceivedFourthFrame = YES; 275 | } 276 | 277 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 278 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 279 | updatedMovieFrameOppositeStillImage = YES; 280 | } 281 | } 282 | } else if (textureIndex == 2) { 283 | hasReceivedThirdFrame = YES; 284 | thirdFrameTime = frameTime; 285 | if (firstFrameCheckDisabled) { 286 | hasReceivedFirstFrame = YES; 287 | } 288 | if (secondFrameCheckDisabled) { 289 | hasReceivedSecondFrame = YES; 290 | } 291 | if (fourthFrameCheckDisabled) { 292 | hasReceivedFourthFrame = YES; 293 | } 294 | 295 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 296 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 297 | updatedMovieFrameOppositeStillImage = YES; 298 | } 299 | } 300 | } else { 301 | hasReceivedFourthFrame = YES; 302 | fourthFrameTime = frameTime; 303 | if (firstFrameCheckDisabled) { 304 | hasReceivedFirstFrame = YES; 305 | } 306 | if (secondFrameCheckDisabled) { 307 | hasReceivedSecondFrame = YES; 308 | } 309 | if (thirdFrameCheckDisabled) { 310 | hasReceivedThirdFrame = YES; 311 | } 312 | 313 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 314 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 315 | updatedMovieFrameOppositeStillImage = YES; 316 | } 317 | } 318 | } 319 | 320 | // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) 321 | if ((hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame) || updatedMovieFrameOppositeStillImage) 322 | { 323 | static const GLfloat imageVertices[] = { 324 | -1.0f, -1.0f, 325 | 1.0f, -1.0f, 326 | -1.0f, 1.0f, 327 | 1.0f, 1.0f, 328 | }; 329 | 330 | [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; 331 | 332 | [self informTargetsAboutNewFrameAtTime:frameTime]; 333 | 334 | hasReceivedFirstFrame = NO; 335 | hasReceivedSecondFrame = NO; 336 | hasReceivedThirdFrame = NO; 337 | hasReceivedFourthFrame = NO; 338 | } 339 | } 340 | 341 | @end 342 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageSixInputFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageSixInputFilter.h 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/27. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import "GPUImageFiveInputFilter.h" 10 | 11 | extern NSString *const kGPUImageSixInputTextureVertexShaderString; 12 | 13 | @interface GPUImageSixInputFilter : GPUImageFiveInputFilter 14 | { 15 | GPUImageFramebuffer *sixthInputFramebuffer; 16 | 17 | GLint filterSixthTextureCoordinateAttribute; 18 | GLint filterInputTextureUniform6; 19 | GPUImageRotationMode inputRotation6; 20 | GLuint filterSourceTexture6; 21 | CMTime sixthFrameTime; 22 | 23 | BOOL hasSetFifthTexture, hasReceivedSixthFrame, sixthFrameWasVideo; 24 | BOOL sixthFrameCheckDisabled; 25 | } 26 | 27 | - (void)disableSixthFrameCheck; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /Sources/Filters/GPUImageSixInputFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // GPUImageSixInputFilter.m 3 | // FilterDemo 4 | // 5 | // Created by JunfengLi on 15/11/27. 6 | // Copyright © 2015年 LiJunfeng. All rights reserved. 7 | // 8 | 9 | #import "GPUImageSixInputFilter.h" 10 | 11 | NSString *const kGPUImageSixInputTextureVertexShaderString = SHADER_STRING 12 | ( 13 | attribute vec4 position; 14 | attribute vec4 inputTextureCoordinate; 15 | attribute vec4 inputTextureCoordinate2; 16 | attribute vec4 inputTextureCoordinate3; 17 | attribute vec4 inputTextureCoordinate4; 18 | attribute vec4 inputTextureCoordinate5; 19 | attribute vec4 inputTextureCoordinate6; 20 | 21 | varying vec2 textureCoordinate; 22 | varying vec2 textureCoordinate2; 23 | varying vec2 textureCoordinate3; 24 | varying vec2 textureCoordinate4; 25 | varying vec2 textureCoordinate5; 26 | varying vec2 textureCoordinate6; 27 | 28 | void main() 29 | { 30 | gl_Position = position; 31 | textureCoordinate = inputTextureCoordinate.xy; 32 | textureCoordinate2 = inputTextureCoordinate2.xy; 33 | textureCoordinate3 = inputTextureCoordinate3.xy; 34 | textureCoordinate4 = inputTextureCoordinate4.xy; 35 | textureCoordinate5 = inputTextureCoordinate5.xy; 36 | textureCoordinate6 = inputTextureCoordinate6.xy; 37 | } 38 | ); 39 | 40 | @implementation GPUImageSixInputFilter 41 | 42 | #pragma mark - Initialization and teardown 43 | 44 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString 45 | { 46 | if (!(self = [self initWithVertexShaderFromString:kGPUImageSixInputTextureVertexShaderString fragmentShaderFromString:fragmentShaderString])) 47 | { 48 | return nil; 49 | } 50 | 51 | return self; 52 | } 53 | 54 | - (id)initWithVertexShaderFromString:(NSString *)vertexShaderString fragmentShaderFromString:(NSString *)fragmentShaderString 55 | { 56 | if (!(self = [super initWithVertexShaderFromString:vertexShaderString fragmentShaderFromString:fragmentShaderString])) 57 | { 58 | return nil; 59 | } 60 | 61 | inputRotation6 = kGPUImageNoRotation; 62 | 63 | hasSetFifthTexture = NO; 64 | 65 | hasReceivedSixthFrame = NO; 66 | sixthFrameWasVideo = NO; 67 | sixthFrameCheckDisabled = NO; 68 | 69 | sixthFrameTime = kCMTimeInvalid; 70 | 71 | runSynchronouslyOnVideoProcessingQueue(^{ 72 | [GPUImageContext useImageProcessingContext]; 73 | filterSixthTextureCoordinateAttribute = [filterProgram attributeIndex:@"inputTextureCoordinate6"]; 74 | 75 | filterInputTextureUniform6 = [filterProgram uniformIndex:@"inputImageTexture6"]; // This does assume a name of "inputImageTexture6" for the third input texture in the fragment shader 76 | glEnableVertexAttribArray(filterSixthTextureCoordinateAttribute); 77 | }); 78 | 79 | return self; 80 | } 81 | 82 | - (void)initializeAttributes 83 | { 84 | [super initializeAttributes]; 85 | [filterProgram addAttribute:@"inputTextureCoordinate6"]; 86 | } 87 | 88 | - (void)disableSixthFrameCheck 89 | { 90 | sixthFrameCheckDisabled = YES; 91 | } 92 | 93 | #pragma mark - Rendering 94 | 95 | - (void)renderToTextureWithVertices:(const GLfloat *)vertices textureCoordinates:(const GLfloat *)textureCoordinates 96 | { 97 | if (self.preventRendering) 98 | { 99 | [firstInputFramebuffer unlock]; 100 | [secondInputFramebuffer unlock]; 101 | [thirdInputFramebuffer unlock]; 102 | [fourthInputFramebuffer unlock]; 103 | [fifthInputFramebuffer unlock]; 104 | [sixthInputFramebuffer unlock]; 105 | return; 106 | } 107 | 108 | [GPUImageContext setActiveShaderProgram:filterProgram]; 109 | outputFramebuffer = [[GPUImageContext sharedFramebufferCache] fetchFramebufferForSize:[self sizeOfFBO] textureOptions:self.outputTextureOptions onlyTexture:NO]; 110 | [outputFramebuffer activateFramebuffer]; 111 | if (usingNextFrameForImageCapture) 112 | { 113 | [outputFramebuffer lock]; 114 | } 115 | 116 | [self setUniformsForProgramAtIndex:0]; 117 | 118 | glClearColor(backgroundColorRed, backgroundColorGreen, backgroundColorBlue, backgroundColorAlpha); 119 | glClear(GL_COLOR_BUFFER_BIT); 120 | 121 | glActiveTexture(GL_TEXTURE2); 122 | glBindTexture(GL_TEXTURE_2D, [firstInputFramebuffer texture]); 123 | glUniform1i(filterInputTextureUniform, 2); 124 | 125 | glActiveTexture(GL_TEXTURE3); 126 | glBindTexture(GL_TEXTURE_2D, [secondInputFramebuffer texture]); 127 | glUniform1i(filterInputTextureUniform2, 3); 128 | 129 | glActiveTexture(GL_TEXTURE4); 130 | glBindTexture(GL_TEXTURE_2D, [thirdInputFramebuffer texture]); 131 | glUniform1i(filterInputTextureUniform3, 4); 132 | 133 | glActiveTexture(GL_TEXTURE5); 134 | glBindTexture(GL_TEXTURE_2D, [fourthInputFramebuffer texture]); 135 | glUniform1i(filterInputTextureUniform4, 5); 136 | 137 | glActiveTexture(GL_TEXTURE6); 138 | glBindTexture(GL_TEXTURE_2D, [fifthInputFramebuffer texture]); 139 | glUniform1i(filterInputTextureUniform5, 6); 140 | 141 | glActiveTexture(GL_TEXTURE7); 142 | glBindTexture(GL_TEXTURE_2D, [sixthInputFramebuffer texture]); 143 | glUniform1i(filterInputTextureUniform6, 7); 144 | 145 | glVertexAttribPointer(filterPositionAttribute, 2, GL_FLOAT, 0, 0, vertices); 146 | glVertexAttribPointer(filterTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, textureCoordinates); 147 | glVertexAttribPointer(filterSecondTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation2]); 148 | glVertexAttribPointer(filterThirdTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation3]); 149 | glVertexAttribPointer(filterFourthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation4]); 150 | glVertexAttribPointer(filterFifthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation5]); 151 | glVertexAttribPointer(filterSixthTextureCoordinateAttribute, 2, GL_FLOAT, 0, 0, [[self class] textureCoordinatesForRotation:inputRotation6]); 152 | 153 | glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); 154 | [firstInputFramebuffer unlock]; 155 | [secondInputFramebuffer unlock]; 156 | [thirdInputFramebuffer unlock]; 157 | [fourthInputFramebuffer unlock]; 158 | [fifthInputFramebuffer unlock]; 159 | [sixthInputFramebuffer unlock]; 160 | if (usingNextFrameForImageCapture) 161 | { 162 | dispatch_semaphore_signal(imageCaptureSemaphore); 163 | } 164 | } 165 | 166 | #pragma mark - GPUImageInput 167 | 168 | - (NSInteger)nextAvailableTextureIndex 169 | { 170 | if (hasSetFifthTexture) { 171 | return 5; 172 | } else if (hasSetFourthTexture) { 173 | return 4; 174 | } else if (hasSetThirdTexture) { 175 | return 3; 176 | } else if (hasSetSecondTexture) { 177 | return 2; 178 | } else if (hasSetFirstTexture) { 179 | return 1; 180 | } else { 181 | return 0; 182 | } 183 | } 184 | 185 | - (void)setInputFramebuffer:(GPUImageFramebuffer *)newInputFramebuffer atIndex:(NSInteger)textureIndex 186 | { 187 | if (textureIndex == 0) { 188 | firstInputFramebuffer = newInputFramebuffer; 189 | hasSetFirstTexture = YES; 190 | [firstInputFramebuffer lock]; 191 | } else if (textureIndex == 1) { 192 | secondInputFramebuffer = newInputFramebuffer; 193 | hasSetSecondTexture = YES; 194 | [secondInputFramebuffer lock]; 195 | } else if (textureIndex == 2) { 196 | thirdInputFramebuffer = newInputFramebuffer; 197 | hasSetThirdTexture = YES; 198 | [thirdInputFramebuffer lock]; 199 | } else if (textureIndex == 3) { 200 | fourthInputFramebuffer = newInputFramebuffer; 201 | hasSetFourthTexture = YES; 202 | [fourthInputFramebuffer lock]; 203 | } else if (textureIndex == 4) { 204 | fifthInputFramebuffer = newInputFramebuffer; 205 | hasSetFifthTexture = YES; 206 | [fifthInputFramebuffer lock]; 207 | } else { 208 | sixthInputFramebuffer = newInputFramebuffer; 209 | [sixthInputFramebuffer lock]; 210 | } 211 | } 212 | 213 | - (void)setInputSize:(CGSize)newSize atIndex:(NSInteger)textureIndex 214 | { 215 | if (textureIndex == 0) { 216 | [super setInputSize:newSize atIndex:textureIndex]; 217 | 218 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 219 | hasSetFirstTexture = NO; 220 | } 221 | } else if (textureIndex == 1) { 222 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 223 | hasSetSecondTexture = NO; 224 | } 225 | } else if (textureIndex == 2) { 226 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 227 | hasSetThirdTexture = NO; 228 | } 229 | } else if (textureIndex == 3) { 230 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 231 | hasSetFourthTexture = NO; 232 | } 233 | } else if (textureIndex == 4) { 234 | if (CGSizeEqualToSize(newSize, CGSizeZero)) { 235 | hasSetFifthTexture = NO; 236 | } 237 | } 238 | } 239 | 240 | - (void)setInputRotation:(GPUImageRotationMode)newInputRotation atIndex:(NSInteger)textureIndex 241 | { 242 | if (textureIndex == 0) { 243 | inputRotation = newInputRotation; 244 | } else if (textureIndex == 1) { 245 | inputRotation2 = newInputRotation; 246 | } else if (textureIndex == 2){ 247 | inputRotation3 = newInputRotation; 248 | } else if (textureIndex == 3) { 249 | inputRotation4 = newInputRotation; 250 | } else if (textureIndex == 4) { 251 | inputRotation5 = newInputRotation; 252 | } else { 253 | inputRotation6 = newInputRotation; 254 | } 255 | } 256 | 257 | - (CGSize)rotatedSize:(CGSize)sizeToRotate forIndex:(NSInteger)textureIndex 258 | { 259 | CGSize rotatedSize = sizeToRotate; 260 | 261 | GPUImageRotationMode rotationToCheck; 262 | if (textureIndex == 0) { 263 | rotationToCheck = inputRotation; 264 | } else if (textureIndex == 1) { 265 | rotationToCheck = inputRotation2; 266 | } else if (textureIndex == 2) { 267 | rotationToCheck = inputRotation3; 268 | } else if (textureIndex == 3) { 269 | rotationToCheck = inputRotation4; 270 | } else if (textureIndex == 4) { 271 | rotationToCheck = inputRotation5; 272 | } else { 273 | rotationToCheck = inputRotation6; 274 | } 275 | 276 | if (GPUImageRotationSwapsWidthAndHeight(rotationToCheck)) { 277 | rotatedSize.width = sizeToRotate.height; 278 | rotatedSize.height = sizeToRotate.width; 279 | } 280 | 281 | return rotatedSize; 282 | } 283 | 284 | - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex 285 | { 286 | // You can set up infinite update loops, so this helps to short circuit them 287 | if (hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame && hasReceivedFifthFrame && hasReceivedSixthFrame) 288 | { 289 | return; 290 | } 291 | 292 | BOOL updatedMovieFrameOppositeStillImage = NO; 293 | 294 | if (textureIndex == 0) { 295 | hasReceivedFirstFrame = YES; 296 | firstFrameTime = frameTime; 297 | if (secondFrameCheckDisabled) { 298 | hasReceivedSecondFrame = YES; 299 | } 300 | if (thirdFrameCheckDisabled) { 301 | hasReceivedThirdFrame = YES; 302 | } 303 | if (fourthFrameCheckDisabled) { 304 | hasReceivedFourthFrame = YES; 305 | } 306 | if (fifthFrameCheckDisabled) { 307 | hasReceivedFifthFrame = YES; 308 | } 309 | if (sixthFrameCheckDisabled) { 310 | hasReceivedSixthFrame = YES; 311 | } 312 | 313 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 314 | if CMTIME_IS_INDEFINITE(secondFrameTime) { 315 | updatedMovieFrameOppositeStillImage = YES; 316 | } 317 | } 318 | } else if (textureIndex == 1) { 319 | hasReceivedSecondFrame = YES; 320 | secondFrameTime = frameTime; 321 | if (firstFrameCheckDisabled) { 322 | hasReceivedFirstFrame = YES; 323 | } 324 | if (thirdFrameCheckDisabled) { 325 | hasReceivedThirdFrame = YES; 326 | } 327 | if (fourthFrameCheckDisabled) { 328 | hasReceivedFourthFrame = YES; 329 | } 330 | if (fifthFrameCheckDisabled) { 331 | hasReceivedFifthFrame = YES; 332 | } 333 | if (sixthFrameCheckDisabled) { 334 | hasReceivedSixthFrame = YES; 335 | } 336 | 337 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 338 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 339 | updatedMovieFrameOppositeStillImage = YES; 340 | } 341 | } 342 | } else if (textureIndex == 2) { 343 | hasReceivedThirdFrame = YES; 344 | thirdFrameTime = frameTime; 345 | if (firstFrameCheckDisabled) { 346 | hasReceivedFirstFrame = YES; 347 | } 348 | if (secondFrameCheckDisabled) { 349 | hasReceivedSecondFrame = YES; 350 | } 351 | if (fourthFrameCheckDisabled) { 352 | hasReceivedFourthFrame = YES; 353 | } 354 | if (fifthFrameCheckDisabled) { 355 | hasReceivedFifthFrame = YES; 356 | } 357 | if (sixthFrameCheckDisabled) { 358 | hasReceivedSixthFrame = YES; 359 | } 360 | 361 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 362 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 363 | updatedMovieFrameOppositeStillImage = YES; 364 | } 365 | } 366 | } else if (textureIndex == 3) { 367 | hasReceivedFourthFrame = YES; 368 | fourthFrameTime = frameTime; 369 | if (firstFrameCheckDisabled) { 370 | hasReceivedFirstFrame = YES; 371 | } 372 | if (secondFrameCheckDisabled) { 373 | hasReceivedSecondFrame = YES; 374 | } 375 | if (thirdFrameCheckDisabled) { 376 | hasReceivedThirdFrame = YES; 377 | } 378 | if (fifthFrameCheckDisabled) { 379 | hasReceivedFifthFrame = YES; 380 | } 381 | if (sixthFrameCheckDisabled) { 382 | hasReceivedSixthFrame = YES; 383 | } 384 | 385 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 386 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 387 | updatedMovieFrameOppositeStillImage = YES; 388 | } 389 | } 390 | } else if (textureIndex == 4) { 391 | hasReceivedFifthFrame = YES; 392 | fifthFrameTime = frameTime; 393 | if (firstFrameCheckDisabled) { 394 | hasReceivedFirstFrame = YES; 395 | } 396 | if (secondFrameCheckDisabled) { 397 | hasReceivedSecondFrame = YES; 398 | } 399 | if (thirdFrameCheckDisabled) { 400 | hasReceivedThirdFrame = YES; 401 | } 402 | if (fourthFrameCheckDisabled) { 403 | hasReceivedFourthFrame = YES; 404 | } 405 | if (sixthFrameCheckDisabled) { 406 | hasReceivedSixthFrame = YES; 407 | } 408 | 409 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 410 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 411 | updatedMovieFrameOppositeStillImage = YES; 412 | } 413 | } 414 | } else { 415 | hasReceivedSixthFrame = YES; 416 | sixthFrameTime = frameTime; 417 | if (firstFrameCheckDisabled) { 418 | hasReceivedFirstFrame = YES; 419 | } 420 | if (secondFrameCheckDisabled) { 421 | hasReceivedSecondFrame = YES; 422 | } 423 | if (thirdFrameCheckDisabled) { 424 | hasReceivedThirdFrame = YES; 425 | } 426 | if (fourthFrameCheckDisabled) { 427 | hasReceivedFourthFrame = YES; 428 | } 429 | if (fifthFrameCheckDisabled) { 430 | hasReceivedFifthFrame = YES; 431 | } 432 | 433 | if (!CMTIME_IS_INDEFINITE(frameTime)) { 434 | if CMTIME_IS_INDEFINITE(firstFrameTime) { 435 | updatedMovieFrameOppositeStillImage = YES; 436 | } 437 | } 438 | } 439 | 440 | // || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled) 441 | if ((hasReceivedFirstFrame && hasReceivedSecondFrame && hasReceivedThirdFrame && hasReceivedFourthFrame && hasReceivedFifthFrame && hasReceivedSixthFrame) || updatedMovieFrameOppositeStillImage) 442 | { 443 | static const GLfloat imageVertices[] = { 444 | -1.0f, -1.0f, 445 | 1.0f, -1.0f, 446 | -1.0f, 1.0f, 447 | 1.0f, 1.0f, 448 | }; 449 | 450 | [self renderToTextureWithVertices:imageVertices textureCoordinates:[[self class] textureCoordinatesForRotation:inputRotation]]; 451 | 452 | [self informTargetsAboutNewFrameAtTime:frameTime]; 453 | 454 | hasReceivedFirstFrame = NO; 455 | hasReceivedSecondFrame = NO; 456 | hasReceivedThirdFrame = NO; 457 | hasReceivedFourthFrame = NO; 458 | hasReceivedFifthFrame = NO; 459 | hasReceivedSixthFrame = NO; 460 | } 461 | } 462 | 463 | @end 464 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/1977blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/1977blowout.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/1977map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/1977map.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/amaroMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/amaroMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/blackboard1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/blackboard1024.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanBlowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanBlowout.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanContrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanContrast.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanLuma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanLuma.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanProcess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanProcess.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanScreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/brannanScreen.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlyBirdCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlyBirdCurves.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdBlowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdBlowout.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdOverlayMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/earlybirdOverlayMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/edgeBurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/edgeBurn.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeGradientMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeGradientMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeMetal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeMetal.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeSoftLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hefeSoftLight.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hudsonBackground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hudsonBackground.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hudsonMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/hudsonMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/inkwellMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/inkwellMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/kelvinMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/kelvinMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/lomoMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/lomoMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/nashvilleMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/nashvilleMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/overlayMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/overlayMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/riseMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/riseMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sierraMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sierraMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sierraVignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sierraVignette.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/softLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/softLight.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroCurves.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroEdgeBurn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroEdgeBurn.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroMetal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/sutroMetal.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterColorShift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterColorShift.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterCurves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterCurves.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterMetal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterMetal.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterOverlayMapWarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterOverlayMapWarm.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterSoftLight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/toasterSoftLight.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/valenciaGradientMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/valenciaGradientMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/valenciaMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/valenciaMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/vignetteMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/vignetteMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/waldenMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/waldenMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/xproMap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/Filters/Instagram/GPUImage.InstagramFilter.bundle/xproMap.png -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IF1977Filter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IF1977Filter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IF1977Filter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IF1977Filter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IF1977Filter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IF1977Filter.h" 10 | 11 | NSString *const kIF1977ShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; 19 | 20 | void main() 21 | { 22 | 23 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 24 | 25 | texel = vec3( 26 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 27 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 28 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 29 | 30 | gl_FragColor = vec4(texel, 1.0); 31 | } 32 | ); 33 | 34 | @implementation IF1977Filter 35 | 36 | 37 | - (id)init 38 | { 39 | self = [super initWithFragmentShaderFromString:kIF1977ShaderString 40 | sources:@[ 41 | [IFImageFilter filterImageNamed:@"1977map"], 42 | [IFImageFilter filterImageNamed:@"1977blowout"] 43 | ]]; 44 | return self; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFAmaroFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFAmaroFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFAmaroFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFAmaroFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFAmaroFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFAmaroFilter.h" 10 | 11 | NSString *const kIFAmaroShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //blowout; 19 | uniform sampler2D inputImageTexture3; //overlay; 20 | uniform sampler2D inputImageTexture4; //map 21 | 22 | void main() 23 | { 24 | 25 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 26 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 27 | 28 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 29 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 30 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 31 | 32 | vec4 mapped; 33 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 34 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 35 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 36 | mapped.a = 1.0; 37 | 38 | gl_FragColor = mapped; 39 | } 40 | ); 41 | 42 | @implementation IFAmaroFilter 43 | 44 | - (id)init 45 | { 46 | self = [super initWithFragmentShaderFromString:kIFAmaroShaderString 47 | sources:@[ 48 | [IFImageFilter filterImageNamed:@"blackboard1024"], 49 | [IFImageFilter filterImageNamed:@"overlayMap"], 50 | [IFImageFilter filterImageNamed:@"amaroMap"], 51 | ]]; 52 | return self; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFBrannanFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFBrannanFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFBrannanFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFBrannanFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFBrannanFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFBrannanFilter.h" 10 | 11 | NSString *const kIFBrannanShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //process 19 | uniform sampler2D inputImageTexture3; //blowout 20 | uniform sampler2D inputImageTexture4; //contrast 21 | uniform sampler2D inputImageTexture5; //luma 22 | uniform sampler2D inputImageTexture6; //screen 23 | 24 | mat3 saturateMatrix = mat3( 25 | 1.105150, 26 | -0.044850, 27 | -0.046000, 28 | -0.088050, 29 | 1.061950, 30 | -0.089200, 31 | -0.017100, 32 | -0.017100, 33 | 1.132900); 34 | 35 | vec3 luma = vec3(.3, .59, .11); 36 | 37 | void main() 38 | { 39 | 40 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 41 | 42 | vec2 lookup; 43 | lookup.y = 0.5; 44 | lookup.x = texel.r; 45 | texel.r = texture2D(inputImageTexture2, lookup).r; 46 | lookup.x = texel.g; 47 | texel.g = texture2D(inputImageTexture2, lookup).g; 48 | lookup.x = texel.b; 49 | texel.b = texture2D(inputImageTexture2, lookup).b; 50 | 51 | texel = saturateMatrix * texel; 52 | 53 | 54 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 55 | float d = dot(tc, tc); 56 | vec3 sampled; 57 | lookup.y = 0.5; 58 | lookup.x = texel.r; 59 | sampled.r = texture2D(inputImageTexture3, lookup).r; 60 | lookup.x = texel.g; 61 | sampled.g = texture2D(inputImageTexture3, lookup).g; 62 | lookup.x = texel.b; 63 | sampled.b = texture2D(inputImageTexture3, lookup).b; 64 | float value = smoothstep(0.0, 1.0, d); 65 | texel = mix(sampled, texel, value); 66 | 67 | lookup.x = texel.r; 68 | texel.r = texture2D(inputImageTexture4, lookup).r; 69 | lookup.x = texel.g; 70 | texel.g = texture2D(inputImageTexture4, lookup).g; 71 | lookup.x = texel.b; 72 | texel.b = texture2D(inputImageTexture4, lookup).b; 73 | 74 | 75 | lookup.x = dot(texel, luma); 76 | texel = mix(texture2D(inputImageTexture5, lookup).rgb, texel, .5); 77 | 78 | lookup.x = texel.r; 79 | texel.r = texture2D(inputImageTexture6, lookup).r; 80 | lookup.x = texel.g; 81 | texel.g = texture2D(inputImageTexture6, lookup).g; 82 | lookup.x = texel.b; 83 | texel.b = texture2D(inputImageTexture6, lookup).b; 84 | 85 | gl_FragColor = vec4(texel, 1.0); 86 | } 87 | ); 88 | 89 | @implementation IFBrannanFilter 90 | 91 | 92 | - (id)init 93 | { 94 | self = [super initWithFragmentShaderFromString:kIFBrannanShaderString 95 | sources:@[ 96 | [IFImageFilter filterImageNamed:@"brannanProcess"], 97 | [IFImageFilter filterImageNamed:@"brannanBlowout"], 98 | [IFImageFilter filterImageNamed:@"brannanContrast"], 99 | [IFImageFilter filterImageNamed:@"brannanLuma"], 100 | [IFImageFilter filterImageNamed:@"brannanScreen"], 101 | ]]; 102 | return self; 103 | } 104 | @end 105 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFEarlybirdFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFEarlybirdFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFEarlybirdFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFEarlybirdFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFEarlybirdFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFEarlybirdFilter.h" 10 | 11 | NSString *const kIFEarlybirdShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //earlyBirdCurves 19 | uniform sampler2D inputImageTexture3; //earlyBirdOverlay 20 | uniform sampler2D inputImageTexture4; //vig 21 | uniform sampler2D inputImageTexture5; //earlyBirdBlowout 22 | uniform sampler2D inputImageTexture6; //earlyBirdMap 23 | 24 | const mat3 saturate = mat3( 25 | 1.210300, 26 | -0.089700, 27 | -0.091000, 28 | -0.176100, 29 | 1.123900, 30 | -0.177400, 31 | -0.034200, 32 | -0.034200, 33 | 1.265800); 34 | const vec3 rgbPrime = vec3(0.25098, 0.14640522, 0.0); 35 | const vec3 desaturate = vec3(.3, .59, .11); 36 | 37 | void main() 38 | { 39 | 40 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 41 | 42 | 43 | vec2 lookup; 44 | lookup.y = 0.5; 45 | 46 | lookup.x = texel.r; 47 | texel.r = texture2D(inputImageTexture2, lookup).r; 48 | 49 | lookup.x = texel.g; 50 | texel.g = texture2D(inputImageTexture2, lookup).g; 51 | 52 | lookup.x = texel.b; 53 | texel.b = texture2D(inputImageTexture2, lookup).b; 54 | 55 | float desaturatedColor; 56 | vec3 result; 57 | desaturatedColor = dot(desaturate, texel); 58 | 59 | 60 | lookup.x = desaturatedColor; 61 | result.r = texture2D(inputImageTexture3, lookup).r; 62 | lookup.x = desaturatedColor; 63 | result.g = texture2D(inputImageTexture3, lookup).g; 64 | lookup.x = desaturatedColor; 65 | result.b = texture2D(inputImageTexture3, lookup).b; 66 | 67 | texel = saturate * mix(texel, result, .5); 68 | 69 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 70 | float d = dot(tc, tc); 71 | 72 | vec3 sampled; 73 | lookup.y = .5; 74 | 75 | /* 76 | lookup.x = texel.r; 77 | sampled.r = texture2D(inputImageTexture4, lookup).r; 78 | 79 | lookup.x = texel.g; 80 | sampled.g = texture2D(inputImageTexture4, lookup).g; 81 | 82 | lookup.x = texel.b; 83 | sampled.b = texture2D(inputImageTexture4, lookup).b; 84 | 85 | float value = smoothstep(0.0, 1.25, pow(d, 1.35)/1.65); 86 | texel = mix(texel, sampled, value); 87 | */ 88 | 89 | //--- 90 | 91 | lookup = vec2(d, texel.r); 92 | texel.r = texture2D(inputImageTexture4, lookup).r; 93 | lookup.y = texel.g; 94 | texel.g = texture2D(inputImageTexture4, lookup).g; 95 | lookup.y = texel.b; 96 | texel.b = texture2D(inputImageTexture4, lookup).b; 97 | float value = smoothstep(0.0, 1.25, pow(d, 1.35)/1.65); 98 | 99 | //--- 100 | 101 | lookup.x = texel.r; 102 | sampled.r = texture2D(inputImageTexture5, lookup).r; 103 | lookup.x = texel.g; 104 | sampled.g = texture2D(inputImageTexture5, lookup).g; 105 | lookup.x = texel.b; 106 | sampled.b = texture2D(inputImageTexture5, lookup).b; 107 | texel = mix(sampled, texel, value); 108 | 109 | 110 | lookup.x = texel.r; 111 | texel.r = texture2D(inputImageTexture6, lookup).r; 112 | lookup.x = texel.g; 113 | texel.g = texture2D(inputImageTexture6, lookup).g; 114 | lookup.x = texel.b; 115 | texel.b = texture2D(inputImageTexture6, lookup).b; 116 | 117 | gl_FragColor = vec4(texel, 1.0); 118 | } 119 | ); 120 | 121 | @implementation IFEarlybirdFilter 122 | 123 | - (id)init 124 | { 125 | self = [super initWithFragmentShaderFromString:kIFEarlybirdShaderString 126 | sources:@[ 127 | [IFImageFilter filterImageNamed:@"earlyBirdCurves"], 128 | [IFImageFilter filterImageNamed:@"earlybirdOverlayMap"], 129 | [IFImageFilter filterImageNamed:@"vignetteMap"], 130 | [IFImageFilter filterImageNamed:@"earlybirdBlowout"], 131 | [IFImageFilter filterImageNamed:@"earlybirdMap"], 132 | ]]; 133 | return self; 134 | } 135 | 136 | @end 137 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFHefeFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFHefeFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFHefeFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFHefeFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFHefeFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFHefeFilter.h" 10 | 11 | NSString *const kIFHefeShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //edgeBurn 19 | uniform sampler2D inputImageTexture3; //hefeMap 20 | uniform sampler2D inputImageTexture4; //hefeGradientMap 21 | uniform sampler2D inputImageTexture5; //hefeSoftLight 22 | uniform sampler2D inputImageTexture6; //hefeMetal 23 | 24 | void main() 25 | { 26 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 27 | vec3 edge = texture2D(inputImageTexture2, textureCoordinate).rgb; 28 | texel = texel * edge; 29 | 30 | texel = vec3( 31 | texture2D(inputImageTexture3, vec2(texel.r, .16666)).r, 32 | texture2D(inputImageTexture3, vec2(texel.g, .5)).g, 33 | texture2D(inputImageTexture3, vec2(texel.b, .83333)).b); 34 | 35 | vec3 luma = vec3(.30, .59, .11); 36 | vec3 gradSample = texture2D(inputImageTexture4, vec2(dot(luma, texel), .5)).rgb; 37 | vec3 final = vec3( 38 | texture2D(inputImageTexture5, vec2(gradSample.r, texel.r)).r, 39 | texture2D(inputImageTexture5, vec2(gradSample.g, texel.g)).g, 40 | texture2D(inputImageTexture5, vec2(gradSample.b, texel.b)).b 41 | ); 42 | 43 | vec3 metal = texture2D(inputImageTexture6, textureCoordinate).rgb; 44 | vec3 metaled = vec3( 45 | texture2D(inputImageTexture5, vec2(metal.r, texel.r)).r, 46 | texture2D(inputImageTexture5, vec2(metal.g, texel.g)).g, 47 | texture2D(inputImageTexture5, vec2(metal.b, texel.b)).b 48 | ); 49 | 50 | gl_FragColor = vec4(metaled, 1.0); 51 | } 52 | ); 53 | 54 | @implementation IFHefeFilter 55 | - (id)init 56 | { 57 | self = [super initWithFragmentShaderFromString:kIFHefeShaderString 58 | sources:@[ 59 | [IFImageFilter filterImageNamed:@"edgeBurn"], 60 | [IFImageFilter filterImageNamed:@"hefeMap"], 61 | [IFImageFilter filterImageNamed:@"hefeGradientMap"], 62 | [IFImageFilter filterImageNamed:@"hefeSoftLight"], 63 | [IFImageFilter filterImageNamed:@"hefeMetal"], 64 | 65 | ]]; 66 | return self; 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFHudsonFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFHudsonFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFHudsonFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFHudsonFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFHudsonFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFHudsonFilter.h" 10 | 11 | NSString *const kIFHudsonShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //blowout; 19 | uniform sampler2D inputImageTexture3; //overlay; 20 | uniform sampler2D inputImageTexture4; //map 21 | 22 | void main() 23 | { 24 | 25 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 26 | 27 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 28 | 29 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 30 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 31 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 32 | 33 | vec4 mapped; 34 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 35 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 36 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 37 | mapped.a = 1.0; 38 | gl_FragColor = mapped; 39 | } 40 | ); 41 | 42 | @implementation IFHudsonFilter 43 | 44 | 45 | - (id)init 46 | { 47 | self = [super initWithFragmentShaderFromString:kIFHudsonShaderString 48 | sources:@[ 49 | [IFImageFilter filterImageNamed:@"hudsonBackground"], 50 | [IFImageFilter filterImageNamed:@"overlayMap"], 51 | [IFImageFilter filterImageNamed:@"hudsonMap"], 52 | ]]; 53 | return self; 54 | } 55 | 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFImageFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // InstagramFilter.h 3 | // GPUImageFilters 4 | // 5 | // Created by KimDaeWook on 1/12/16. 6 | // Copyright © 2016 KimDaewook. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "GPUImageSixInputFilter.h" 12 | 13 | 14 | @interface IFImageFilter : GPUImageFilterGroup 15 | 16 | +(NSArray*)allFilterClasses; 17 | +(GPUImagePicture*)filterImageNamed:(NSString*)name; 18 | 19 | 20 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString sources:(NSArray*)sources; 21 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString; 22 | 23 | - (NSString*)name; 24 | 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFImageFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // InstagramFilter.m 3 | // GPUImageFilters 4 | // 5 | // Created by KimDaeWook on 1/12/16. 6 | // Copyright © 2016 KimDaewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | #import 11 | 12 | 13 | @implementation IFImageFilter { 14 | NSArray* _sources; 15 | NSString* _name; 16 | } 17 | 18 | +(NSArray*)allFilterClasses { 19 | 20 | static NSMutableArray* filters = nil; 21 | static dispatch_once_t filtersDispatch; 22 | 23 | dispatch_once(&filtersDispatch, ^{ 24 | 25 | Class parentClass = [IFImageFilter class]; 26 | 27 | int numClasses = objc_getClassList(NULL, 0); 28 | Class *classes = NULL; 29 | 30 | classes = (Class*)malloc(sizeof(Class) * numClasses); 31 | numClasses = objc_getClassList(classes, numClasses); 32 | 33 | filters = [NSMutableArray array]; 34 | for (NSInteger i = 0; i < numClasses; i++) 35 | { 36 | // not allow inherit filters for search performance. 37 | if(class_getSuperclass(classes[i]) == parentClass) { 38 | [filters addObject:classes[i]]; 39 | } 40 | } 41 | 42 | free(classes); 43 | 44 | }); 45 | 46 | 47 | return filters; 48 | } 49 | 50 | +(GPUImagePicture*)filterImageNamed:(NSString*)name { 51 | NSString *bundlePath = [[NSBundle mainBundle] pathForResource:@"GPUImage.InstagramFilter" ofType:@"bundle"]; 52 | NSBundle* filterImageBundle = [NSBundle bundleWithPath:bundlePath]; 53 | 54 | UIImage* image = [UIImage imageWithContentsOfFile:[filterImageBundle pathForResource:name ofType:@"png"]]; 55 | 56 | return [[GPUImagePicture alloc] initWithImage:image]; 57 | } 58 | 59 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString { 60 | self = [self initWithFragmentShaderFromString:fragmentShaderString sources:nil]; 61 | 62 | return self; 63 | } 64 | 65 | - (id)initWithFragmentShaderFromString:(NSString *)fragmentShaderString sources:(NSArray*)sources 66 | { 67 | if (!(self = [super init])) 68 | { 69 | return nil; 70 | } 71 | 72 | 73 | _sources = sources; 74 | 75 | Class filterClass; 76 | switch (sources.count) { 77 | case 1: 78 | filterClass = [GPUImageTwoInputFilter class]; 79 | break; 80 | case 2: 81 | filterClass = [GPUImageThreeInputFilter class]; 82 | break; 83 | case 3: 84 | filterClass = [GPUImageFourInputFilter class]; 85 | break; 86 | case 4: 87 | filterClass = [GPUImageFiveInputFilter class]; 88 | break; 89 | case 5: 90 | filterClass = [GPUImageSixInputFilter class]; 91 | break; 92 | default: 93 | filterClass = [GPUImageFilter class]; 94 | break; 95 | } 96 | 97 | GPUImageFilter* filter = [[filterClass alloc] initWithFragmentShaderFromString:fragmentShaderString]; 98 | 99 | [self addFilter:filter]; 100 | 101 | int sourceIndex = 1; 102 | for (GPUImagePicture* source in sources) { 103 | [source addTarget:filter atTextureLocation:sourceIndex++]; 104 | [source processImage]; 105 | } 106 | 107 | 108 | self.initialFilters = [NSArray arrayWithObjects:filter, nil]; 109 | self.terminalFilter = filter; 110 | 111 | return self; 112 | } 113 | 114 | - (NSString*)name { 115 | 116 | if(!_name) { 117 | _name = NSStringFromClass([self class]); 118 | } 119 | 120 | return _name; 121 | } 122 | 123 | 124 | @end 125 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFInkwellFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFInkwellFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFInkwellFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFInkwellFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFInkwellFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFInkwellFilter.h" 10 | 11 | NSString *const kIFInkWellShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; 19 | 20 | void main() 21 | { 22 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 23 | texel = vec3(dot(vec3(0.3, 0.6, 0.1), texel)); 24 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r); 25 | gl_FragColor = vec4(texel, 1.0); 26 | } 27 | ); 28 | 29 | @implementation IFInkwellFilter 30 | 31 | - (id)init 32 | { 33 | self = [super initWithFragmentShaderFromString:kIFInkWellShaderString 34 | sources:@[ 35 | [IFImageFilter filterImageNamed:@"inkwellMap"], 36 | ]]; 37 | return self; 38 | } 39 | 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFLomofiFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFLomofiFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFLomofiFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFLomofiFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFLomofiFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFLomofiFilter.h" 10 | 11 | NSString *const kIFLomofiShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; 19 | uniform sampler2D inputImageTexture3; 20 | 21 | void main() 22 | { 23 | 24 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 25 | 26 | vec2 red = vec2(texel.r, 0.16666); 27 | vec2 green = vec2(texel.g, 0.5); 28 | vec2 blue = vec2(texel.b, 0.83333); 29 | 30 | texel.rgb = vec3( 31 | texture2D(inputImageTexture2, red).r, 32 | texture2D(inputImageTexture2, green).g, 33 | texture2D(inputImageTexture2, blue).b); 34 | 35 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 36 | float d = dot(tc, tc); 37 | vec2 lookup = vec2(d, texel.r); 38 | texel.r = texture2D(inputImageTexture3, lookup).r; 39 | lookup.y = texel.g; 40 | texel.g = texture2D(inputImageTexture3, lookup).g; 41 | lookup.y = texel.b; 42 | texel.b = texture2D(inputImageTexture3, lookup).b; 43 | 44 | gl_FragColor = vec4(texel,1.0); 45 | } 46 | ); 47 | 48 | @implementation IFLomofiFilter 49 | 50 | - (id)init 51 | { 52 | self = [super initWithFragmentShaderFromString:kIFLomofiShaderString 53 | sources:@[ 54 | [IFImageFilter filterImageNamed:@"lomoMap"], 55 | [IFImageFilter filterImageNamed:@"vignetteMap"], 56 | ]]; 57 | return self; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFLordKelvinFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFLordKelvinFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFLordKelvinFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFLordKelvinFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFLordKelvinFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFLordKelvinFilter.h" 10 | 11 | NSString *const kIFLordKelvinShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; 19 | 20 | void main() 21 | { 22 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 23 | 24 | vec2 lookup; 25 | lookup.y = .5; 26 | 27 | lookup.x = texel.r; 28 | texel.r = texture2D(inputImageTexture2, lookup).r; 29 | 30 | lookup.x = texel.g; 31 | texel.g = texture2D(inputImageTexture2, lookup).g; 32 | 33 | lookup.x = texel.b; 34 | texel.b = texture2D(inputImageTexture2, lookup).b; 35 | 36 | gl_FragColor = vec4(texel, 1.0); 37 | } 38 | ); 39 | 40 | @implementation IFLordKelvinFilter 41 | 42 | - (id)init 43 | { 44 | self = [super initWithFragmentShaderFromString:kIFLordKelvinShaderString 45 | sources:@[ 46 | [IFImageFilter filterImageNamed:@"kelvinMap"], 47 | ]]; 48 | return self; 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFNashvilleFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFNashvilleFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFNashvilleFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFNashvilleFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFNashvilleFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFNashvilleFilter.h" 10 | 11 | NSString *const kIFNashvilleShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; 19 | 20 | void main() 21 | { 22 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 23 | texel = vec3( 24 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 25 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 26 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 27 | gl_FragColor = vec4(texel, 1.0); 28 | } 29 | ); 30 | 31 | @implementation IFNashvilleFilter 32 | 33 | 34 | 35 | - (id)init 36 | { 37 | self = [super initWithFragmentShaderFromString:kIFNashvilleShaderString 38 | sources:@[ 39 | [IFImageFilter filterImageNamed:@"nashvilleMap"], 40 | ]]; 41 | return self; 42 | } 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFNormalFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFNormalFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFNormalFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFNormalFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFNormalFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFNormalFilter.h" 10 | 11 | NSString *const kIFNormalShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | 19 | void main() 20 | { 21 | 22 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 23 | 24 | gl_FragColor = vec4(texel, 1.0); 25 | } 26 | ); 27 | 28 | @implementation IFNormalFilter 29 | 30 | - (id)init; 31 | { 32 | if (!(self = [super initWithFragmentShaderFromString:kIFNormalShaderString])) 33 | { 34 | return nil; 35 | } 36 | 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFRiseFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFRiseFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFRiseFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFRiseFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFRiseFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFRiseFilter.h" 10 | 11 | NSString *const kIFRiseShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //blowout; 19 | uniform sampler2D inputImageTexture3; //overlay; 20 | uniform sampler2D inputImageTexture4; //map 21 | 22 | void main() 23 | { 24 | 25 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 26 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 27 | 28 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 29 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 30 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 31 | 32 | vec4 mapped; 33 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 34 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 35 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 36 | mapped.a = 1.0; 37 | 38 | gl_FragColor = mapped; 39 | } 40 | ); 41 | 42 | @implementation IFRiseFilter 43 | 44 | - (id)init 45 | { 46 | self = [super initWithFragmentShaderFromString:kIFRiseShaderString 47 | sources:@[ 48 | [IFImageFilter filterImageNamed:@"blackboard1024"], 49 | [IFImageFilter filterImageNamed:@"overlayMap"], 50 | [IFImageFilter filterImageNamed:@"riseMap"], 51 | ]]; 52 | return self; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFSierraFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFSierraFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFSierraFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFSierraFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFSierraFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFSierraFilter.h" 10 | 11 | NSString *const kIFSierraShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //blowout; 19 | uniform sampler2D inputImageTexture3; //overlay; 20 | uniform sampler2D inputImageTexture4; //map 21 | 22 | void main() 23 | { 24 | 25 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 26 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 27 | 28 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 29 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 30 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 31 | 32 | vec4 mapped; 33 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 34 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 35 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 36 | mapped.a = 1.0; 37 | 38 | gl_FragColor = mapped; 39 | } 40 | ); 41 | 42 | @implementation IFSierraFilter 43 | 44 | - (id)init 45 | { 46 | self = [super initWithFragmentShaderFromString:kIFSierraShaderString 47 | sources:@[ 48 | [IFImageFilter filterImageNamed:@"sierraVignette"], 49 | [IFImageFilter filterImageNamed:@"overlayMap"], 50 | [IFImageFilter filterImageNamed:@"sierraMap"], 51 | ]]; 52 | return self; 53 | } 54 | 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFSutroFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFSutroFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFSutroFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFSutroFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFSutroFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFSutroFilter.h" 10 | 11 | NSString *const kIFSutroShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //sutroMap; 19 | uniform sampler2D inputImageTexture3; //sutroMetal; 20 | uniform sampler2D inputImageTexture4; //softLight 21 | uniform sampler2D inputImageTexture5; //sutroEdgeburn 22 | uniform sampler2D inputImageTexture6; //sutroCurves 23 | 24 | void main() 25 | { 26 | 27 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 28 | 29 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 30 | float d = dot(tc, tc); 31 | vec2 lookup = vec2(d, texel.r); 32 | texel.r = texture2D(inputImageTexture2, lookup).r; 33 | lookup.y = texel.g; 34 | texel.g = texture2D(inputImageTexture2, lookup).g; 35 | lookup.y = texel.b; 36 | texel.b = texture2D(inputImageTexture2, lookup).b; 37 | 38 | vec3 rgbPrime = vec3(0.1019, 0.0, 0.0); 39 | float m = dot(vec3(.3, .59, .11), texel.rgb) - 0.03058; 40 | texel = mix(texel, rgbPrime + m, 0.32); 41 | 42 | vec3 metal = texture2D(inputImageTexture3, textureCoordinate).rgb; 43 | texel.r = texture2D(inputImageTexture4, vec2(metal.r, texel.r)).r; 44 | texel.g = texture2D(inputImageTexture4, vec2(metal.g, texel.g)).g; 45 | texel.b = texture2D(inputImageTexture4, vec2(metal.b, texel.b)).b; 46 | 47 | texel = texel * texture2D(inputImageTexture5, textureCoordinate).rgb; 48 | 49 | texel.r = texture2D(inputImageTexture6, vec2(texel.r, .16666)).r; 50 | texel.g = texture2D(inputImageTexture6, vec2(texel.g, .5)).g; 51 | texel.b = texture2D(inputImageTexture6, vec2(texel.b, .83333)).b; 52 | 53 | 54 | gl_FragColor = vec4(texel, 1.0); 55 | } 56 | ); 57 | 58 | @implementation IFSutroFilter 59 | 60 | 61 | - (id)init 62 | { 63 | self = [super initWithFragmentShaderFromString:kIFSutroShaderString 64 | sources:@[ 65 | [IFImageFilter filterImageNamed:@"vignetteMap"], 66 | [IFImageFilter filterImageNamed:@"sutroMetal"], 67 | [IFImageFilter filterImageNamed:@"softLight"], 68 | [IFImageFilter filterImageNamed:@"sutroEdgeBurn"], 69 | [IFImageFilter filterImageNamed:@"sutroCurves"], 70 | ]]; 71 | return self; 72 | } 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFToasterFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFToasterFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFToasterFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFToasterFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFToasterFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFToasterFilter.h" 10 | 11 | NSString *const kIFToasterShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //toasterMetal 19 | uniform sampler2D inputImageTexture3; //toasterSoftlight 20 | uniform sampler2D inputImageTexture4; //toasterCurves 21 | uniform sampler2D inputImageTexture5; //toasterOverlayMapWarm 22 | uniform sampler2D inputImageTexture6; //toasterColorshift 23 | 24 | void main() 25 | { 26 | lowp vec3 texel; 27 | mediump vec2 lookup; 28 | vec2 blue; 29 | vec2 green; 30 | vec2 red; 31 | lowp vec4 tmpvar_1; 32 | tmpvar_1 = texture2D (inputImageTexture, textureCoordinate); 33 | texel = tmpvar_1.xyz; 34 | lowp vec4 tmpvar_2; 35 | tmpvar_2 = texture2D (inputImageTexture2, textureCoordinate); 36 | lowp vec2 tmpvar_3; 37 | tmpvar_3.x = tmpvar_2.x; 38 | tmpvar_3.y = tmpvar_1.x; 39 | texel.x = texture2D (inputImageTexture3, tmpvar_3).x; 40 | lowp vec2 tmpvar_4; 41 | tmpvar_4.x = tmpvar_2.y; 42 | tmpvar_4.y = tmpvar_1.y; 43 | texel.y = texture2D (inputImageTexture3, tmpvar_4).y; 44 | lowp vec2 tmpvar_5; 45 | tmpvar_5.x = tmpvar_2.z; 46 | tmpvar_5.y = tmpvar_1.z; 47 | texel.z = texture2D (inputImageTexture3, tmpvar_5).z; 48 | red.x = texel.x; 49 | red.y = 0.16666; 50 | green.x = texel.y; 51 | green.y = 0.5; 52 | blue.x = texel.z; 53 | blue.y = 0.833333; 54 | texel.x = texture2D (inputImageTexture4, red).x; 55 | texel.y = texture2D (inputImageTexture4, green).y; 56 | texel.z = texture2D (inputImageTexture4, blue).z; 57 | mediump vec2 tmpvar_6; 58 | tmpvar_6 = ((2.0 * textureCoordinate) - 1.0); 59 | mediump vec2 tmpvar_7; 60 | tmpvar_7.x = dot (tmpvar_6, tmpvar_6); 61 | tmpvar_7.y = texel.x; 62 | lookup = tmpvar_7; 63 | texel.x = texture2D (inputImageTexture5, tmpvar_7).x; 64 | lookup.y = texel.y; 65 | texel.y = texture2D (inputImageTexture5, lookup).y; 66 | lookup.y = texel.z; 67 | texel.z = texture2D (inputImageTexture5, lookup).z; 68 | red.x = texel.x; 69 | green.x = texel.y; 70 | blue.x = texel.z; 71 | texel.x = texture2D (inputImageTexture6, red).x; 72 | texel.y = texture2D (inputImageTexture6, green).y; 73 | texel.z = texture2D (inputImageTexture6, blue).z; 74 | lowp vec4 tmpvar_8; 75 | tmpvar_8.w = 1.0; 76 | tmpvar_8.xyz = texel; 77 | gl_FragColor = tmpvar_8; 78 | } 79 | ); 80 | 81 | @implementation IFToasterFilter 82 | 83 | 84 | - (id)init 85 | { 86 | self = [super initWithFragmentShaderFromString:kIFToasterShaderString 87 | sources:@[ 88 | [IFImageFilter filterImageNamed:@"toasterMetal"], 89 | [IFImageFilter filterImageNamed:@"toasterSoftLight"], 90 | [IFImageFilter filterImageNamed:@"toasterCurves"], 91 | [IFImageFilter filterImageNamed:@"toasterOverlayMapWarm"], 92 | [IFImageFilter filterImageNamed:@"toasterColorShift"], 93 | ]]; 94 | return self; 95 | } 96 | @end 97 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFValenciaFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFValenciaFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFValenciaFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFValenciaFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFValenciaFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFValenciaFilter.h" 10 | 11 | 12 | NSString *const kIFValenciaShaderString = SHADER_STRING 13 | ( 14 | precision lowp float; 15 | 16 | varying highp vec2 textureCoordinate; 17 | 18 | uniform sampler2D inputImageTexture; 19 | uniform sampler2D inputImageTexture2; //map 20 | uniform sampler2D inputImageTexture3; //gradMap 21 | 22 | mat3 saturateMatrix = mat3( 23 | 1.1402, 24 | -0.0598, 25 | -0.061, 26 | -0.1174, 27 | 1.0826, 28 | -0.1186, 29 | -0.0228, 30 | -0.0228, 31 | 1.1772); 32 | 33 | vec3 lumaCoeffs = vec3(.3, .59, .11); 34 | 35 | void main() 36 | { 37 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 38 | 39 | texel = vec3( 40 | texture2D(inputImageTexture2, vec2(texel.r, .1666666)).r, 41 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 42 | texture2D(inputImageTexture2, vec2(texel.b, .8333333)).b 43 | ); 44 | 45 | texel = saturateMatrix * texel; 46 | float luma = dot(lumaCoeffs, texel); 47 | texel = vec3( 48 | texture2D(inputImageTexture3, vec2(luma, texel.r)).r, 49 | texture2D(inputImageTexture3, vec2(luma, texel.g)).g, 50 | texture2D(inputImageTexture3, vec2(luma, texel.b)).b); 51 | 52 | gl_FragColor = vec4(texel, 1.0); 53 | } 54 | ); 55 | 56 | @implementation IFValenciaFilter 57 | 58 | - (id)init 59 | { 60 | self = [super initWithFragmentShaderFromString:kIFValenciaShaderString 61 | sources:@[ 62 | [IFImageFilter filterImageNamed:@"valenciaMap"], 63 | [IFImageFilter filterImageNamed:@"valenciaGradientMap"], 64 | ]]; 65 | return self; 66 | } 67 | 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFWaldenFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFWaldenFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFWaldenFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFWaldenFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFWaldenFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFWaldenFilter.h" 10 | 11 | NSString *const kIFWaldenShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //map 19 | uniform sampler2D inputImageTexture3; //vigMap 20 | 21 | void main() 22 | { 23 | 24 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 25 | 26 | texel = vec3( 27 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 28 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 29 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 30 | 31 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 32 | float d = dot(tc, tc); 33 | vec2 lookup = vec2(d, texel.r); 34 | texel.r = texture2D(inputImageTexture3, lookup).r; 35 | lookup.y = texel.g; 36 | texel.g = texture2D(inputImageTexture3, lookup).g; 37 | lookup.y = texel.b; 38 | texel.b = texture2D(inputImageTexture3, lookup).b; 39 | 40 | gl_FragColor = vec4(texel, 1.0); 41 | } 42 | ); 43 | 44 | @implementation IFWaldenFilter 45 | 46 | 47 | - (id)init 48 | { 49 | self = [super initWithFragmentShaderFromString:kIFWaldenShaderString 50 | sources:@[ 51 | [IFImageFilter filterImageNamed:@"waldenMap"], 52 | [IFImageFilter filterImageNamed:@"vignetteMap"], 53 | ]]; 54 | return self; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFXproIIFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IFXproIIFilter.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFImageFilter.h" 10 | 11 | @interface IFXproIIFilter : IFImageFilter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/IFXproIIFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // IFXproIIFilter.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | #import "IFXproIIFilter.h" 10 | 11 | NSString *const kIFXproIIShaderString = SHADER_STRING 12 | ( 13 | precision lowp float; 14 | 15 | varying highp vec2 textureCoordinate; 16 | 17 | uniform sampler2D inputImageTexture; 18 | uniform sampler2D inputImageTexture2; //map 19 | uniform sampler2D inputImageTexture3; //vigMap 20 | 21 | void main() 22 | { 23 | 24 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 25 | 26 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 27 | float d = dot(tc, tc); 28 | vec2 lookup = vec2(d, texel.r); 29 | texel.r = texture2D(inputImageTexture3, lookup).r; 30 | lookup.y = texel.g; 31 | texel.g = texture2D(inputImageTexture3, lookup).g; 32 | lookup.y = texel.b; 33 | texel.b = texture2D(inputImageTexture3, lookup).b; 34 | 35 | vec2 red = vec2(texel.r, 0.16666); 36 | vec2 green = vec2(texel.g, 0.5); 37 | vec2 blue = vec2(texel.b, .83333); 38 | texel.r = texture2D(inputImageTexture2, red).r; 39 | texel.g = texture2D(inputImageTexture2, green).g; 40 | texel.b = texture2D(inputImageTexture2, blue).b; 41 | 42 | gl_FragColor = vec4(texel, 1.0); 43 | 44 | } 45 | ); 46 | 47 | @implementation IFXproIIFilter 48 | 49 | - (id)init 50 | { 51 | self = [super initWithFragmentShaderFromString:kIFXproIIShaderString 52 | sources:@[ 53 | [IFImageFilter filterImageNamed:@"xproMap"], 54 | [IFImageFilter filterImageNamed:@"vignetteMap"], 55 | ]]; 56 | return self; 57 | } 58 | 59 | 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /Sources/Filters/Instagram/InstaFilters.h: -------------------------------------------------------------------------------- 1 | // 2 | // InstaFilters.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by Kim Daewook. 6 | // Copyright (c) 2015 Kim Daewook. All rights reserved. 7 | // 8 | 9 | 10 | #import "IFImageFilter.h" 11 | 12 | #import "IFSutroFilter.h" 13 | #import "IFAmaroFilter.h" 14 | #import "IFNormalFilter.h" 15 | #import "IFRiseFilter.h" 16 | #import "IFHudsonFilter.h" 17 | #import "IFXproIIFilter.h" 18 | #import "IFSierraFilter.h" 19 | #import "IFLomofiFilter.h" 20 | #import "IFEarlybirdFilter.h" 21 | #import "IFToasterFilter.h" 22 | #import "IFBrannanFilter.h" 23 | #import "IFInkwellFilter.h" 24 | #import "IFWaldenFilter.h" 25 | #import "IFHefeFilter.h" 26 | #import "IFValenciaFilter.h" 27 | #import "IFNashvilleFilter.h" 28 | #import "IF1977Filter.h" 29 | #import "IFLordKelvinFilter.h" -------------------------------------------------------------------------------- /Sources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Sources/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // GPUImage-Instagram 4 | // 5 | // Created by KimDaeWook on 1/16/16. 6 | // Copyright © 2016 KimDaewook. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | @property (weak, nonatomic) IBOutlet UILabel *filterLabel; 14 | - (IBAction)changeFilter; 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /Sources/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by KimDaeWook on 1/16/16. 6 | // Copyright © 2016 KimDaewook. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "IFImageFilter.h" 11 | #import "GPUImage.h" 12 | 13 | @implementation ViewController{ 14 | NSArray* instagramFilters; 15 | NSInteger _filterIndex; 16 | GPUImagePicture *stillImageSource; 17 | 18 | } 19 | 20 | - (GPUImageView*)imageView { 21 | return (GPUImageView*)self.view; 22 | } 23 | 24 | - (void)viewDidLoad { 25 | [super viewDidLoad]; 26 | 27 | 28 | 29 | UIImage *inputImage = [UIImage imageNamed:@"sample_kuru.jpg"]; 30 | 31 | _filterIndex = 0; 32 | instagramFilters = [IFImageFilter allFilterClasses]; 33 | 34 | 35 | stillImageSource = [[GPUImagePicture alloc] initWithImage:inputImage]; 36 | 37 | [self changeFilter]; 38 | 39 | 40 | NSLog(@"Complte"); 41 | 42 | } 43 | 44 | - (void)didReceiveMemoryWarning { 45 | [super didReceiveMemoryWarning]; 46 | // Dispose of any resources that can be recreated. 47 | } 48 | 49 | - (IBAction)changeFilter { 50 | 51 | NSInteger filterIndex = (_filterIndex++ % instagramFilters.count); 52 | 53 | [stillImageSource removeAllTargets]; 54 | 55 | IFImageFilter *imageFilter = [[[instagramFilters objectAtIndex:filterIndex] alloc] init]; 56 | [imageFilter addTarget:(GPUImageView*)self.view]; 57 | 58 | [stillImageSource addTarget:imageFilter]; 59 | 60 | [imageFilter useNextFrameForImageCapture]; 61 | [stillImageSource processImage]; 62 | 63 | 64 | [imageFilter imageFromCurrentFramebuffer]; 65 | [self.filterLabel setText:[NSString stringWithFormat:@"%@ (%ld/%ld)", imageFilter.name, filterIndex+1, instagramFilters.count]]; 66 | 67 | 68 | } 69 | @end 70 | -------------------------------------------------------------------------------- /Sources/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // GPUImage-Instagram 4 | // 5 | // Created by KimDaeWook on 1/16/16. 6 | // Copyright © 2016 KimDaewook. 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 | -------------------------------------------------------------------------------- /Sources/sample_kuru.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KimDaeWook/GPUImage-Instagram/44a974b2356fb10145bdd4b4254f94e41b5e4531/Sources/sample_kuru.jpg --------------------------------------------------------------------------------