├── .gitignore ├── .travis.yml ├── Demo ├── Demo.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── Demo.xcworkspace │ └── contents.xcworkspacedata ├── Demo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ │ └── Main.storyboard │ ├── IGRFilterbarCell.h │ ├── IGRFilterbarCell.m │ ├── ViewController.h │ ├── ViewController.m │ └── main.m ├── DemoSwift │ ├── AppDelegate.swift │ ├── Base.lproj │ │ └── Main.storyboard │ ├── IGRFilterbarCell.swift │ └── ViewController.swift ├── Podfile └── Resources │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── IGRSoft.imageset │ │ ├── Contents.json │ │ ├── igr-logo.png │ │ ├── igr-logo@2x.png │ │ └── igr-logo@3x.png │ ├── TopBar │ │ ├── Contents.json │ │ ├── photo-icon.imageset │ │ │ ├── Contents.json │ │ │ ├── photo-icon@2x.png │ │ │ └── photo-icon@3x.png │ │ ├── save-icon.imageset │ │ │ ├── Contents.json │ │ │ ├── save-icon@2x.png │ │ │ └── save-icon@3x.png │ │ └── share-icon.imageset │ │ │ ├── Contents.json │ │ │ ├── share-icon@2x.png │ │ │ └── share-icon@3x.png │ └── demo.imageset │ │ ├── Contents.json │ │ └── demo.png │ ├── Base.lproj │ └── LaunchScreen.storyboard │ └── Info.plist ├── IGRFilterCombine.podspec ├── IGRFilterCombine.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── IGRFilterCombine.xcscheme │ └── IGRFilterCombineResources.xcscheme ├── IGRFilterCombine.xcworkspace └── contents.xcworkspacedata ├── IGRFilterCombine ├── Category │ ├── NSBundle+IGRFilterCombine.h │ ├── NSBundle+IGRFilterCombine.m │ ├── UIImage+IGRFilterCombine.h │ └── UIImage+IGRFilterCombine.m ├── IGRFilterCombine.h ├── IGRFilterCombine.m └── ShaderFilters │ ├── IGRBaseShaderFilter.h │ ├── IGRBaseShaderFilter.m │ ├── IGRBaseShaderFilterConstants.h │ └── IGRBaseShaderFilterConstants.m ├── IGRFilterCombineFramework ├── IGRFilterCombine.modulemap ├── IGRFilterCombineFramework.h └── Info.plist ├── IGRFilterCombineResources ├── Configs │ └── filters.plist ├── Images │ ├── IF1977Filter │ │ ├── nblowout.png │ │ └── nmap.png │ ├── IFAmaroFilter │ │ ├── amaro_map.png │ │ ├── blackboard.png │ │ └── overlay_map.png │ ├── IFBrannanFilter │ │ ├── brannan_blowout.png │ │ ├── brannan_contrast.png │ │ ├── brannan_luma.png │ │ ├── brannan_process.png │ │ └── brannan_screen.png │ ├── IFEarlybirdFilter │ │ ├── earlybird_blowout.png │ │ ├── earlybird_curves.png │ │ ├── earlybird_map.png │ │ ├── earlybird_overlay_map.png │ │ └── vignette_map.png │ ├── IFHefeFilter │ │ ├── edge_burn.png │ │ ├── hefe_gradient_map.png │ │ ├── hefe_map.png │ │ ├── hefe_metal.png │ │ └── hefe_soft_light.png │ ├── IFHudsonFilter │ │ ├── hudson_background.png │ │ ├── hudson_map.png │ │ └── overlay_map.png │ ├── IFInkwellFilter │ │ └── inkwell_map.png │ ├── IFLomoFilter │ │ ├── lomo_map.png │ │ └── vignette_map.png │ ├── IFLordKelvinFilter │ │ └── kelvin_map.png │ ├── IFNashvilleFilter │ │ └── nashville_map.png │ ├── IFRiseFilter │ │ ├── blackboard.png │ │ ├── overlay_map.png │ │ └── rise_map.png │ ├── IFSierraFilter │ │ ├── overlay_map.png │ │ ├── sierra_map.png │ │ └── sierra_vignette.png │ ├── IFSutroFilter │ │ ├── soft_light.png │ │ ├── sutro_curves.png │ │ ├── sutro_edge_burn.png │ │ ├── sutro_metal.png │ │ └── vignette_map.png │ ├── IFToasterFilter │ │ ├── toaster_color_shift.png │ │ ├── toaster_curves.png │ │ ├── toaster_metal.png │ │ ├── toaster_overlay_map_warm.png │ │ └── toaster_soft_light.png │ ├── IFValenciaFilter │ │ ├── valencia_gradient_map.png │ │ └── valencia_map.png │ ├── IFWaldenFilter │ │ ├── vignette_map.png │ │ └── walden_map.png │ └── IFXprollFilter │ │ ├── vignette_map.png │ │ └── xpro_map.png ├── Info.plist ├── Shaders │ ├── IF1977Filter.glsl │ ├── IFAmaroFilter.glsl │ ├── IFBrannanFilter.glsl │ ├── IFEarlybirdFilter.glsl │ ├── IFHefeFilter.glsl │ ├── IFHudsonFilter.glsl │ ├── IFInkwellFilter.glsl │ ├── IFLomoFilter.glsl │ ├── IFLordKelvinFilter.glsl │ ├── IFNashvilleFilter.glsl │ ├── IFOriginalFilter.glsl │ ├── IFRiseFilter.glsl │ ├── IFSierraFilter.glsl │ ├── IFSutroFilter.glsl │ ├── IFToasterFilter.glsl │ ├── IFValenciaFilter.glsl │ ├── IFWaldenFilter.glsl │ └── IFXprollFilter.glsl └── Xibs │ └── IGRFilterbarCell.xib ├── LICENSE ├── Podfile ├── README.md └── Resources └── IGRFilterCombineResources.bundle ├── Configs └── filters.plist ├── Images ├── IF1977Filter │ ├── nblowout.png │ └── nmap.png ├── IFAmaroFilter │ ├── amaro_map.png │ ├── blackboard.png │ └── overlay_map.png ├── IFBrannanFilter │ ├── brannan_blowout.png │ ├── brannan_contrast.png │ ├── brannan_luma.png │ ├── brannan_process.png │ └── brannan_screen.png ├── IFEarlybirdFilter │ ├── earlybird_blowout.png │ ├── earlybird_curves.png │ ├── earlybird_map.png │ ├── earlybird_overlay_map.png │ └── vignette_map.png ├── IFHefeFilter │ ├── edge_burn.png │ ├── hefe_gradient_map.png │ ├── hefe_map.png │ ├── hefe_metal.png │ └── hefe_soft_light.png ├── IFHudsonFilter │ ├── hudson_background.png │ ├── hudson_map.png │ └── overlay_map.png ├── IFInkwellFilter │ └── inkwell_map.png ├── IFLomoFilter │ ├── lomo_map.png │ └── vignette_map.png ├── IFLordKelvinFilter │ └── kelvin_map.png ├── IFNashvilleFilter │ └── nashville_map.png ├── IFRiseFilter │ ├── blackboard.png │ ├── overlay_map.png │ └── rise_map.png ├── IFSierraFilter │ ├── overlay_map.png │ ├── sierra_map.png │ └── sierra_vignette.png ├── IFSutroFilter │ ├── soft_light.png │ ├── sutro_curves.png │ ├── sutro_edge_burn.png │ ├── sutro_metal.png │ └── vignette_map.png ├── IFToasterFilter │ ├── toaster_color_shift.png │ ├── toaster_curves.png │ ├── toaster_metal.png │ ├── toaster_overlay_map_warm.png │ └── toaster_soft_light.png ├── IFValenciaFilter │ ├── valencia_gradient_map.png │ └── valencia_map.png ├── IFWaldenFilter │ ├── vignette_map.png │ └── walden_map.png └── IFXprollFilter │ ├── vignette_map.png │ └── xpro_map.png ├── Info.plist └── Shaders ├── IF1977Filter.glsl ├── IFAmaroFilter.glsl ├── IFBrannanFilter.glsl ├── IFEarlybirdFilter.glsl ├── IFHefeFilter.glsl ├── IFHudsonFilter.glsl ├── IFInkwellFilter.glsl ├── IFLomoFilter.glsl ├── IFLordKelvinFilter.glsl ├── IFNashvilleFilter.glsl ├── IFOriginalFilter.glsl ├── IFRiseFilter.glsl ├── IFSierraFilter.glsl ├── IFSutroFilter.glsl ├── IFToasterFilter.glsl ├── IFValenciaFilter.glsl ├── IFWaldenFilter.glsl └── IFXprollFilter.glsl /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | 36 | Pods/ 37 | Podfile.lock 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 52 | 53 | fastlane/report.xml 54 | fastlane/screenshots 55 | 56 | #Code Injection 57 | # 58 | # After new code Injection tools there's a generated folder /iOSInjectionProject 59 | # https://github.com/johnno1962/injectionforxcode 60 | 61 | iOSInjectionProject/ 62 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode9.4 3 | sudo: false 4 | env: 5 | global: 6 | - LANG=en_US.UTF-8 7 | - LANGUAGE=en_US.UTF-8 8 | before_install: 9 | - pod install 10 | script: 11 | - set -o pipefail 12 | - xcodebuild -workspace IGRFilterCombine.xcworkspace -scheme IGRFilterCombine -sdk iphonesimulator 13 | -------------------------------------------------------------------------------- /Demo/Demo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Demo/Demo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Demo/Demo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // Demo 4 | // 5 | // Created by Vitalii Parovishnyk on 1/2/17. 6 | // Copyright © 2017 IGR Software. 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 | -------------------------------------------------------------------------------- /Demo/Demo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // Demo 4 | // 5 | // Created by Vitalii Parovishnyk on 1/2/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Demo/Demo/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /Demo/Demo/IGRFilterbarCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRToolbarCell.h 3 | // IGRFastFilterViewFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface IGRFilterbarCell : UICollectionViewCell 14 | 15 | @property (nonatomic, weak) IBOutlet UILabel *title; 16 | @property (nonatomic, weak) IBOutlet UIImageView *icon; 17 | 18 | @end 19 | 20 | NS_ASSUME_NONNULL_END 21 | -------------------------------------------------------------------------------- /Demo/Demo/IGRFilterbarCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // IGRToolbarCell.m 3 | // IGRFastFilterViewFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "IGRFilterbarCell.h" 10 | 11 | @interface IGRFilterbarCell () 12 | 13 | @end 14 | 15 | @implementation IGRFilterbarCell 16 | 17 | - (void)setSelected:(BOOL)selected 18 | { 19 | [self setNeedsDisplay]; 20 | 21 | super.selected = selected; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /Demo/Demo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRMainViewController.h 3 | // Demo 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface ViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Demo/Demo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // IGRMainViewController.m 3 | // InstaFilters 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import IGRFilterCombine; 10 | 11 | #import "ViewController.h" 12 | #import "IGRFilterbarCell.h" 13 | 14 | @interface ViewController () 17 | 18 | @property (nonatomic, weak ) IBOutlet UICollectionView *collectionView; 19 | @property (nonatomic, weak ) IBOutlet UIImageView *imageView; 20 | 21 | @property (nonatomic, strong) IGRFilterCombine *filterCombine; 22 | 23 | @end 24 | 25 | static NSString * const kWorkImageNotification = @"WorkImageNotification"; 26 | #define DEMO_IMAGE [UIImage imageNamed:@"demo"] 27 | 28 | @implementation ViewController 29 | 30 | #pragma mark - Life Cycle 31 | 32 | - (void)viewDidLoad 33 | { 34 | [super viewDidLoad]; 35 | 36 | self.filterCombine = [[IGRFilterCombine alloc] initWithDelegate:self]; 37 | 38 | NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; 39 | [defaultCenter addObserver:self 40 | selector:@selector(setupWorkImage:) 41 | name:kWorkImageNotification object:nil]; 42 | } 43 | 44 | - (void)viewDidAppear:(BOOL)animated 45 | { 46 | [super viewDidAppear:animated]; 47 | 48 | static dispatch_once_t onceToken; 49 | dispatch_once(&onceToken, ^{ 50 | [self setupDemoView]; 51 | }); 52 | } 53 | 54 | - (void)dealloc 55 | { 56 | NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter]; 57 | [defaultCenter removeObserver:self name:kWorkImageNotification object:nil]; 58 | } 59 | 60 | #pragma mark - Private 61 | 62 | - (void)setupDemoView 63 | { 64 | [[NSNotificationCenter defaultCenter] postNotificationName:kWorkImageNotification 65 | object:DEMO_IMAGE]; 66 | } 67 | 68 | - (UIImage *)prepareImage 69 | { 70 | return self.imageView.image; 71 | } 72 | 73 | #pragma mark - Action 74 | 75 | - (IBAction)onTouchGetImageButton:(UIBarButtonItem *)sender 76 | { 77 | UIAlertControllerStyle style = UIAlertControllerStyleActionSheet; 78 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:NSLocalizedString(@"Select image", @"") 79 | message:@"" 80 | preferredStyle:style]; 81 | 82 | alert.popoverPresentationController.barButtonItem = sender; 83 | 84 | __weak typeof(self) weak = self; 85 | void(^completeActionBlock)(UIImagePickerControllerSourceType) = ^(UIImagePickerControllerSourceType type) { 86 | UIImagePickerController *pickerView = [[UIImagePickerController alloc] init]; 87 | pickerView.delegate = weak; 88 | [pickerView setSourceType:type]; 89 | [self presentViewController:pickerView animated:YES completion:nil]; 90 | }; 91 | 92 | UIAlertAction *action = [UIAlertAction actionWithTitle:NSLocalizedString(@"From Library", @"") 93 | style:UIAlertActionStyleDefault 94 | handler:^(UIAlertAction * action) { 95 | completeActionBlock(UIImagePickerControllerSourceTypePhotoLibrary); 96 | }]; 97 | [alert addAction:action]; 98 | 99 | UIAlertAction *cameraAction = [UIAlertAction actionWithTitle:NSLocalizedString(@"From Camera", @"") 100 | style:UIAlertActionStyleDefault 101 | handler:^(UIAlertAction * action) { 102 | completeActionBlock(UIImagePickerControllerSourceTypeCamera); 103 | }]; 104 | [alert addAction:cameraAction]; 105 | 106 | UIAlertAction* cancel = [UIAlertAction actionWithTitle:NSLocalizedString(@"Cancel", @"") 107 | style:UIAlertActionStyleCancel 108 | handler:nil]; 109 | 110 | [alert addAction:cancel]; 111 | 112 | [self presentViewController:alert animated:YES completion:nil]; 113 | } 114 | 115 | - (IBAction)onTouchShareButton:(UIBarButtonItem *)sender 116 | { 117 | UIImage *image = [self prepareImage]; 118 | 119 | UIActivityViewController *avc = [[UIActivityViewController alloc] initWithActivityItems:@[image] 120 | applicationActivities:nil]; 121 | avc.popoverPresentationController.barButtonItem = sender; 122 | avc.popoverPresentationController.permittedArrowDirections = UIPopoverArrowDirectionUp; 123 | 124 | [self presentViewController:avc animated:YES completion:nil]; 125 | } 126 | 127 | #pragma mark - UICollectionViewDataSource 128 | 129 | - (NSInteger)collectionView:(UICollectionView *)collectionView 130 | numberOfItemsInSection:(NSInteger)section 131 | { 132 | return self.filterCombine.count; 133 | } 134 | 135 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView 136 | cellForItemAtIndexPath:(NSIndexPath *)indexPath 137 | { 138 | IGRFilterbarCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"IGRFilterbarCell" 139 | forIndexPath:indexPath]; 140 | 141 | cell.icon.image = [self.filterCombine filteredPreviewImageAtIndex:indexPath.row]; 142 | cell.title.text = [self.filterCombine filtereNameAtIndex:indexPath.row]; 143 | 144 | return cell; 145 | } 146 | 147 | #pragma mark - UICollectionViewDelegate 148 | 149 | - (void)collectionView:(UICollectionView *)collectionView 150 | didSelectItemAtIndexPath:(NSIndexPath *)indexPath 151 | { 152 | CGFloat borderOffset = [self igr_borderOffsetFromFiltersbar:collectionView]; 153 | 154 | UICollectionViewLayoutAttributes *attrs = [collectionView layoutAttributesForItemAtIndexPath:indexPath]; 155 | CGRect frame = attrs.frame; 156 | frame = UIEdgeInsetsInsetRect(frame, UIEdgeInsetsMake(0.0, -borderOffset, 0.0, -borderOffset)); 157 | [collectionView scrollRectToVisible:frame animated:YES]; 158 | 159 | self.imageView.image = [self.filterCombine filteredImageAtIndex:indexPath.row]; 160 | } 161 | 162 | - (void)collectionView:(UICollectionView *)collectionView 163 | didDeselectItemAtIndexPath:(NSIndexPath *)indexPath 164 | { 165 | UICollectionViewCell *cell = [collectionView cellForItemAtIndexPath:indexPath]; 166 | [cell setSelected:NO]; 167 | } 168 | 169 | - (CGSize)collectionView:(UICollectionView *)collectionView 170 | layout:(nonnull UICollectionViewLayout *)collectionViewLayout 171 | sizeForItemAtIndexPath:(nonnull NSIndexPath *)indexPath 172 | { 173 | return CGSizeMake(100.0, 100.0); 174 | } 175 | 176 | - (CGFloat)igr_borderOffsetFromFiltersbar:(UICollectionView *)collectionView 177 | { 178 | return collectionView.frame.size.height * 0.5; 179 | } 180 | 181 | #pragma mark - IGRFilterCombineDelegate 182 | 183 | - (CGSize)previewSize 184 | { 185 | return CGSizeMake(70.0, 70.0); 186 | } 187 | 188 | #pragma mark - NSNotificationCenter 189 | 190 | - (void)setupWorkImage:(NSNotification *)notification 191 | { 192 | NSAssert([notification.object isKindOfClass:[UIImage class]], @"Image only allowed!"); 193 | UIImage *image = notification.object; 194 | 195 | __weak typeof(self) weak = self; 196 | [self.filterCombine setImage:image 197 | completion:^(UIImage * _Nullable processedImage, NSUInteger idx) { 198 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection:0]; 199 | if ([[weak.collectionView indexPathsForSelectedItems] containsObject:indexPath]) 200 | { 201 | dispatch_async(dispatch_get_main_queue(), ^{ 202 | weak.imageView.image = processedImage; 203 | }); 204 | } 205 | } 206 | preview:^(UIImage * _Nullable processedImage, NSUInteger idx) { 207 | NSIndexPath *indexPath = [NSIndexPath indexPathForRow:idx inSection:0]; 208 | if ([[weak.collectionView indexPathsForVisibleItems] containsObject:indexPath]) 209 | { 210 | dispatch_async(dispatch_get_main_queue(), ^{ 211 | IGRFilterbarCell *cell = (IGRFilterbarCell *)[weak.collectionView cellForItemAtIndexPath:indexPath]; 212 | cell.icon.image = processedImage; 213 | }); 214 | } 215 | }]; 216 | 217 | self.imageView.image = image; 218 | [self.collectionView reloadData]; 219 | } 220 | 221 | #pragma mark - PickerDelegates 222 | 223 | - (void)imagePickerController:(UIImagePickerController *)picker 224 | didFinishPickingMediaWithInfo:(NSDictionary *)info 225 | { 226 | UIImage *img = [info valueForKey:UIImagePickerControllerOriginalImage]; 227 | [[NSNotificationCenter defaultCenter] postNotificationName:kWorkImageNotification 228 | object:img]; 229 | 230 | [picker dismissViewControllerAnimated:YES completion:nil]; 231 | } 232 | 233 | @end 234 | -------------------------------------------------------------------------------- /Demo/Demo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // Demo 4 | // 5 | // Created by Vitalii Parovishnyk on 1/2/17. 6 | // Copyright © 2017 IGR Software. 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 | -------------------------------------------------------------------------------- /Demo/DemoSwift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // DemoSwift 4 | // 5 | // Created by Vitalii Parovishnyk on 1/8/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Demo/DemoSwift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | -------------------------------------------------------------------------------- /Demo/DemoSwift/IGRFilterbarCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterbarCell.swift 3 | // Demo 4 | // 5 | // Created by Vitalii Parovishnyk on 2/5/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class IGRFilterbarCell: UICollectionViewCell { 12 | 13 | @IBOutlet weak open var title: UILabel? 14 | @IBOutlet weak open var icon: UIImageView? 15 | } 16 | -------------------------------------------------------------------------------- /Demo/DemoSwift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // DemoSwift 4 | // 5 | // Created by Vitalii Parovishnyk on 1/8/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | import IGRFilterCombine 12 | 13 | class ViewController: UIViewController { 14 | 15 | @IBOutlet weak fileprivate var collectionView: UICollectionView? 16 | @IBOutlet weak fileprivate var imageView: UIImageView? 17 | 18 | fileprivate var filterCombine: IGRFilterCombine? 19 | 20 | static let kImageNotification = NSNotification.Name(rawValue: "WorkImageNotification") 21 | let kDemoImage = UIImage.init(named: "demo") 22 | 23 | override func viewDidLoad() { 24 | super.viewDidLoad() 25 | 26 | filterCombine = IGRFilterCombine(delegate: self as IGRFilterCombineDelegate) 27 | 28 | let notificationCenter = NotificationCenter.default 29 | notificationCenter.addObserver(self, 30 | selector: #selector(setupWorkImage(_:)), 31 | name: ViewController.kImageNotification, 32 | object: nil) 33 | } 34 | 35 | override func viewDidAppear(_ animated: Bool) { 36 | super.viewDidAppear(animated) 37 | 38 | DispatchQueue.once(token: "com.igrsoft.fastfilter.demo") { 39 | self.setupDemoView() 40 | } 41 | } 42 | 43 | deinit { 44 | let notificationCenter = NotificationCenter.default 45 | notificationCenter.removeObserver(self, 46 | name: ViewController.kImageNotification, 47 | object: nil) 48 | } 49 | 50 | override func didReceiveMemoryWarning() { 51 | super.didReceiveMemoryWarning() 52 | // Dispose of any resources that can be recreated. 53 | } 54 | 55 | fileprivate func setupDemoView() { 56 | let notificationCenter = NotificationCenter.default 57 | notificationCenter.post(name: ViewController.kImageNotification, object: kDemoImage) 58 | } 59 | 60 | func setupWorkImage(_ notification: Notification) { 61 | assert(notification.object is UIImage, "Image only allowed!") 62 | let image = notification.object as! UIImage 63 | 64 | self.filterCombine?.setImage(image, completion: { (processedImage, idx) in 65 | let indexPath = IndexPath(row: Int(idx), section: 0) 66 | if (self.collectionView?.indexPathsForSelectedItems?.contains(indexPath))! { 67 | self.imageView?.image = processedImage 68 | } 69 | }) { (processedImage, idx) in 70 | let indexPath = IndexPath(row: Int(idx), section: 0) 71 | if (self.collectionView?.indexPathsForVisibleItems.contains(indexPath))! { 72 | let cell = self.collectionView?.cellForItem(at: indexPath) as! IGRFilterbarCell 73 | cell.icon?.image = processedImage 74 | } 75 | } 76 | 77 | self.imageView?.image = image 78 | self.collectionView?.reloadData() 79 | } 80 | 81 | func prepareImage() -> UIImage { 82 | return (self.imageView?.image)! 83 | } 84 | 85 | @IBAction func onTouchGetImageButton(_ sender: UIBarButtonItem) 86 | { 87 | let alert = UIAlertController.init(title: NSLocalizedString("Select image", comment: ""), message: "", preferredStyle: UIAlertControllerStyle.actionSheet) 88 | 89 | alert.popoverPresentationController?.barButtonItem = sender 90 | 91 | func completeAlert(type: UIImagePickerControllerSourceType) { 92 | let pickerView = UIImagePickerController.init() 93 | pickerView.delegate = self 94 | pickerView.sourceType = type 95 | self.present(pickerView, animated: true, completion: nil) 96 | } 97 | 98 | let style = UIAlertActionStyle.default 99 | var action = UIAlertAction.init(title: NSLocalizedString("From Library", comment: ""), 100 | style: style) { (UIAlertAction) in 101 | completeAlert(type: UIImagePickerControllerSourceType.photoLibrary) 102 | } 103 | 104 | alert.addAction(action) 105 | 106 | action = UIAlertAction.init(title: NSLocalizedString("From Camera", comment: ""), 107 | style: style) { (UIAlertAction) in 108 | completeAlert(type: UIImagePickerControllerSourceType.camera) 109 | } 110 | 111 | alert.addAction(action) 112 | 113 | action = UIAlertAction.init(title: NSLocalizedString("Cancel", comment: ""), 114 | style: style) 115 | 116 | alert.addAction(action) 117 | 118 | self.present(alert, animated: true, completion: nil) 119 | } 120 | 121 | 122 | @IBAction func onTouchShareButton(_ sender: UIBarButtonItem) { 123 | 124 | let image = prepareImage() 125 | 126 | let avc = UIActivityViewController.init(activityItems: [image], applicationActivities: nil) 127 | 128 | avc.popoverPresentationController?.barButtonItem = sender 129 | avc.popoverPresentationController?.permittedArrowDirections = .up 130 | 131 | self.present(avc, animated: true, completion: nil) 132 | } 133 | 134 | func igr_borderOffsetFromFiltersbar(collectionView: UICollectionView) -> CGFloat { 135 | return collectionView.frame.size.height * 0.5 136 | } 137 | } 138 | 139 | extension ViewController : UICollectionViewDelegate, UICollectionViewDataSource { 140 | func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 141 | return Int(self.filterCombine!.count()) 142 | } 143 | 144 | func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 145 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "IGRFilterbarCell", for: indexPath) as! IGRFilterbarCell 146 | 147 | cell.icon?.image = self.filterCombine?.filteredPreviewImage(at: UInt(indexPath.row)) 148 | cell.title?.text = self.filterCombine?.filtereName(at: UInt(indexPath.row)) 149 | 150 | return cell 151 | } 152 | 153 | func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { 154 | return CGSize(width: 100.0, height: 100.0) 155 | } 156 | 157 | func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 158 | let borderOffset = self.igr_borderOffsetFromFiltersbar(collectionView: collectionView) 159 | 160 | let attrs = collectionView.layoutAttributesForItem(at: indexPath) 161 | var frame = attrs?.frame 162 | frame = UIEdgeInsetsInsetRect(frame!, UIEdgeInsetsMake(0.0, -borderOffset, 0.0, -borderOffset)) 163 | collectionView.scrollRectToVisible(frame!, animated: true) 164 | 165 | self.imageView?.image = self.filterCombine?.filteredImage(at: UInt(indexPath.row)) 166 | } 167 | } 168 | 169 | extension ViewController : UIImagePickerControllerDelegate, UINavigationControllerDelegate { 170 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 171 | let image = info[UIImagePickerControllerOriginalImage] 172 | let notificationCenter = NotificationCenter.default 173 | notificationCenter.post(name: ViewController.kImageNotification, object: image) 174 | 175 | picker.dismiss(animated: true, completion: nil) 176 | } 177 | } 178 | 179 | // MARK: - IGRFilterCombineDelegate 180 | 181 | extension ViewController : IGRFilterCombineDelegate { 182 | func previewSize() -> CGSize { 183 | return CGSize(width: 70.0, height: 70.0) 184 | } 185 | } 186 | 187 | public extension DispatchQueue { 188 | 189 | private static var _onceTracker = [String]() 190 | 191 | /** 192 | Executes a block of code, associated with a unique token, only once. The code is thread safe and will 193 | only execute the code once even in the presence of multithreaded calls. 194 | 195 | - parameter token: A unique reverse DNS style name such as com.vectorform. or a GUID 196 | - parameter block: Block to execute once 197 | */ 198 | public class func once(token: String, block:(Void)->Void) { 199 | objc_sync_enter(self); defer { objc_sync_exit(self) } 200 | 201 | if _onceTracker.contains(token) { 202 | return 203 | } 204 | 205 | _onceTracker.append(token) 206 | block() 207 | } 208 | } 209 | 210 | -------------------------------------------------------------------------------- /Demo/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | use_frameworks! 4 | 5 | source "https://github.com/CocoaPods/Specs.git" 6 | 7 | pod 'IGRFilterCombine', :path => '../' 8 | 9 | target 'Demo' do 10 | end 11 | 12 | target 'DemoSwift' do 13 | end 14 | -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/IGRSoft.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "iphone", 9 | "scale" : "2x", 10 | "filename" : "igr-logo.png" 11 | }, 12 | { 13 | "idiom" : "iphone", 14 | "scale" : "3x", 15 | "filename" : "igr-logo@3x.png" 16 | }, 17 | { 18 | "idiom" : "ipad", 19 | "scale" : "1x", 20 | "filename" : "igr-logo.png" 21 | }, 22 | { 23 | "idiom" : "ipad", 24 | "scale" : "2x", 25 | "filename" : "igr-logo@2x.png" 26 | } 27 | ], 28 | "info" : { 29 | "version" : 1, 30 | "author" : "xcode" 31 | } 32 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo@2x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/IGRSoft.imageset/igr-logo@3x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/photo-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "photo-icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "photo-icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "template" 24 | } 25 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/photo-icon.imageset/photo-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/photo-icon.imageset/photo-icon@2x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/photo-icon.imageset/photo-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/photo-icon.imageset/photo-icon@3x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/save-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "save-icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "save-icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "template" 24 | } 25 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/save-icon.imageset/save-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/save-icon.imageset/save-icon@2x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/save-icon.imageset/save-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/save-icon.imageset/save-icon@3x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/share-icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "share-icon@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "share-icon@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | }, 22 | "properties" : { 23 | "template-rendering-intent" : "template" 24 | } 25 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/share-icon.imageset/share-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/share-icon.imageset/share-icon@2x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/TopBar/share-icon.imageset/share-icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/TopBar/share-icon.imageset/share-icon@3x.png -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/demo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "demo.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /Demo/Resources/Assets.xcassets/demo.imageset/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Demo/Resources/Assets.xcassets/demo.imageset/demo.png -------------------------------------------------------------------------------- /Demo/Resources/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Demo/Resources/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 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSCameraUsageDescription 24 | $(PRODUCT_NAME) camera use 25 | NSPhotoLibraryUsageDescription 26 | $(PRODUCT_NAME) photo use 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | UIInterfaceOrientationPortraitUpsideDown 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /IGRFilterCombine.podspec: -------------------------------------------------------------------------------- 1 | # Use the --use-libraries switch when pushing or linting this podspec 2 | 3 | Pod::Spec.new do |s| 4 | 5 | s.name = 'IGRFilterCombine' 6 | s.version = '0.2.3' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.summary = 'Shader Filters View' 9 | 10 | s.description = <<-DESC 11 | IGRFilterCombine provides: 12 | * Apply Instagram like filters 13 | DESC 14 | 15 | s.homepage = 'https://igrsoft.com' 16 | s.social_media_url = 'https://twitter.com/ikorich' 17 | s.author = 'Vitalii Parovishnyk' 18 | 19 | s.platform = :ios, '9.0' 20 | s.source = { :git => 'https://github.com/IGRSoft/IGRFilterCombine.git', 21 | :tag => s.version 22 | } 23 | 24 | s.public_header_files = 'IGRFilterCombine/*.h', 'IGRFilterCombine/CustomViews/*.h' 25 | s.source_files = 'IGRFilterCombine/**/*.{h,m}' 26 | s.resources = 'Resources/IGRFilterCombineResources.bundle' 27 | s.requires_arc = true 28 | s.weak_frameworks = 'UIKit', 'Foundation', 'CoreGraphics' 29 | 30 | s.ios.dependency 'GPUImage', '0.1.7' 31 | end 32 | -------------------------------------------------------------------------------- /IGRFilterCombine.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IGRFilterCombine.xcodeproj/xcshareddata/xcschemes/IGRFilterCombine.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /IGRFilterCombine.xcodeproj/xcshareddata/xcschemes/IGRFilterCombineResources.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 34 | 35 | 45 | 46 | 52 | 53 | 54 | 55 | 56 | 57 | 63 | 64 | 70 | 71 | 72 | 73 | 75 | 76 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /IGRFilterCombine.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /IGRFilterCombine/Category/NSBundle+IGRFilterCombine.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+IGRFilterCombines.h 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import Foundation; 10 | @import UIKit; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @class IGRBaseShaderFilter; 15 | 16 | @interface NSBundle (IGRFilterCombine) 17 | 18 | + (NSString *)shaderForName:(NSString *)name; 19 | + (UIImage *)imageForName:(NSString *)name forShaderName:(NSString *)shaderName; 20 | 21 | + ( NSArray *)getFilters; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /IGRFilterCombine/Category/NSBundle+IGRFilterCombine.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+IGRFilterCombines.m 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+IGRFilterCombine.h" 10 | #import "IGRFilterCombine.h" 11 | #import "IGRBaseShaderFilter.h" 12 | 13 | @implementation NSBundle (IGRFilterCombine) 14 | 15 | + (instancetype)igr_filtersResourceBundle 16 | { 17 | static NSBundle *resourceBundle = nil; 18 | static dispatch_once_t onceToken; 19 | dispatch_once(&onceToken, ^{ 20 | NSBundle *bundle = [NSBundle bundleForClass:[IGRFilterCombine class]]; 21 | NSString *resourceBundlePath = [bundle pathForResource:@"IGRFilterCombineResources" ofType:@"bundle"]; 22 | 23 | resourceBundle = [self bundleWithPath:resourceBundlePath]; 24 | }); 25 | 26 | return resourceBundle; 27 | } 28 | 29 | + (NSString *)shaderForName:(NSString *)name 30 | { 31 | NSString *path = [[NSBundle igr_filtersResourceBundle] pathForResource:name 32 | ofType:@"glsl" 33 | inDirectory:@"Shaders"]; 34 | return [[NSString alloc] initWithContentsOfFile:path 35 | encoding:NSUTF8StringEncoding 36 | error:nil]; 37 | } 38 | 39 | + (UIImage *)imageForName:(NSString *)name forShaderName:(NSString *)shaderName 40 | { 41 | NSString *dir = [NSString stringWithFormat:@"Images/%@", shaderName]; 42 | NSString *path = [[NSBundle igr_filtersResourceBundle] pathForResource:name 43 | ofType:@"png" 44 | inDirectory:dir]; 45 | return [[UIImage alloc] initWithContentsOfFile:path]; 46 | } 47 | 48 | + (NSArray *)getFilters 49 | { 50 | static NSArray *filters = nil; 51 | 52 | static dispatch_once_t onceToken; 53 | dispatch_once(&onceToken, ^{ 54 | 55 | NSString *path = [[NSBundle igr_filtersResourceBundle] pathForResource:@"filters" 56 | ofType:@"plist" 57 | inDirectory:@"Configs"]; 58 | NSArray *toolbarElements = [NSArray arrayWithContentsOfFile:path]; 59 | 60 | NSMutableArray *_filters = [NSMutableArray array]; 61 | [toolbarElements enumerateObjectsUsingBlock:^(NSDictionary *shaderInfo, NSUInteger idx, BOOL * _Nonnull stop) { 62 | 63 | IGRBaseShaderFilter *filter = [[IGRBaseShaderFilter alloc] initWithDictionary:shaderInfo]; 64 | [_filters addObject:filter]; 65 | }]; 66 | 67 | filters = [_filters copy]; 68 | }); 69 | 70 | return [filters copy]; 71 | } 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /IGRFilterCombine/Category/UIImage+IGRFilterCombine.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.h 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | @import CoreGraphics; 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface UIImage (IGRFilterCombines) 15 | 16 | - (UIImage *)igr_imageWithDefaultOrientation; 17 | - (UIImage *)igr_aspectFillImageWithSize:(CGSize)size; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_END 22 | -------------------------------------------------------------------------------- /IGRFilterCombine/Category/UIImage+IGRFilterCombine.m: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterCombines.m 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "UIImage+IGRFilterCombine.h" 10 | 11 | @implementation UIImage (IGRFilterCombine) 12 | 13 | - (UIImage *)igr_imageWithDefaultOrientation 14 | { 15 | CGFloat radian = 0; 16 | CGSize rotatedSize = self.size; 17 | if (self.imageOrientation == UIImageOrientationUp) 18 | { 19 | return self; 20 | } 21 | else if (self.imageOrientation == UIImageOrientationLeft) 22 | { 23 | radian = -M_PI_2; 24 | rotatedSize = CGSizeMake(rotatedSize.height, rotatedSize.width); 25 | } 26 | else if (self.imageOrientation == UIImageOrientationRight) 27 | { 28 | radian = M_PI_2; 29 | rotatedSize = CGSizeMake(rotatedSize.height, rotatedSize.width); 30 | } 31 | else if (self.imageOrientation == UIImageOrientationDown) 32 | { 33 | radian = M_PI; 34 | } 35 | 36 | // Create the bitmap context 37 | CGSize selfSize = self.size; 38 | UIGraphicsBeginImageContext(selfSize); 39 | CGContextRef bitmap = UIGraphicsGetCurrentContext(); 40 | 41 | // Move the origin to the middle of the image so we will rotate and scale around the center. 42 | CGContextTranslateCTM(bitmap, selfSize.width * 0.5, selfSize.height * 0.5); 43 | 44 | // // Rotate the image context 45 | CGContextRotateCTM(bitmap, radian); 46 | 47 | // Now, draw the rotated/scaled image into the context 48 | CGContextScaleCTM(bitmap, 1.0, -1.0); 49 | CGRect processRect = CGRectMake(-rotatedSize.width * 0.5, 50 | -rotatedSize.height * 0.5, 51 | rotatedSize.width, 52 | rotatedSize.height); 53 | 54 | CGContextDrawImage(bitmap, processRect, [self CGImage]); 55 | 56 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 57 | UIGraphicsEndImageContext(); 58 | 59 | return newImage; 60 | } 61 | 62 | - (UIImage *)igr_aspectFillImageWithSize:(CGSize)size 63 | { 64 | UIGraphicsBeginImageContextWithOptions(size, NO, 0); 65 | 66 | CGSize selfSize = self.size; 67 | CGFloat scale = MAX(size.width / selfSize.width, size.height / selfSize.height); 68 | CGSize newSize = CGSizeMake(ceil(selfSize.width * scale), ceil(selfSize.height * scale)); 69 | CGRect frame = CGRectMake(ceil((size.width - newSize.width) * 0.5), 70 | ceil((size.height - newSize.height) * 0.5), 71 | newSize.width, 72 | newSize.height); 73 | [self drawInRect:frame]; 74 | 75 | UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext(); 76 | UIGraphicsEndImageContext(); 77 | 78 | return newImage; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /IGRFilterCombine/IGRFilterCombine.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterCombine.h 3 | // IGRFilterCombine 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @class IGRBaseShaderFilter; 12 | 13 | typedef void(^IGRFilterCombineImageCompletion)(UIImage * _Nullable processedImage, NSUInteger idx); 14 | 15 | @protocol IGRFilterCombineDelegate 16 | 17 | - (CGSize)previewSize; 18 | 19 | @end 20 | 21 | NS_ASSUME_NONNULL_BEGIN 22 | 23 | @interface IGRFilterCombine : NSObject 24 | 25 | - (instancetype)initWithDelegate:(id)delegate NS_DESIGNATED_INITIALIZER; 26 | - (instancetype)init NS_UNAVAILABLE; 27 | 28 | - (void)setImage:(UIImage *)image 29 | completion:(IGRFilterCombineImageCompletion)completion 30 | preview:(IGRFilterCombineImageCompletion)preview; 31 | 32 | - (NSString *)filtereNameAtIndex:(NSUInteger)imageIndex; 33 | - (UIImage *)filteredImageAtIndex:(NSUInteger)imageIndex; 34 | - (UIImage *)filteredPreviewImageAtIndex:(NSUInteger)imageIndex; 35 | 36 | - (NSUInteger)count; 37 | 38 | @end 39 | 40 | NS_ASSUME_NONNULL_END 41 | -------------------------------------------------------------------------------- /IGRFilterCombine/IGRFilterCombine.m: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterCombine.m 3 | // IGRFilterCombine 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "IGRFilterCombine.h" 10 | #import "IGRBaseShaderFilter.h" 11 | #import "UIImage+IGRFilterCombine.h" 12 | #import "NSBundle+IGRFilterCombine.h" 13 | 14 | const NSUInteger kOriginalImageIndex = 100000; 15 | 16 | @interface IGRFilterCombine () 17 | 18 | @property (nonatomic, strong) UIImage *originalImage; 19 | 20 | @property (nonatomic, weak ) id delegate; 21 | 22 | @property (nonatomic, strong) NSArray *processedImagesFilters; 23 | @property (nonatomic, strong) NSArray *processedPreviewImagesFilters; 24 | 25 | @property (nonatomic, strong) NSMutableArray *cancelBlocks; 26 | @property (nonatomic, strong) NSMutableArray *processedImages; 27 | @property (nonatomic, strong) NSMutableArray *processedPreviewImages; 28 | 29 | @property (nonatomic, copy) IGRFilterCombineImageCompletion processedImagesCompletion; 30 | @property (nonatomic, copy) IGRFilterCombineImageCompletion processedPreviewImagesCompletion; 31 | 32 | @property (nonatomic, copy) IGRBaseShaderFilterCancelBlock cancelFilterProcess; 33 | 34 | @property (nonatomic, strong) NSArray *cachedFilters; 35 | @property (nonatomic, strong) NSMutableArray *dummyCancelBlocks; 36 | 37 | @end 38 | 39 | @implementation IGRFilterCombine 40 | 41 | - (instancetype)initWithDelegate:(id)delegate 42 | { 43 | if (self = [super init]) 44 | { 45 | self.delegate = delegate; 46 | } 47 | 48 | return self; 49 | } 50 | 51 | - (void)setDelegate:(id)delegate 52 | { 53 | _delegate = delegate; 54 | _cachedFilters = [NSBundle getFilters]; 55 | 56 | UIImage *image = [UIImage new]; 57 | NSString *imageName = [self imagePathAtIndex:kOriginalImageIndex]; 58 | IGRBaseShaderFilterCancelBlock cancelBlock = ^{}; 59 | NSMutableArray *imagesName = [NSMutableArray array]; 60 | NSMutableArray *images = [NSMutableArray array]; 61 | _dummyCancelBlocks = [NSMutableArray array]; 62 | 63 | __weak typeof(self) weak = self; 64 | [self.cachedFilters enumerateObjectsUsingBlock:^(IGRBaseShaderFilter *filter, NSUInteger idx, BOOL * _Nonnull stop) { 65 | [imagesName addObject:imageName]; 66 | [images addObject:image]; 67 | [weak.dummyCancelBlocks addObject:cancelBlock]; 68 | }]; 69 | 70 | _processedImages = [imagesName mutableCopy]; 71 | _processedPreviewImages = [images mutableCopy]; 72 | _cancelBlocks = [_dummyCancelBlocks mutableCopy]; 73 | } 74 | 75 | - (void)setOriginalImage:(UIImage *)originalImage 76 | { 77 | _originalImage = originalImage; 78 | NSData *imageData = UIImagePNGRepresentation(originalImage); 79 | NSString *imagePath = [self imagePathAtIndex:kOriginalImageIndex]; 80 | [imageData writeToFile:imagePath atomically:YES]; 81 | 82 | UIImage *thumbImage = [originalImage igr_aspectFillImageWithSize:[self.delegate previewSize]]; 83 | 84 | [_cancelBlocks enumerateObjectsUsingBlock:^(IGRBaseShaderFilterCancelBlock _Nonnull cancelBlock, NSUInteger idx, BOOL * _Nonnull stop) { 85 | cancelBlock(); 86 | }]; 87 | _cancelBlocks = [_dummyCancelBlocks mutableCopy]; 88 | 89 | //Cleean and Setup preview image 90 | __weak typeof(self) weak = self; 91 | [_processedPreviewImagesFilters enumerateObjectsUsingBlock:^(IGRBaseShaderFilter *filter, NSUInteger idx, BOOL * _Nonnull stop) { 92 | [filter removeAllTargets]; 93 | [filter removeOutputFramebuffer]; 94 | }]; 95 | _processedPreviewImagesFilters = [self.cachedFilters copy]; 96 | [_processedPreviewImagesFilters enumerateObjectsUsingBlock:^(IGRBaseShaderFilter *filter, NSUInteger idx, BOOL * _Nonnull stop) { 97 | [weak setFilteredPreviewImage:thumbImage toIndex:idx]; 98 | [filter processImage:thumbImage 99 | completeBlock:^(UIImage * _Nullable processedImage) { 100 | [weak setFilteredPreviewImage:processedImage toIndex:idx]; 101 | weak.processedPreviewImagesCompletion(processedImage, idx); 102 | }]; 103 | }]; 104 | 105 | //Cleean and Setup original image 106 | [_processedImagesFilters enumerateObjectsUsingBlock:^(IGRBaseShaderFilter *filter, NSUInteger idx, BOOL * _Nonnull stop) { 107 | [filter removeAllTargets]; 108 | [filter removeOutputFramebuffer]; 109 | }]; 110 | _processedImagesFilters = [self.cachedFilters copy]; 111 | [_processedImagesFilters enumerateObjectsUsingBlock:^(IGRBaseShaderFilter *filter, NSUInteger idx, BOOL * _Nonnull stop) { 112 | [weak setFilteredImage:originalImage toIndex:idx]; 113 | IGRBaseShaderFilterCancelBlock cancelBlock = [filter processImage:originalImage 114 | completeBlock:^(UIImage * _Nullable processedImage) { 115 | [weak setFilteredImage:processedImage toIndex:idx]; 116 | weak.processedImagesCompletion(processedImage, idx); 117 | }]; 118 | [weak setCancelBlock:cancelBlock toIndex:idx]; 119 | }]; 120 | } 121 | 122 | - (void)setImage:(UIImage *)image 123 | completion:(IGRFilterCombineImageCompletion)completion 124 | preview:(IGRFilterCombineImageCompletion)preview 125 | { 126 | self.processedImagesCompletion = [completion copy]; 127 | self.processedPreviewImagesCompletion = [preview copy]; 128 | 129 | UIImage *fixedImage = [image igr_imageWithDefaultOrientation]; 130 | self.originalImage = fixedImage; 131 | } 132 | 133 | - (NSString *)filtereNameAtIndex:(NSUInteger)imageIndex 134 | { 135 | return _cachedFilters[imageIndex].displayName; 136 | } 137 | 138 | - (void)setFilteredImage:(UIImage *)image toIndex:(NSUInteger)imageIndex 139 | { 140 | NSString *imagePath = [self imagePathAtIndex:imageIndex]; 141 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 142 | NSData *imageData = UIImagePNGRepresentation(image); 143 | 144 | [imageData writeToFile:imagePath atomically:YES]; 145 | }); 146 | 147 | self.processedImages[imageIndex] = [imagePath copy]; 148 | } 149 | 150 | - (UIImage *)filteredImageAtIndex:(NSUInteger)imageIndex 151 | { 152 | NSString *imagePath = self.processedImages[imageIndex]; 153 | return [[UIImage alloc] initWithContentsOfFile:imagePath]; 154 | } 155 | 156 | - (void)setFilteredPreviewImage:(UIImage *)image toIndex:(NSUInteger)imageIndex 157 | { 158 | self.processedPreviewImages[imageIndex] = image; 159 | } 160 | 161 | - (UIImage *)filteredPreviewImageAtIndex:(NSUInteger)imageIndex 162 | { 163 | return self.processedPreviewImages[imageIndex]; 164 | } 165 | 166 | - (void)setCancelBlock:(IGRBaseShaderFilterCancelBlock)block toIndex:(NSUInteger)imageIndex 167 | { 168 | self.cancelBlocks[imageIndex] = block; 169 | } 170 | 171 | - (void)cancelImageAtIndex:(NSUInteger)imageIndex 172 | { 173 | IGRBaseShaderFilterCancelBlock cancelBlock = self.cancelBlocks[imageIndex]; 174 | cancelBlock(); 175 | } 176 | 177 | - (NSUInteger)count 178 | { 179 | return _cachedFilters.count; 180 | } 181 | 182 | - (NSString *)imagePathAtIndex:(NSUInteger)imageIndex { 183 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 184 | NSString *cacheDirectory = paths.firstObject; 185 | return [NSString stringWithFormat:@"%@/%@.png", cacheDirectory, @(kOriginalImageIndex + imageIndex)]; 186 | } 187 | 188 | @end 189 | -------------------------------------------------------------------------------- /IGRFilterCombine/ShaderFilters/IGRBaseShaderFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRBaseShaderFilter.h 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | @import GPUImage; 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef void(^IGRBaseShaderFilterCompletionBlock)(UIImage * _Nullable processedImage); 14 | typedef void(^IGRBaseShaderFilterCancelBlock)(void); 15 | 16 | @interface IGRBaseShaderFilter : GPUImageFilter 17 | 18 | - (instancetype)initWithDictionary:(NSDictionary *)aDictionary; 19 | 20 | @property (nonatomic, copy , nullable) NSString *displayName; 21 | 22 | - (IGRBaseShaderFilterCancelBlock)processImage:(UIImage *)image 23 | completeBlock:(IGRBaseShaderFilterCompletionBlock)completeBlock; 24 | 25 | @end 26 | 27 | NS_ASSUME_NONNULL_END 28 | -------------------------------------------------------------------------------- /IGRFilterCombine/ShaderFilters/IGRBaseShaderFilterConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRBaseShaderFilterConstants.h 3 | // IGRFilterCombine 4 | // 5 | // Created by Vitalii Parovishnyk on 12/29/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "IGRBaseShaderFilter.h" 10 | 11 | extern NSString * const kSFXBaseShaderFilterVertexShaderString; 12 | 13 | extern NSString const * kSFXBaseShaderClassKey; 14 | extern NSString const * kSFXBaseShaderNameKey; 15 | extern NSString const * kSFXBaseShaderShaderNameKey; 16 | extern NSString const * kSFXBaseShaderResourceKey; 17 | -------------------------------------------------------------------------------- /IGRFilterCombine/ShaderFilters/IGRBaseShaderFilterConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // IGRBaseShaderFilterConstants.m 3 | // IGRFilterCombine 4 | // 5 | // Created by Vitalii Parovishnyk on 12/30/16. 6 | // Copyright © 2016 IGR Software. All rights reserved. 7 | // 8 | 9 | #import "IGRBaseShaderFilterConstants.h" 10 | 11 | NSString * const kSFXBaseShaderFilterVertexShaderString = 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 | NSString const * kSFXBaseShaderClassKey = @"class"; 41 | NSString const * kSFXBaseShaderNameKey = @"name"; 42 | NSString const * kSFXBaseShaderShaderNameKey = @"shader"; 43 | NSString const * kSFXBaseShaderResourceKey = @"resources"; 44 | -------------------------------------------------------------------------------- /IGRFilterCombineFramework/IGRFilterCombine.modulemap: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterCombine.modulemap 3 | // IGRFilterCombine 4 | // 5 | // Created by Vitalii Parovishnyk on 1/2/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | framework module IGRFilterCombine { 10 | umbrella header "IGRFilterCombine.h" 11 | 12 | module * { export * } 13 | export * 14 | } 15 | -------------------------------------------------------------------------------- /IGRFilterCombineFramework/IGRFilterCombineFramework.h: -------------------------------------------------------------------------------- 1 | // 2 | // IGRFilterCombineFramework.h 3 | // IGRFilterCombineFramework 4 | // 5 | // Created by Vitalii Parovishnyk on 1/2/17. 6 | // Copyright © 2017 IGR Software. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for IGRFilterCombineFramework. 12 | FOUNDATION_EXPORT double IGRFilterCombineFrameworkVersionNumber; 13 | 14 | //! Project version string for IGRFilterCombineFramework. 15 | FOUNDATION_EXPORT const unsigned char IGRFilterCombineFrameworkVersionString[]; 16 | 17 | // In this header, you should import all the public headers of your framework using statements like #import 18 | 19 | 20 | -------------------------------------------------------------------------------- /IGRFilterCombineFramework/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 | FMWK 17 | CFBundleShortVersionString 18 | 0.2.3 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Configs/filters.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | name 7 | Original 8 | class 9 | IGRBaseShaderFilter 10 | shader 11 | IFOriginalFilter 12 | resources 13 | 14 | 15 | 16 | name 17 | 1977 18 | class 19 | IGRBaseShaderFilter 20 | shader 21 | IF1977Filter 22 | resources 23 | 24 | nmap 25 | nblowout 26 | 27 | 28 | 29 | name 30 | Amaro 31 | class 32 | IGRBaseShaderFilter 33 | shader 34 | IFAmaroFilter 35 | resources 36 | 37 | blackboard 38 | overlay_map 39 | amaro_map 40 | 41 | 42 | 43 | name 44 | Brannon 45 | class 46 | IGRBaseShaderFilter 47 | shader 48 | IFBrannanFilter 49 | resources 50 | 51 | brannan_process 52 | brannan_blowout 53 | brannan_contrast 54 | brannan_luma 55 | brannan_screen 56 | 57 | 58 | 59 | name 60 | Earlybird 61 | class 62 | IGRBaseShaderFilter 63 | shader 64 | IFEarlybirdFilter 65 | resources 66 | 67 | earlybird_curves 68 | earlybird_overlay_map 69 | vignette_map 70 | earlybird_blowout 71 | earlybird_map 72 | 73 | 74 | 75 | name 76 | Hefe 77 | class 78 | IGRBaseShaderFilter 79 | shader 80 | IFHefeFilter 81 | resources 82 | 83 | edge_burn 84 | hefe_map 85 | hefe_gradient_map 86 | hefe_soft_light 87 | hefe_metal 88 | 89 | 90 | 91 | name 92 | Hudson 93 | class 94 | IGRBaseShaderFilter 95 | shader 96 | IFHudsonFilter 97 | resources 98 | 99 | hudson_background 100 | overlay_map 101 | hudson_map 102 | 103 | 104 | 105 | name 106 | Inkwell 107 | class 108 | IGRBaseShaderFilter 109 | shader 110 | IFInkwellFilter 111 | resources 112 | 113 | inkwell_map 114 | 115 | 116 | 117 | name 118 | Lomo 119 | class 120 | IGRBaseShaderFilter 121 | shader 122 | IFLomoFilter 123 | resources 124 | 125 | lomo_map 126 | vignette_map 127 | 128 | 129 | 130 | name 131 | LordKelvin 132 | class 133 | IGRBaseShaderFilter 134 | shader 135 | IFLordKelvinFilter 136 | resources 137 | 138 | kelvin_map 139 | 140 | 141 | 142 | name 143 | Nashville 144 | class 145 | IGRBaseShaderFilter 146 | shader 147 | IFNashvilleFilter 148 | resources 149 | 150 | nashville_map 151 | 152 | 153 | 154 | name 155 | Rise 156 | class 157 | IGRBaseShaderFilter 158 | shader 159 | IFRiseFilter 160 | resources 161 | 162 | blackboard 163 | overlay_map 164 | rise_map 165 | 166 | 167 | 168 | name 169 | Sierra 170 | class 171 | IGRBaseShaderFilter 172 | shader 173 | IFSierraFilter 174 | resources 175 | 176 | sierra_vignette 177 | overlay_map 178 | sierra_map 179 | 180 | 181 | 182 | name 183 | Sutro 184 | class 185 | IGRBaseShaderFilter 186 | shader 187 | IFSutroFilter 188 | resources 189 | 190 | vignette_map 191 | sutro_metal 192 | soft_light 193 | sutro_edge_burn 194 | sutro_curves 195 | 196 | 197 | 198 | name 199 | Toaster 200 | class 201 | IGRBaseShaderFilter 202 | shader 203 | IFToasterFilter 204 | resources 205 | 206 | toaster_metal 207 | toaster_soft_light 208 | toaster_curves 209 | toaster_overlay_map_warm 210 | toaster_color_shift 211 | 212 | 213 | 214 | name 215 | Valencia 216 | class 217 | IGRBaseShaderFilter 218 | shader 219 | IFValenciaFilter 220 | resources 221 | 222 | valencia_map 223 | valencia_gradient_map 224 | 225 | 226 | 227 | name 228 | Walden 229 | class 230 | IGRBaseShaderFilter 231 | shader 232 | IFWaldenFilter 233 | resources 234 | 235 | walden_map 236 | vignette_map 237 | 238 | 239 | 240 | name 241 | Xproll 242 | class 243 | IGRBaseShaderFilter 244 | shader 245 | IFXprollFilter 246 | resources 247 | 248 | xpro_map 249 | vignette_map 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IF1977Filter/nblowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IF1977Filter/nblowout.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IF1977Filter/nmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IF1977Filter/nmap.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFAmaroFilter/amaro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFAmaroFilter/amaro_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFAmaroFilter/blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFAmaroFilter/blackboard.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFAmaroFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFAmaroFilter/overlay_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFBrannanFilter/brannan_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFBrannanFilter/brannan_blowout.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFBrannanFilter/brannan_contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFBrannanFilter/brannan_contrast.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFBrannanFilter/brannan_luma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFBrannanFilter/brannan_luma.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFBrannanFilter/brannan_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFBrannanFilter/brannan_process.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFBrannanFilter/brannan_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFBrannanFilter/brannan_screen.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_blowout.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_curves.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFEarlybirdFilter/earlybird_overlay_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFEarlybirdFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFEarlybirdFilter/vignette_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHefeFilter/edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHefeFilter/edge_burn.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHefeFilter/hefe_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHefeFilter/hefe_gradient_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHefeFilter/hefe_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHefeFilter/hefe_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHefeFilter/hefe_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHefeFilter/hefe_metal.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHefeFilter/hefe_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHefeFilter/hefe_soft_light.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHudsonFilter/hudson_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHudsonFilter/hudson_background.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHudsonFilter/hudson_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHudsonFilter/hudson_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFHudsonFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFHudsonFilter/overlay_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFInkwellFilter/inkwell_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFInkwellFilter/inkwell_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFLomoFilter/lomo_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFLomoFilter/lomo_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFLomoFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFLomoFilter/vignette_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFLordKelvinFilter/kelvin_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFLordKelvinFilter/kelvin_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFNashvilleFilter/nashville_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFNashvilleFilter/nashville_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFRiseFilter/blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFRiseFilter/blackboard.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFRiseFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFRiseFilter/overlay_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFRiseFilter/rise_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFRiseFilter/rise_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSierraFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSierraFilter/overlay_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSierraFilter/sierra_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSierraFilter/sierra_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSierraFilter/sierra_vignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSierraFilter/sierra_vignette.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSutroFilter/soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSutroFilter/soft_light.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSutroFilter/sutro_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSutroFilter/sutro_curves.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSutroFilter/sutro_edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSutroFilter/sutro_edge_burn.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSutroFilter/sutro_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSutroFilter/sutro_metal.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFSutroFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFSutroFilter/vignette_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFToasterFilter/toaster_color_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFToasterFilter/toaster_color_shift.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFToasterFilter/toaster_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFToasterFilter/toaster_curves.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFToasterFilter/toaster_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFToasterFilter/toaster_metal.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFToasterFilter/toaster_overlay_map_warm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFToasterFilter/toaster_overlay_map_warm.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFToasterFilter/toaster_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFToasterFilter/toaster_soft_light.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFValenciaFilter/valencia_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFValenciaFilter/valencia_gradient_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFValenciaFilter/valencia_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFValenciaFilter/valencia_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFWaldenFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFWaldenFilter/vignette_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFWaldenFilter/walden_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFWaldenFilter/walden_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFXprollFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFXprollFilter/vignette_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Images/IFXprollFilter/xpro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/IGRFilterCombineResources/Images/IFXprollFilter/xpro_map.png -------------------------------------------------------------------------------- /IGRFilterCombineResources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleIdentifier 8 | $(PRODUCT_BUNDLE_IDENTIFIER) 9 | CFBundleInfoDictionaryVersion 10 | 6.0 11 | CFBundleName 12 | $(PRODUCT_NAME) 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleVersion 18 | 100.1 19 | NSHumanReadableCopyright 20 | Copyright © 2016 IGR Software. All rights reserved. 21 | NSPrincipalClass 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IF1977Filter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 13 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 14 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 15 | 16 | gl_FragColor = vec4(texel, 1.0); 17 | } 18 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFAmaroFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; 6 | uniform sampler2D inputImageTexture3; 7 | uniform sampler2D inputImageTexture4; 8 | 9 | void main() 10 | { 11 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 12 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 13 | 14 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 15 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 16 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 17 | 18 | vec4 mapped; 19 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 20 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 21 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 22 | mapped.a = 1.0; 23 | 24 | gl_FragColor = mapped; 25 | } 26 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFBrannanFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //process 7 | uniform sampler2D inputImageTexture3; //blowout 8 | uniform sampler2D inputImageTexture4; //contrast 9 | uniform sampler2D inputImageTexture5; //luma 10 | uniform sampler2D inputImageTexture6; //screen 11 | 12 | mat3 saturateMatrix = mat3(1.105150, 13 | -0.044850, 14 | -0.046000, 15 | -0.088050, 16 | 1.061950, 17 | -0.089200, 18 | -0.017100, 19 | -0.017100, 20 | 1.132900); 21 | 22 | vec3 luma = vec3(.3, .59, .11); 23 | 24 | void main() 25 | { 26 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 27 | 28 | vec2 lookup; 29 | lookup.y = 0.5; 30 | lookup.x = texel.r; 31 | texel.r = texture2D(inputImageTexture2, lookup).r; 32 | lookup.x = texel.g; 33 | texel.g = texture2D(inputImageTexture2, lookup).g; 34 | lookup.x = texel.b; 35 | texel.b = texture2D(inputImageTexture2, lookup).b; 36 | 37 | texel = saturateMatrix * texel; 38 | 39 | 40 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 41 | float d = dot(tc, tc); 42 | vec3 sampled; 43 | lookup.y = 0.5; 44 | lookup.x = texel.r; 45 | sampled.r = texture2D(inputImageTexture3, lookup).r; 46 | lookup.x = texel.g; 47 | sampled.g = texture2D(inputImageTexture3, lookup).g; 48 | lookup.x = texel.b; 49 | sampled.b = texture2D(inputImageTexture3, lookup).b; 50 | float value = smoothstep(0.0, 1.0, d); 51 | texel = mix(sampled, texel, value); 52 | 53 | lookup.x = texel.r; 54 | texel.r = texture2D(inputImageTexture4, lookup).r; 55 | lookup.x = texel.g; 56 | texel.g = texture2D(inputImageTexture4, lookup).g; 57 | lookup.x = texel.b; 58 | texel.b = texture2D(inputImageTexture4, lookup).b; 59 | 60 | 61 | lookup.x = dot(texel, luma); 62 | texel = mix(texture2D(inputImageTexture5, lookup).rgb, texel, .5); 63 | 64 | lookup.x = texel.r; 65 | texel.r = texture2D(inputImageTexture6, lookup).r; 66 | lookup.x = texel.g; 67 | texel.g = texture2D(inputImageTexture6, lookup).g; 68 | lookup.x = texel.b; 69 | texel.b = texture2D(inputImageTexture6, lookup).b; 70 | 71 | gl_FragColor = vec4(texel, 1.0); 72 | } 73 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFEarlybirdFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //earlyBirdCurves 7 | uniform sampler2D inputImageTexture3; //earlyBirdOverlay 8 | uniform sampler2D inputImageTexture4; //vig 9 | uniform sampler2D inputImageTexture5; //earlyBirdBlowout 10 | uniform sampler2D inputImageTexture6; //earlyBirdMap 11 | 12 | const mat3 saturate = mat3(1.210300, 13 | -0.089700, 14 | -0.091000, 15 | -0.176100, 16 | 1.123900, 17 | -0.177400, 18 | -0.034200, 19 | -0.034200, 20 | 1.265800); 21 | 22 | const vec3 rgbPrime = vec3(0.25098, 0.14640522, 0.0); 23 | const vec3 desaturate = vec3(.3, .59, .11); 24 | 25 | void main() 26 | { 27 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 28 | 29 | vec2 lookup; 30 | lookup.y = 0.5; 31 | 32 | lookup.x = texel.r; 33 | texel.r = texture2D(inputImageTexture2, lookup).r; 34 | 35 | lookup.x = texel.g; 36 | texel.g = texture2D(inputImageTexture2, lookup).g; 37 | 38 | lookup.x = texel.b; 39 | texel.b = texture2D(inputImageTexture2, lookup).b; 40 | 41 | float desaturatedColor; 42 | vec3 result; 43 | desaturatedColor = dot(desaturate, texel); 44 | 45 | 46 | lookup.x = desaturatedColor; 47 | result.r = texture2D(inputImageTexture3, lookup).r; 48 | lookup.x = desaturatedColor; 49 | result.g = texture2D(inputImageTexture3, lookup).g; 50 | lookup.x = desaturatedColor; 51 | result.b = texture2D(inputImageTexture3, lookup).b; 52 | 53 | texel = saturate * mix(texel, result, .5); 54 | 55 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 56 | float d = dot(tc, tc); 57 | 58 | vec3 sampled; 59 | lookup.y = .5; 60 | 61 | lookup = vec2(d, texel.r); 62 | texel.r = texture2D(inputImageTexture4, lookup).r; 63 | lookup.y = texel.g; 64 | texel.g = texture2D(inputImageTexture4, lookup).g; 65 | lookup.y = texel.b; 66 | texel.b = texture2D(inputImageTexture4, lookup).b; 67 | float value = smoothstep(0.0, 1.25, pow(d, 1.35)/1.65); 68 | 69 | lookup.x = texel.r; 70 | sampled.r = texture2D(inputImageTexture5, lookup).r; 71 | lookup.x = texel.g; 72 | sampled.g = texture2D(inputImageTexture5, lookup).g; 73 | lookup.x = texel.b; 74 | sampled.b = texture2D(inputImageTexture5, lookup).b; 75 | texel = mix(sampled, texel, value); 76 | 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 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFHefeFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //edgeBurn 7 | uniform sampler2D inputImageTexture3; //hefeMap 8 | uniform sampler2D inputImageTexture4; //hefeGradientMap 9 | uniform sampler2D inputImageTexture5; //hefeSoftLight 10 | uniform sampler2D inputImageTexture6; //hefeMetal 11 | 12 | void main() 13 | { 14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 15 | vec3 edge = texture2D(inputImageTexture2, textureCoordinate).rgb; 16 | texel = texel * edge; 17 | 18 | texel = vec3(texture2D(inputImageTexture3, vec2(texel.r, .16666)).r, 19 | texture2D(inputImageTexture3, vec2(texel.g, .5)).g, 20 | texture2D(inputImageTexture3, vec2(texel.b, .83333)).b); 21 | 22 | vec3 luma = vec3(.30, .59, .11); 23 | vec3 gradSample = texture2D(inputImageTexture4, vec2(dot(luma, texel), .5)).rgb; 24 | vec3 final = vec3(texture2D(inputImageTexture5, vec2(gradSample.r, texel.r)).r, 25 | texture2D(inputImageTexture5, vec2(gradSample.g, texel.g)).g, 26 | texture2D(inputImageTexture5, vec2(gradSample.b, texel.b)).b); 27 | 28 | vec3 metal = texture2D(inputImageTexture6, textureCoordinate).rgb; 29 | vec3 metaled = vec3(texture2D(inputImageTexture5, vec2(metal.r, texel.r)).r, 30 | texture2D(inputImageTexture5, vec2(metal.g, texel.g)).g, 31 | texture2D(inputImageTexture5, vec2(metal.b, texel.b)).b); 32 | 33 | gl_FragColor = vec4(metaled, 1.0); 34 | } 35 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFHudsonFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //blowout; 7 | uniform sampler2D inputImageTexture3; //overlay; 8 | uniform sampler2D inputImageTexture4; //map 9 | 10 | void main() 11 | { 12 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 13 | 14 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 15 | 16 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 17 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 18 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 19 | 20 | vec4 mapped; 21 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 22 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 23 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 24 | mapped.a = 1.0; 25 | 26 | gl_FragColor = mapped; 27 | } 28 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFInkwellFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | texel = vec3(dot(vec3(0.3, 0.6, 0.1), texel)); 12 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r); 13 | 14 | gl_FragColor = vec4(texel, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFLomoFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | uniform sampler2D inputImageTexture3; 8 | 9 | void main() 10 | { 11 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 12 | 13 | vec2 red = vec2(texel.r, 0.16666); 14 | vec2 green = vec2(texel.g, 0.5); 15 | vec2 blue = vec2(texel.b, 0.83333); 16 | 17 | texel.rgb = vec3(texture2D(inputImageTexture2, red).r, 18 | texture2D(inputImageTexture2, green).g, 19 | texture2D(inputImageTexture2, blue).b); 20 | 21 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 22 | float d = dot(tc, tc); 23 | vec2 lookup = vec2(d, texel.r); 24 | texel.r = texture2D(inputImageTexture3, lookup).r; 25 | lookup.y = texel.g; 26 | texel.g = texture2D(inputImageTexture3, lookup).g; 27 | lookup.y = texel.b; 28 | texel.b= texture2D(inputImageTexture3, lookup).b; 29 | 30 | gl_FragColor = vec4(texel,1.0); 31 | } 32 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFLordKelvinFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | vec2 lookup; 13 | lookup.y = .5; 14 | 15 | lookup.x = texel.r; 16 | texel.r = texture2D(inputImageTexture2, lookup).r; 17 | 18 | lookup.x = texel.g; 19 | texel.g = texture2D(inputImageTexture2, lookup).g; 20 | 21 | lookup.x = texel.b; 22 | texel.b = texture2D(inputImageTexture2, lookup).b; 23 | 24 | gl_FragColor = vec4(texel, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFNashvilleFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | texel = vec3( 12 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 13 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 14 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 15 | gl_FragColor = vec4(texel, 1.0); 16 | } 17 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFOriginalFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | 7 | void main() 8 | { 9 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 10 | 11 | gl_FragColor = vec4(texel, 1.0); 12 | } 13 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFRiseFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; 6 | uniform sampler2D inputImageTexture3; 7 | uniform sampler2D inputImageTexture4; 8 | 9 | void main() 10 | { 11 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 12 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 13 | 14 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 15 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 16 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 17 | 18 | vec4 mapped; 19 | 20 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 21 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 22 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 23 | mapped.a = 1.0; 24 | 25 | gl_FragColor = mapped; 26 | } 27 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFSierraFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //blowout; 7 | uniform sampler2D inputImageTexture3; //overlay; 8 | uniform sampler2D inputImageTexture4; //map 9 | 10 | void main() 11 | { 12 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 13 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 14 | 15 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 16 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 17 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 18 | 19 | vec4 mapped; 20 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 21 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 22 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 23 | mapped.a = 1.0; 24 | 25 | gl_FragColor = mapped; 26 | } 27 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFSutroFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //sutroMap; 7 | uniform sampler2D inputImageTexture3; //sutroMetal; 8 | uniform sampler2D inputImageTexture4; //softLight 9 | uniform sampler2D inputImageTexture5; //sutroEdgeburn 10 | uniform sampler2D inputImageTexture6; //sutroCurves 11 | 12 | void main() 13 | { 14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 15 | 16 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 17 | float d = dot(tc, tc); 18 | vec2 lookup = vec2(d, texel.r); 19 | texel.r = texture2D(inputImageTexture2, lookup).r; 20 | lookup.y = texel.g; 21 | texel.g = texture2D(inputImageTexture2, lookup).g; 22 | lookup.y = texel.b; 23 | texel.b= texture2D(inputImageTexture2, lookup).b; 24 | 25 | vec3 rgbPrime = vec3(0.1019, 0.0, 0.0); 26 | float m = dot(vec3(.3, .59, .11), texel.rgb) - 0.03058; 27 | texel = mix(texel, rgbPrime + m, 0.32); 28 | 29 | vec3 metal = texture2D(inputImageTexture3, textureCoordinate).rgb; 30 | texel.r = texture2D(inputImageTexture4, vec2(metal.r, texel.r)).r; 31 | texel.g = texture2D(inputImageTexture4, vec2(metal.g, texel.g)).g; 32 | texel.b = texture2D(inputImageTexture4, vec2(metal.b, texel.b)).b; 33 | 34 | texel = texel * texture2D(inputImageTexture5, textureCoordinate).rgb; 35 | 36 | texel.r = texture2D(inputImageTexture6, vec2(texel.r, .16666)).r; 37 | texel.g = texture2D(inputImageTexture6, vec2(texel.g, .5)).g; 38 | texel.b = texture2D(inputImageTexture6, vec2(texel.b, .83333)).b; 39 | 40 | gl_FragColor = vec4(texel, 1.0); 41 | } 42 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFToasterFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //toasterMetal 7 | uniform sampler2D inputImageTexture3; //toasterSoftlight 8 | uniform sampler2D inputImageTexture4; //toasterCurves 9 | uniform sampler2D inputImageTexture5; //toasterOverlayMapWarm 10 | uniform sampler2D inputImageTexture6; //toasterColorshift 11 | 12 | void main() 13 | { 14 | lowp vec3 texel; 15 | mediump vec2 lookup; 16 | vec2 blue; 17 | vec2 green; 18 | vec2 red; 19 | lowp vec4 tmpvar_1; 20 | tmpvar_1 = texture2D (inputImageTexture, textureCoordinate); 21 | texel = tmpvar_1.xyz; 22 | lowp vec4 tmpvar_2; 23 | tmpvar_2 = texture2D (inputImageTexture2, textureCoordinate); 24 | lowp vec2 tmpvar_3; 25 | tmpvar_3.x = tmpvar_2.x; 26 | tmpvar_3.y = tmpvar_1.x; 27 | texel.x = texture2D (inputImageTexture3, tmpvar_3).x; 28 | lowp vec2 tmpvar_4; 29 | tmpvar_4.x = tmpvar_2.y; 30 | tmpvar_4.y = tmpvar_1.y; 31 | texel.y = texture2D (inputImageTexture3, tmpvar_4).y; 32 | lowp vec2 tmpvar_5; 33 | tmpvar_5.x = tmpvar_2.z; 34 | tmpvar_5.y = tmpvar_1.z; 35 | texel.z = texture2D (inputImageTexture3, tmpvar_5).z; 36 | red.x = texel.x; 37 | red.y = 0.16666; 38 | green.x = texel.y; 39 | green.y = 0.5; 40 | blue.x = texel.z; 41 | blue.y = 0.833333; 42 | texel.x = texture2D (inputImageTexture4, red).x; 43 | texel.y = texture2D (inputImageTexture4, green).y; 44 | texel.z = texture2D (inputImageTexture4, blue).z; 45 | mediump vec2 tmpvar_6; 46 | tmpvar_6 = ((2.0 * textureCoordinate) - 1.0); 47 | mediump vec2 tmpvar_7; 48 | tmpvar_7.x = dot (tmpvar_6, tmpvar_6); 49 | tmpvar_7.y = texel.x; 50 | lookup = tmpvar_7; 51 | texel.x = texture2D (inputImageTexture5, tmpvar_7).x; 52 | lookup.y = texel.y; 53 | texel.y = texture2D (inputImageTexture5, lookup).y; 54 | lookup.y = texel.z; 55 | texel.z = texture2D (inputImageTexture5, lookup).z; 56 | red.x = texel.x; 57 | green.x = texel.y; 58 | blue.x = texel.z; 59 | texel.x = texture2D (inputImageTexture6, red).x; 60 | texel.y = texture2D (inputImageTexture6, green).y; 61 | texel.z = texture2D (inputImageTexture6, blue).z; 62 | lowp vec4 tmpvar_8; 63 | tmpvar_8.w = 1.0; 64 | tmpvar_8.xyz = texel; 65 | 66 | gl_FragColor = tmpvar_8; 67 | } 68 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFValenciaFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //map 7 | uniform sampler2D inputImageTexture3; //gradMap 8 | 9 | mat3 saturateMatrix = mat3(1.1402, 10 | -0.0598, 11 | -0.061, 12 | -0.1174, 13 | 1.0826, 14 | -0.1186, 15 | -0.0228, 16 | -0.0228, 17 | 1.1772); 18 | 19 | vec3 lumaCoeffs = vec3(.3, .59, .11); 20 | 21 | void main() 22 | { 23 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 24 | 25 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .1666666)).r, 26 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 27 | texture2D(inputImageTexture2, vec2(texel.b, .8333333)).b); 28 | 29 | texel = saturateMatrix * texel; 30 | float luma = dot(lumaCoeffs, texel); 31 | texel = vec3(texture2D(inputImageTexture3, vec2(luma, texel.r)).r, 32 | texture2D(inputImageTexture3, vec2(luma, texel.g)).g, 33 | texture2D(inputImageTexture3, vec2(luma, texel.b)).b); 34 | 35 | gl_FragColor = vec4(texel, 1.0); 36 | } -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFWaldenFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //map 7 | uniform sampler2D inputImageTexture3; //vigMap 8 | 9 | void main() 10 | { 11 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 12 | 13 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 14 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 15 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 16 | 17 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 18 | float d = dot(tc, tc); 19 | vec2 lookup = vec2(d, texel.r); 20 | texel.r = texture2D(inputImageTexture3, lookup).r; 21 | lookup.y = texel.g; 22 | texel.g = texture2D(inputImageTexture3, lookup).g; 23 | lookup.y = texel.b; 24 | texel.b = texture2D(inputImageTexture3, lookup).b; 25 | 26 | gl_FragColor = vec4(texel, 1.0); 27 | } 28 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Shaders/IFXprollFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | varying highp vec2 textureCoordinate; 3 | 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; //map 6 | uniform sampler2D inputImageTexture3; //vigMap 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 13 | float d = dot(tc, tc); 14 | vec2 lookup = vec2(d, texel.r); 15 | texel.r = texture2D(inputImageTexture3, lookup).r; 16 | lookup.y = texel.g; 17 | texel.g = texture2D(inputImageTexture3, lookup).g; 18 | lookup.y = texel.b; 19 | texel.b = texture2D(inputImageTexture3, lookup).b; 20 | 21 | vec2 red = vec2(texel.r, 0.16666); 22 | vec2 green = vec2(texel.g, 0.5); 23 | vec2 blue = vec2(texel.b, .83333); 24 | texel.r = texture2D(inputImageTexture2, red).r; 25 | texel.g = texture2D(inputImageTexture2, green).g; 26 | texel.b = texture2D(inputImageTexture2, blue).b; 27 | 28 | gl_FragColor = vec4(texel, 1.0); 29 | } 30 | -------------------------------------------------------------------------------- /IGRFilterCombineResources/Xibs/IGRFilterbarCell.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Korich 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '9.0' 3 | use_frameworks! 4 | 5 | target 'IGRFilterCombine' do 6 | 7 | pod 'GPUImage' 8 | 9 | end 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [The Project is not served, please, enjoy forward :)] 2 | == 3 | 4 | # IGRFilterCombine 5 | 6 | Replicate Instragram-style filters in Objective-C (Swift 3.0 Compatibility). 7 | 8 | ### Easy to use: 9 | - Add image to IGRFilterCombine, 10 | - Read filtered image at index. 11 | 12 | [![Build Status](https://travis-ci.org/IGRSoft/IGRFilterCombine.svg)](https://travis-ci.org/IGRSoft/IGRFilterCombine) 13 | [![Platform](https://img.shields.io/badge/platform-iOS-lightgrey.svg?style=flat)](http://www.apple.com/ios/) 14 | [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/IGRFilterCombine.svg)](https://img.shields.io/cocoapods/v/IGRFilterCombine.svg) 15 | [![License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)](https://opensource.org/licenses/MIT) 16 | 17 | ___ 18 | ### Contribute to Development Goals Here: 19 | 20 | BTC: 16tGJzt4gJJBhBetpV6BuaWuNfxvkdkbt4 21 | 22 | BCH: bitcoincash:qpcwefpxddjqzdpcrx6tek3uh6x9v7t8tugu30jvks 23 | 24 | LTC: litecoin:MLZxuAdJCaW7LdM4sQuRazgdNvd8G2bdyt 25 | 26 | ___ 27 | ## How It Works 28 | It is built upon [GPUImage](https://github.com/BradLarson/GPUImage), written open sourced framework by [Brad Larson](http://stackoverflow.com/users/19679/brad-larson) that hanles low-level GPU interactions on **IGRFilterCombine**'s behalf. 29 | 30 | The GPUImage framework is a BSD-licensed iOS library that lets you apply GPU-accelerated filters and other effects to images, live camera video, and movies. In comparison to Core Image (part of iOS 5.0), GPUImage allows you to write your own custom filters, supports deployment to iOS 4.0, and has a simpler interface. However, it currently lacks some of the more advanced features of Core Image, such as facial detection. 31 | 32 | For massively parallel operations like processing images or live video frames, GPUs have some significant performance advantages over CPUs. On an iPhone 4, a simple image filter can be over 100 times faster to perform on the GPU than an equivalent CPU-based filter. 33 | 34 | ## Filters 35 | - 1977 36 | - Amaro 37 | - Brannan 38 | - Earlybird 39 | - Hefe 40 | - Hudson 41 | - Inkwell 42 | - Lomo 43 | - Lord Kelvin 44 | - Nashville 45 | - Rise 46 | - Sierra 47 | - Sutro 48 | - Toaster 49 | - Valencia 50 | - Walden 51 | - Xproll 52 | 53 | ___ 54 | ## Requirements 55 | 56 | - Xcode 8.0+ 57 | - iOS 9.0+ 58 | 59 | ___ 60 | ## Installation 61 | 62 | ### CocoaPods 63 | 64 | The preferred installation method is with [CocoaPods](https://cocoapods.org). Add the following to your `Podfile`: 65 | 66 | ```ruby 67 | pod 'IGRFilterCombine' 68 | ``` 69 | 70 | ### Carthage 71 | 72 | For [Carthage](https://github.com/Carthage/Carthage), add the following to your `Cartfile`: 73 | 74 | ```ogdl 75 | github "IGRSoft/IGRFilterCombine" 76 | ``` 77 | 78 | ___ 79 | ## Getting Started 80 | 81 |
82 | Objective-C 83 |

84 | ```objective-c 85 | @import IGRFilterCombine; 86 | 87 | @interface ViewController () 88 | 89 | @property (nonatomic, strong) IGRFilterCombine *filterCombine; 90 | 91 | @end 92 | 93 | @implementation ViewController 94 | 95 | - (void)viewDidLoad 96 | { 97 | [super viewDidLoad]; 98 | 99 | self.filterCombine = [[IGRFilterCombine alloc] initWithDelegate:self]; 100 | } 101 | 102 | - (void)setupImage:(UIImage *)image 103 | { 104 | __weak typeof(self) weak = self; 105 | [self.filterCombine setImage:image 106 | completion:^(UIImage * _Nullable processedImage, NSUInteger idx) { 107 | //Process Image 108 | } 109 | preview:^(UIImage * _Nullable processedImage, NSUInteger idx) { 110 | //Process Preview 111 | }]; 112 | } 113 | 114 | - (NSString *)filtereNameAtIndex:(NSUInteger)imageIndex; 115 | - (UIImage *)filteredImageAtIndex:(NSUInteger)imageIndex; 116 | - (UIImage *)filteredPreviewImageAtIndex:(NSUInteger)imageIndex; 117 | 118 | - (NSUInteger)count; 119 | 120 | #pragma mark - IGRFilterCombineDelegate 121 | 122 | - (CGSize)previewSize 123 | { 124 | return CGSizeMake(70.0, 70.0); 125 | } 126 | 127 | @end 128 | ``` 129 |

130 |
131 | Swift 3.0 132 |

133 | ```swift 134 | import IGRFilterCombine 135 | 136 | class ViewController: UIViewController { 137 | fileprivate var filterCombine: IGRFilterCombine? 138 | 139 | override func viewDidLoad() { 140 | super.viewDidLoad() 141 | 142 | filterCombine = IGRFilterCombine(delegate: self as IGRFilterCombineDelegate) 143 | } 144 | 145 | func setupWorkImage(_ image: UIImage) { 146 | self.filterCombine?.setImage(image, completion: { (processedImage, idx) in 147 | //Process Image 148 | }) { (processedImage, idx) in 149 | //Process Preview 150 | } 151 | } 152 | 153 | 154 | 155 | self.imageView?.image = image 156 | self.collectionView?.reloadData() 157 | } 158 | 159 | // MARK: - IGRFilterCombineDelegate 160 | 161 | extension ViewController : IGRFilterCombineDelegate { 162 | func previewSize() -> CGSize { 163 | return CGSize(width: 70.0, height: 70.0) 164 | } 165 | } 166 | 167 | open func filtereName(at imageIndex: UInt) -> String 168 | 169 | open func filteredImage(at imageIndex: UInt) -> UIImage 170 | 171 | open func filteredPreviewImage(at imageIndex: UInt) -> UIImage 172 | 173 | 174 | open func count() -> UInt 175 | } 176 | ``` 177 |

178 | 179 | > see sample Xcode project in /Demo 180 | 181 | ## TODO 182 | - [x] Add Filters to Images 183 | - [ ] Add Custom Filters 184 | 185 | ___ 186 | ## Credits 187 | 188 | `IGRFilterCombine` is owned and maintained by the [IGR Software and Vitalii Parovishnyk](https://igrsoft.com). 189 | 190 | ___ 191 | ## License 192 | 193 | `IGRFilterCombine` is MIT-licensed. We also provide an additional patent grant. 194 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Configs/filters.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | name 7 | Original 8 | class 9 | IGRBaseShaderFilter 10 | shader 11 | IFOriginalFilter 12 | resources 13 | 14 | 15 | 16 | name 17 | 1977 18 | class 19 | IGRBaseShaderFilter 20 | shader 21 | IF1977Filter 22 | resources 23 | 24 | nmap 25 | nblowout 26 | 27 | 28 | 29 | name 30 | Amaro 31 | class 32 | IGRBaseShaderFilter 33 | shader 34 | IFAmaroFilter 35 | resources 36 | 37 | blackboard 38 | overlay_map 39 | amaro_map 40 | 41 | 42 | 43 | name 44 | Brannon 45 | class 46 | IGRBaseShaderFilter 47 | shader 48 | IFBrannanFilter 49 | resources 50 | 51 | brannan_process 52 | brannan_blowout 53 | brannan_contrast 54 | brannan_luma 55 | brannan_screen 56 | 57 | 58 | 59 | name 60 | Earlybird 61 | class 62 | IGRBaseShaderFilter 63 | shader 64 | IFEarlybirdFilter 65 | resources 66 | 67 | earlybird_curves 68 | earlybird_overlay_map 69 | vignette_map 70 | earlybird_blowout 71 | earlybird_map 72 | 73 | 74 | 75 | name 76 | Hefe 77 | class 78 | IGRBaseShaderFilter 79 | shader 80 | IFHefeFilter 81 | resources 82 | 83 | edge_burn 84 | hefe_map 85 | hefe_gradient_map 86 | hefe_soft_light 87 | hefe_metal 88 | 89 | 90 | 91 | name 92 | Hudson 93 | class 94 | IGRBaseShaderFilter 95 | shader 96 | IFHudsonFilter 97 | resources 98 | 99 | hudson_background 100 | overlay_map 101 | hudson_map 102 | 103 | 104 | 105 | name 106 | Inkwell 107 | class 108 | IGRBaseShaderFilter 109 | shader 110 | IFInkwellFilter 111 | resources 112 | 113 | inkwell_map 114 | 115 | 116 | 117 | name 118 | Lomo 119 | class 120 | IGRBaseShaderFilter 121 | shader 122 | IFLomoFilter 123 | resources 124 | 125 | lomo_map 126 | vignette_map 127 | 128 | 129 | 130 | name 131 | LordKelvin 132 | class 133 | IGRBaseShaderFilter 134 | shader 135 | IFLordKelvinFilter 136 | resources 137 | 138 | kelvin_map 139 | 140 | 141 | 142 | name 143 | Nashville 144 | class 145 | IGRBaseShaderFilter 146 | shader 147 | IFNashvilleFilter 148 | resources 149 | 150 | nashville_map 151 | 152 | 153 | 154 | name 155 | Rise 156 | class 157 | IGRBaseShaderFilter 158 | shader 159 | IFRiseFilter 160 | resources 161 | 162 | blackboard 163 | overlay_map 164 | rise_map 165 | 166 | 167 | 168 | name 169 | Sierra 170 | class 171 | IGRBaseShaderFilter 172 | shader 173 | IFSierraFilter 174 | resources 175 | 176 | sierra_vignette 177 | overlay_map 178 | sierra_map 179 | 180 | 181 | 182 | name 183 | Sutro 184 | class 185 | IGRBaseShaderFilter 186 | shader 187 | IFSutroFilter 188 | resources 189 | 190 | vignette_map 191 | sutro_metal 192 | soft_light 193 | sutro_edge_burn 194 | sutro_curves 195 | 196 | 197 | 198 | name 199 | Toaster 200 | class 201 | IGRBaseShaderFilter 202 | shader 203 | IFToasterFilter 204 | resources 205 | 206 | toaster_metal 207 | toaster_soft_light 208 | toaster_curves 209 | toaster_overlay_map_warm 210 | toaster_color_shift 211 | 212 | 213 | 214 | name 215 | Valencia 216 | class 217 | IGRBaseShaderFilter 218 | shader 219 | IFValenciaFilter 220 | resources 221 | 222 | valencia_map 223 | valencia_gradient_map 224 | 225 | 226 | 227 | name 228 | Walden 229 | class 230 | IGRBaseShaderFilter 231 | shader 232 | IFWaldenFilter 233 | resources 234 | 235 | walden_map 236 | vignette_map 237 | 238 | 239 | 240 | name 241 | Xproll 242 | class 243 | IGRBaseShaderFilter 244 | shader 245 | IFXprollFilter 246 | resources 247 | 248 | xpro_map 249 | vignette_map 250 | 251 | 252 | 253 | 254 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IF1977Filter/nblowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IF1977Filter/nblowout.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IF1977Filter/nmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IF1977Filter/nmap.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/amaro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/amaro_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/blackboard.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFAmaroFilter/overlay_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_blowout.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_contrast.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_contrast.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_luma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_luma.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_process.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_screen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFBrannanFilter/brannan_screen.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_blowout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_blowout.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_curves.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/earlybird_overlay_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFEarlybirdFilter/vignette_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/edge_burn.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_gradient_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_metal.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHefeFilter/hefe_soft_light.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/hudson_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/hudson_background.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/hudson_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/hudson_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFHudsonFilter/overlay_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFInkwellFilter/inkwell_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFInkwellFilter/inkwell_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFLomoFilter/lomo_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFLomoFilter/lomo_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFLomoFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFLomoFilter/vignette_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFLordKelvinFilter/kelvin_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFLordKelvinFilter/kelvin_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFNashvilleFilter/nashville_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFNashvilleFilter/nashville_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/blackboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/blackboard.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/overlay_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/rise_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFRiseFilter/rise_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/overlay_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/overlay_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/sierra_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/sierra_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/sierra_vignette.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSierraFilter/sierra_vignette.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/soft_light.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_curves.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_edge_burn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_edge_burn.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/sutro_metal.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFSutroFilter/vignette_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_color_shift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_color_shift.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_curves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_curves.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_metal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_metal.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_overlay_map_warm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_overlay_map_warm.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_soft_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFToasterFilter/toaster_soft_light.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFValenciaFilter/valencia_gradient_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFValenciaFilter/valencia_gradient_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFValenciaFilter/valencia_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFValenciaFilter/valencia_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFWaldenFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFWaldenFilter/vignette_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFWaldenFilter/walden_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFWaldenFilter/walden_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFXprollFilter/vignette_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFXprollFilter/vignette_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Images/IFXprollFilter/xpro_map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Images/IFXprollFilter/xpro_map.png -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/IGRSoft/IGRFilterCombine/9da4531b4ab4325e65a2a48c2979f5fcf65022b9/Resources/IGRFilterCombineResources.bundle/Info.plist -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IF1977Filter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 13 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 14 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 15 | 16 | gl_FragColor = vec4(texel, 1.0); 17 | } 18 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFAmaroFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; 6 | uniform sampler2D inputImageTexture3; 7 | uniform sampler2D inputImageTexture4; 8 | 9 | void main() 10 | { 11 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 12 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 13 | 14 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 15 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 16 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 17 | 18 | vec4 mapped; 19 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 20 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 21 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 22 | mapped.a = 1.0; 23 | 24 | gl_FragColor = mapped; 25 | } 26 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFBrannanFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //process 7 | uniform sampler2D inputImageTexture3; //blowout 8 | uniform sampler2D inputImageTexture4; //contrast 9 | uniform sampler2D inputImageTexture5; //luma 10 | uniform sampler2D inputImageTexture6; //screen 11 | 12 | mat3 saturateMatrix = mat3(1.105150, 13 | -0.044850, 14 | -0.046000, 15 | -0.088050, 16 | 1.061950, 17 | -0.089200, 18 | -0.017100, 19 | -0.017100, 20 | 1.132900); 21 | 22 | vec3 luma = vec3(.3, .59, .11); 23 | 24 | void main() 25 | { 26 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 27 | 28 | vec2 lookup; 29 | lookup.y = 0.5; 30 | lookup.x = texel.r; 31 | texel.r = texture2D(inputImageTexture2, lookup).r; 32 | lookup.x = texel.g; 33 | texel.g = texture2D(inputImageTexture2, lookup).g; 34 | lookup.x = texel.b; 35 | texel.b = texture2D(inputImageTexture2, lookup).b; 36 | 37 | texel = saturateMatrix * texel; 38 | 39 | 40 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 41 | float d = dot(tc, tc); 42 | vec3 sampled; 43 | lookup.y = 0.5; 44 | lookup.x = texel.r; 45 | sampled.r = texture2D(inputImageTexture3, lookup).r; 46 | lookup.x = texel.g; 47 | sampled.g = texture2D(inputImageTexture3, lookup).g; 48 | lookup.x = texel.b; 49 | sampled.b = texture2D(inputImageTexture3, lookup).b; 50 | float value = smoothstep(0.0, 1.0, d); 51 | texel = mix(sampled, texel, value); 52 | 53 | lookup.x = texel.r; 54 | texel.r = texture2D(inputImageTexture4, lookup).r; 55 | lookup.x = texel.g; 56 | texel.g = texture2D(inputImageTexture4, lookup).g; 57 | lookup.x = texel.b; 58 | texel.b = texture2D(inputImageTexture4, lookup).b; 59 | 60 | 61 | lookup.x = dot(texel, luma); 62 | texel = mix(texture2D(inputImageTexture5, lookup).rgb, texel, .5); 63 | 64 | lookup.x = texel.r; 65 | texel.r = texture2D(inputImageTexture6, lookup).r; 66 | lookup.x = texel.g; 67 | texel.g = texture2D(inputImageTexture6, lookup).g; 68 | lookup.x = texel.b; 69 | texel.b = texture2D(inputImageTexture6, lookup).b; 70 | 71 | gl_FragColor = vec4(texel, 1.0); 72 | } 73 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFEarlybirdFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //earlyBirdCurves 7 | uniform sampler2D inputImageTexture3; //earlyBirdOverlay 8 | uniform sampler2D inputImageTexture4; //vig 9 | uniform sampler2D inputImageTexture5; //earlyBirdBlowout 10 | uniform sampler2D inputImageTexture6; //earlyBirdMap 11 | 12 | const mat3 saturate = mat3(1.210300, 13 | -0.089700, 14 | -0.091000, 15 | -0.176100, 16 | 1.123900, 17 | -0.177400, 18 | -0.034200, 19 | -0.034200, 20 | 1.265800); 21 | 22 | const vec3 rgbPrime = vec3(0.25098, 0.14640522, 0.0); 23 | const vec3 desaturate = vec3(.3, .59, .11); 24 | 25 | void main() 26 | { 27 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 28 | 29 | vec2 lookup; 30 | lookup.y = 0.5; 31 | 32 | lookup.x = texel.r; 33 | texel.r = texture2D(inputImageTexture2, lookup).r; 34 | 35 | lookup.x = texel.g; 36 | texel.g = texture2D(inputImageTexture2, lookup).g; 37 | 38 | lookup.x = texel.b; 39 | texel.b = texture2D(inputImageTexture2, lookup).b; 40 | 41 | float desaturatedColor; 42 | vec3 result; 43 | desaturatedColor = dot(desaturate, texel); 44 | 45 | 46 | lookup.x = desaturatedColor; 47 | result.r = texture2D(inputImageTexture3, lookup).r; 48 | lookup.x = desaturatedColor; 49 | result.g = texture2D(inputImageTexture3, lookup).g; 50 | lookup.x = desaturatedColor; 51 | result.b = texture2D(inputImageTexture3, lookup).b; 52 | 53 | texel = saturate * mix(texel, result, .5); 54 | 55 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 56 | float d = dot(tc, tc); 57 | 58 | vec3 sampled; 59 | lookup.y = .5; 60 | 61 | lookup = vec2(d, texel.r); 62 | texel.r = texture2D(inputImageTexture4, lookup).r; 63 | lookup.y = texel.g; 64 | texel.g = texture2D(inputImageTexture4, lookup).g; 65 | lookup.y = texel.b; 66 | texel.b = texture2D(inputImageTexture4, lookup).b; 67 | float value = smoothstep(0.0, 1.25, pow(d, 1.35)/1.65); 68 | 69 | lookup.x = texel.r; 70 | sampled.r = texture2D(inputImageTexture5, lookup).r; 71 | lookup.x = texel.g; 72 | sampled.g = texture2D(inputImageTexture5, lookup).g; 73 | lookup.x = texel.b; 74 | sampled.b = texture2D(inputImageTexture5, lookup).b; 75 | texel = mix(sampled, texel, value); 76 | 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 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFHefeFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //edgeBurn 7 | uniform sampler2D inputImageTexture3; //hefeMap 8 | uniform sampler2D inputImageTexture4; //hefeGradientMap 9 | uniform sampler2D inputImageTexture5; //hefeSoftLight 10 | uniform sampler2D inputImageTexture6; //hefeMetal 11 | 12 | void main() 13 | { 14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 15 | vec3 edge = texture2D(inputImageTexture2, textureCoordinate).rgb; 16 | texel = texel * edge; 17 | 18 | texel = vec3(texture2D(inputImageTexture3, vec2(texel.r, .16666)).r, 19 | texture2D(inputImageTexture3, vec2(texel.g, .5)).g, 20 | texture2D(inputImageTexture3, vec2(texel.b, .83333)).b); 21 | 22 | vec3 luma = vec3(.30, .59, .11); 23 | vec3 gradSample = texture2D(inputImageTexture4, vec2(dot(luma, texel), .5)).rgb; 24 | vec3 final = vec3(texture2D(inputImageTexture5, vec2(gradSample.r, texel.r)).r, 25 | texture2D(inputImageTexture5, vec2(gradSample.g, texel.g)).g, 26 | texture2D(inputImageTexture5, vec2(gradSample.b, texel.b)).b); 27 | 28 | vec3 metal = texture2D(inputImageTexture6, textureCoordinate).rgb; 29 | vec3 metaled = vec3(texture2D(inputImageTexture5, vec2(metal.r, texel.r)).r, 30 | texture2D(inputImageTexture5, vec2(metal.g, texel.g)).g, 31 | texture2D(inputImageTexture5, vec2(metal.b, texel.b)).b); 32 | 33 | gl_FragColor = vec4(metaled, 1.0); 34 | } 35 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFHudsonFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //blowout; 7 | uniform sampler2D inputImageTexture3; //overlay; 8 | uniform sampler2D inputImageTexture4; //map 9 | 10 | void main() 11 | { 12 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 13 | 14 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 15 | 16 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 17 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 18 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 19 | 20 | vec4 mapped; 21 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 22 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 23 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 24 | mapped.a = 1.0; 25 | 26 | gl_FragColor = mapped; 27 | } 28 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFInkwellFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | texel = vec3(dot(vec3(0.3, 0.6, 0.1), texel)); 12 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r); 13 | 14 | gl_FragColor = vec4(texel, 1.0); 15 | } 16 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFLomoFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | uniform sampler2D inputImageTexture3; 8 | 9 | void main() 10 | { 11 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 12 | 13 | vec2 red = vec2(texel.r, 0.16666); 14 | vec2 green = vec2(texel.g, 0.5); 15 | vec2 blue = vec2(texel.b, 0.83333); 16 | 17 | texel.rgb = vec3(texture2D(inputImageTexture2, red).r, 18 | texture2D(inputImageTexture2, green).g, 19 | texture2D(inputImageTexture2, blue).b); 20 | 21 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 22 | float d = dot(tc, tc); 23 | vec2 lookup = vec2(d, texel.r); 24 | texel.r = texture2D(inputImageTexture3, lookup).r; 25 | lookup.y = texel.g; 26 | texel.g = texture2D(inputImageTexture3, lookup).g; 27 | lookup.y = texel.b; 28 | texel.b= texture2D(inputImageTexture3, lookup).b; 29 | 30 | gl_FragColor = vec4(texel,1.0); 31 | } 32 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFLordKelvinFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | vec2 lookup; 13 | lookup.y = .5; 14 | 15 | lookup.x = texel.r; 16 | texel.r = texture2D(inputImageTexture2, lookup).r; 17 | 18 | lookup.x = texel.g; 19 | texel.g = texture2D(inputImageTexture2, lookup).g; 20 | 21 | lookup.x = texel.b; 22 | texel.b = texture2D(inputImageTexture2, lookup).b; 23 | 24 | gl_FragColor = vec4(texel, 1.0); 25 | } 26 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFNashvilleFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | texel = vec3( 12 | texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 13 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 14 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 15 | gl_FragColor = vec4(texel, 1.0); 16 | } 17 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFOriginalFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | 7 | void main() 8 | { 9 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 10 | 11 | gl_FragColor = vec4(texel, 1.0); 12 | } 13 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFRiseFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; 6 | uniform sampler2D inputImageTexture3; 7 | uniform sampler2D inputImageTexture4; 8 | 9 | void main() 10 | { 11 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 12 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 13 | 14 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 15 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 16 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 17 | 18 | vec4 mapped; 19 | 20 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 21 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 22 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 23 | mapped.a = 1.0; 24 | 25 | gl_FragColor = mapped; 26 | } 27 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFSierraFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //blowout; 7 | uniform sampler2D inputImageTexture3; //overlay; 8 | uniform sampler2D inputImageTexture4; //map 9 | 10 | void main() 11 | { 12 | vec4 texel = texture2D(inputImageTexture, textureCoordinate); 13 | vec3 bbTexel = texture2D(inputImageTexture2, textureCoordinate).rgb; 14 | 15 | texel.r = texture2D(inputImageTexture3, vec2(bbTexel.r, texel.r)).r; 16 | texel.g = texture2D(inputImageTexture3, vec2(bbTexel.g, texel.g)).g; 17 | texel.b = texture2D(inputImageTexture3, vec2(bbTexel.b, texel.b)).b; 18 | 19 | vec4 mapped; 20 | mapped.r = texture2D(inputImageTexture4, vec2(texel.r, .16666)).r; 21 | mapped.g = texture2D(inputImageTexture4, vec2(texel.g, .5)).g; 22 | mapped.b = texture2D(inputImageTexture4, vec2(texel.b, .83333)).b; 23 | mapped.a = 1.0; 24 | 25 | gl_FragColor = mapped; 26 | } 27 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFSutroFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //sutroMap; 7 | uniform sampler2D inputImageTexture3; //sutroMetal; 8 | uniform sampler2D inputImageTexture4; //softLight 9 | uniform sampler2D inputImageTexture5; //sutroEdgeburn 10 | uniform sampler2D inputImageTexture6; //sutroCurves 11 | 12 | void main() 13 | { 14 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 15 | 16 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 17 | float d = dot(tc, tc); 18 | vec2 lookup = vec2(d, texel.r); 19 | texel.r = texture2D(inputImageTexture2, lookup).r; 20 | lookup.y = texel.g; 21 | texel.g = texture2D(inputImageTexture2, lookup).g; 22 | lookup.y = texel.b; 23 | texel.b= texture2D(inputImageTexture2, lookup).b; 24 | 25 | vec3 rgbPrime = vec3(0.1019, 0.0, 0.0); 26 | float m = dot(vec3(.3, .59, .11), texel.rgb) - 0.03058; 27 | texel = mix(texel, rgbPrime + m, 0.32); 28 | 29 | vec3 metal = texture2D(inputImageTexture3, textureCoordinate).rgb; 30 | texel.r = texture2D(inputImageTexture4, vec2(metal.r, texel.r)).r; 31 | texel.g = texture2D(inputImageTexture4, vec2(metal.g, texel.g)).g; 32 | texel.b = texture2D(inputImageTexture4, vec2(metal.b, texel.b)).b; 33 | 34 | texel = texel * texture2D(inputImageTexture5, textureCoordinate).rgb; 35 | 36 | texel.r = texture2D(inputImageTexture6, vec2(texel.r, .16666)).r; 37 | texel.g = texture2D(inputImageTexture6, vec2(texel.g, .5)).g; 38 | texel.b = texture2D(inputImageTexture6, vec2(texel.b, .83333)).b; 39 | 40 | gl_FragColor = vec4(texel, 1.0); 41 | } 42 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFToasterFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //toasterMetal 7 | uniform sampler2D inputImageTexture3; //toasterSoftlight 8 | uniform sampler2D inputImageTexture4; //toasterCurves 9 | uniform sampler2D inputImageTexture5; //toasterOverlayMapWarm 10 | uniform sampler2D inputImageTexture6; //toasterColorshift 11 | 12 | void main() 13 | { 14 | lowp vec3 texel; 15 | mediump vec2 lookup; 16 | vec2 blue; 17 | vec2 green; 18 | vec2 red; 19 | lowp vec4 tmpvar_1; 20 | tmpvar_1 = texture2D (inputImageTexture, textureCoordinate); 21 | texel = tmpvar_1.xyz; 22 | lowp vec4 tmpvar_2; 23 | tmpvar_2 = texture2D (inputImageTexture2, textureCoordinate); 24 | lowp vec2 tmpvar_3; 25 | tmpvar_3.x = tmpvar_2.x; 26 | tmpvar_3.y = tmpvar_1.x; 27 | texel.x = texture2D (inputImageTexture3, tmpvar_3).x; 28 | lowp vec2 tmpvar_4; 29 | tmpvar_4.x = tmpvar_2.y; 30 | tmpvar_4.y = tmpvar_1.y; 31 | texel.y = texture2D (inputImageTexture3, tmpvar_4).y; 32 | lowp vec2 tmpvar_5; 33 | tmpvar_5.x = tmpvar_2.z; 34 | tmpvar_5.y = tmpvar_1.z; 35 | texel.z = texture2D (inputImageTexture3, tmpvar_5).z; 36 | red.x = texel.x; 37 | red.y = 0.16666; 38 | green.x = texel.y; 39 | green.y = 0.5; 40 | blue.x = texel.z; 41 | blue.y = 0.833333; 42 | texel.x = texture2D (inputImageTexture4, red).x; 43 | texel.y = texture2D (inputImageTexture4, green).y; 44 | texel.z = texture2D (inputImageTexture4, blue).z; 45 | mediump vec2 tmpvar_6; 46 | tmpvar_6 = ((2.0 * textureCoordinate) - 1.0); 47 | mediump vec2 tmpvar_7; 48 | tmpvar_7.x = dot (tmpvar_6, tmpvar_6); 49 | tmpvar_7.y = texel.x; 50 | lookup = tmpvar_7; 51 | texel.x = texture2D (inputImageTexture5, tmpvar_7).x; 52 | lookup.y = texel.y; 53 | texel.y = texture2D (inputImageTexture5, lookup).y; 54 | lookup.y = texel.z; 55 | texel.z = texture2D (inputImageTexture5, lookup).z; 56 | red.x = texel.x; 57 | green.x = texel.y; 58 | blue.x = texel.z; 59 | texel.x = texture2D (inputImageTexture6, red).x; 60 | texel.y = texture2D (inputImageTexture6, green).y; 61 | texel.z = texture2D (inputImageTexture6, blue).z; 62 | lowp vec4 tmpvar_8; 63 | tmpvar_8.w = 1.0; 64 | tmpvar_8.xyz = texel; 65 | 66 | gl_FragColor = tmpvar_8; 67 | } 68 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFValenciaFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //map 7 | uniform sampler2D inputImageTexture3; //gradMap 8 | 9 | mat3 saturateMatrix = mat3(1.1402, 10 | -0.0598, 11 | -0.061, 12 | -0.1174, 13 | 1.0826, 14 | -0.1186, 15 | -0.0228, 16 | -0.0228, 17 | 1.1772); 18 | 19 | vec3 lumaCoeffs = vec3(.3, .59, .11); 20 | 21 | void main() 22 | { 23 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 24 | 25 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .1666666)).r, 26 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 27 | texture2D(inputImageTexture2, vec2(texel.b, .8333333)).b); 28 | 29 | texel = saturateMatrix * texel; 30 | float luma = dot(lumaCoeffs, texel); 31 | texel = vec3(texture2D(inputImageTexture3, vec2(luma, texel.r)).r, 32 | texture2D(inputImageTexture3, vec2(luma, texel.g)).g, 33 | texture2D(inputImageTexture3, vec2(luma, texel.b)).b); 34 | 35 | gl_FragColor = vec4(texel, 1.0); 36 | } -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFWaldenFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | 3 | varying highp vec2 textureCoordinate; 4 | 5 | uniform sampler2D inputImageTexture; 6 | uniform sampler2D inputImageTexture2; //map 7 | uniform sampler2D inputImageTexture3; //vigMap 8 | 9 | void main() 10 | { 11 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 12 | 13 | texel = vec3(texture2D(inputImageTexture2, vec2(texel.r, .16666)).r, 14 | texture2D(inputImageTexture2, vec2(texel.g, .5)).g, 15 | texture2D(inputImageTexture2, vec2(texel.b, .83333)).b); 16 | 17 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 18 | float d = dot(tc, tc); 19 | vec2 lookup = vec2(d, texel.r); 20 | texel.r = texture2D(inputImageTexture3, lookup).r; 21 | lookup.y = texel.g; 22 | texel.g = texture2D(inputImageTexture3, lookup).g; 23 | lookup.y = texel.b; 24 | texel.b = texture2D(inputImageTexture3, lookup).b; 25 | 26 | gl_FragColor = vec4(texel, 1.0); 27 | } 28 | -------------------------------------------------------------------------------- /Resources/IGRFilterCombineResources.bundle/Shaders/IFXprollFilter.glsl: -------------------------------------------------------------------------------- 1 | precision lowp float; 2 | varying highp vec2 textureCoordinate; 3 | 4 | uniform sampler2D inputImageTexture; 5 | uniform sampler2D inputImageTexture2; //map 6 | uniform sampler2D inputImageTexture3; //vigMap 7 | 8 | void main() 9 | { 10 | vec3 texel = texture2D(inputImageTexture, textureCoordinate).rgb; 11 | 12 | vec2 tc = (2.0 * textureCoordinate) - 1.0; 13 | float d = dot(tc, tc); 14 | vec2 lookup = vec2(d, texel.r); 15 | texel.r = texture2D(inputImageTexture3, lookup).r; 16 | lookup.y = texel.g; 17 | texel.g = texture2D(inputImageTexture3, lookup).g; 18 | lookup.y = texel.b; 19 | texel.b = texture2D(inputImageTexture3, lookup).b; 20 | 21 | vec2 red = vec2(texel.r, 0.16666); 22 | vec2 green = vec2(texel.g, 0.5); 23 | vec2 blue = vec2(texel.b, .83333); 24 | texel.r = texture2D(inputImageTexture2, red).r; 25 | texel.g = texture2D(inputImageTexture2, green).g; 26 | texel.b = texture2D(inputImageTexture2, blue).b; 27 | 28 | gl_FragColor = vec4(texel, 1.0); 29 | } 30 | --------------------------------------------------------------------------------