├── FilterShop ├── FilterShop.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── XueYu.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ └── XueYu.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── FilterShop.xcscheme │ │ └── xcschememanagement.plist └── FilterShop │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Base.lproj │ └── Main.storyboard │ ├── FilterParameter.storyboard │ ├── FilterParameterVC.swift │ ├── Info.plist │ ├── MediaDisplayView.swift │ ├── Model │ └── CoreImageFilters.swift │ └── ViewController.swift ├── LICENSE ├── ReadMe.md └── showcase.png /FilterShop/FilterShop.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | C82B9A431F70362A009F559F /* FilterParameter.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C82B9A421F70362A009F559F /* FilterParameter.storyboard */; }; 11 | C82B9A451F703685009F559F /* FilterParameterVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = C82B9A441F703685009F559F /* FilterParameterVC.swift */; }; 12 | C8959EA81F6F377C006AC83B /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8959EA71F6F377C006AC83B /* AppDelegate.swift */; }; 13 | C8959EAA1F6F377C006AC83B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8959EA91F6F377C006AC83B /* ViewController.swift */; }; 14 | C8959EAC1F6F377C006AC83B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8959EAB1F6F377C006AC83B /* Assets.xcassets */; }; 15 | C8959EAF1F6F377C006AC83B /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8959EAD1F6F377C006AC83B /* Main.storyboard */; }; 16 | C8959EB71F6F37A4006AC83B /* CoreImageFilters.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8959EB61F6F37A4006AC83B /* CoreImageFilters.swift */; }; 17 | C8959EBA1F6F3CE3006AC83B /* MediaDisplayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8959EB91F6F3CE3006AC83B /* MediaDisplayView.swift */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXFileReference section */ 21 | C82B9A421F70362A009F559F /* FilterParameter.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = FilterParameter.storyboard; sourceTree = ""; }; 22 | C82B9A441F703685009F559F /* FilterParameterVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FilterParameterVC.swift; sourceTree = ""; }; 23 | C8959EA41F6F377C006AC83B /* FilterShop.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FilterShop.app; sourceTree = BUILT_PRODUCTS_DIR; }; 24 | C8959EA71F6F377C006AC83B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 25 | C8959EA91F6F377C006AC83B /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 26 | C8959EAB1F6F377C006AC83B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 27 | C8959EAE1F6F377C006AC83B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 28 | C8959EB01F6F377C006AC83B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | C8959EB61F6F37A4006AC83B /* CoreImageFilters.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = CoreImageFilters.swift; path = Model/CoreImageFilters.swift; sourceTree = ""; }; 30 | C8959EB91F6F3CE3006AC83B /* MediaDisplayView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MediaDisplayView.swift; sourceTree = ""; }; 31 | /* End PBXFileReference section */ 32 | 33 | /* Begin PBXFrameworksBuildPhase section */ 34 | C8959EA11F6F377C006AC83B /* Frameworks */ = { 35 | isa = PBXFrameworksBuildPhase; 36 | buildActionMask = 2147483647; 37 | files = ( 38 | ); 39 | runOnlyForDeploymentPostprocessing = 0; 40 | }; 41 | /* End PBXFrameworksBuildPhase section */ 42 | 43 | /* Begin PBXGroup section */ 44 | C8959E9B1F6F377C006AC83B = { 45 | isa = PBXGroup; 46 | children = ( 47 | C8959EA61F6F377C006AC83B /* FilterShop */, 48 | C8959EA51F6F377C006AC83B /* Products */, 49 | ); 50 | sourceTree = ""; 51 | }; 52 | C8959EA51F6F377C006AC83B /* Products */ = { 53 | isa = PBXGroup; 54 | children = ( 55 | C8959EA41F6F377C006AC83B /* FilterShop.app */, 56 | ); 57 | name = Products; 58 | sourceTree = ""; 59 | }; 60 | C8959EA61F6F377C006AC83B /* FilterShop */ = { 61 | isa = PBXGroup; 62 | children = ( 63 | C8959EA71F6F377C006AC83B /* AppDelegate.swift */, 64 | C8959EB81F6F37A9006AC83B /* Model */, 65 | C8959EBB1F6F3CEA006AC83B /* View */, 66 | C8959EA91F6F377C006AC83B /* ViewController.swift */, 67 | C82B9A441F703685009F559F /* FilterParameterVC.swift */, 68 | C8959EAD1F6F377C006AC83B /* Main.storyboard */, 69 | C82B9A421F70362A009F559F /* FilterParameter.storyboard */, 70 | C8959EAB1F6F377C006AC83B /* Assets.xcassets */, 71 | C8959EB01F6F377C006AC83B /* Info.plist */, 72 | ); 73 | path = FilterShop; 74 | sourceTree = ""; 75 | }; 76 | C8959EB81F6F37A9006AC83B /* Model */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | C8959EB61F6F37A4006AC83B /* CoreImageFilters.swift */, 80 | ); 81 | name = Model; 82 | sourceTree = ""; 83 | }; 84 | C8959EBB1F6F3CEA006AC83B /* View */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | C8959EB91F6F3CE3006AC83B /* MediaDisplayView.swift */, 88 | ); 89 | name = View; 90 | sourceTree = ""; 91 | }; 92 | /* End PBXGroup section */ 93 | 94 | /* Begin PBXNativeTarget section */ 95 | C8959EA31F6F377C006AC83B /* FilterShop */ = { 96 | isa = PBXNativeTarget; 97 | buildConfigurationList = C8959EB31F6F377C006AC83B /* Build configuration list for PBXNativeTarget "FilterShop" */; 98 | buildPhases = ( 99 | C8959EA01F6F377C006AC83B /* Sources */, 100 | C8959EA11F6F377C006AC83B /* Frameworks */, 101 | C8959EA21F6F377C006AC83B /* Resources */, 102 | ); 103 | buildRules = ( 104 | ); 105 | dependencies = ( 106 | ); 107 | name = FilterShop; 108 | productName = FilterShop; 109 | productReference = C8959EA41F6F377C006AC83B /* FilterShop.app */; 110 | productType = "com.apple.product-type.application"; 111 | }; 112 | /* End PBXNativeTarget section */ 113 | 114 | /* Begin PBXProject section */ 115 | C8959E9C1F6F377C006AC83B /* Project object */ = { 116 | isa = PBXProject; 117 | attributes = { 118 | LastSwiftUpdateCheck = 0830; 119 | LastUpgradeCheck = 0830; 120 | ORGANIZATIONNAME = XueYu; 121 | TargetAttributes = { 122 | C8959EA31F6F377C006AC83B = { 123 | CreatedOnToolsVersion = 8.3.3; 124 | DevelopmentTeam = L2UHX34QKF; 125 | ProvisioningStyle = Automatic; 126 | }; 127 | }; 128 | }; 129 | buildConfigurationList = C8959E9F1F6F377C006AC83B /* Build configuration list for PBXProject "FilterShop" */; 130 | compatibilityVersion = "Xcode 3.2"; 131 | developmentRegion = English; 132 | hasScannedForEncodings = 0; 133 | knownRegions = ( 134 | en, 135 | Base, 136 | ); 137 | mainGroup = C8959E9B1F6F377C006AC83B; 138 | productRefGroup = C8959EA51F6F377C006AC83B /* Products */; 139 | projectDirPath = ""; 140 | projectRoot = ""; 141 | targets = ( 142 | C8959EA31F6F377C006AC83B /* FilterShop */, 143 | ); 144 | }; 145 | /* End PBXProject section */ 146 | 147 | /* Begin PBXResourcesBuildPhase section */ 148 | C8959EA21F6F377C006AC83B /* Resources */ = { 149 | isa = PBXResourcesBuildPhase; 150 | buildActionMask = 2147483647; 151 | files = ( 152 | C8959EAC1F6F377C006AC83B /* Assets.xcassets in Resources */, 153 | C82B9A431F70362A009F559F /* FilterParameter.storyboard in Resources */, 154 | C8959EAF1F6F377C006AC83B /* Main.storyboard in Resources */, 155 | ); 156 | runOnlyForDeploymentPostprocessing = 0; 157 | }; 158 | /* End PBXResourcesBuildPhase section */ 159 | 160 | /* Begin PBXSourcesBuildPhase section */ 161 | C8959EA01F6F377C006AC83B /* Sources */ = { 162 | isa = PBXSourcesBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | C8959EB71F6F37A4006AC83B /* CoreImageFilters.swift in Sources */, 166 | C8959EAA1F6F377C006AC83B /* ViewController.swift in Sources */, 167 | C8959EBA1F6F3CE3006AC83B /* MediaDisplayView.swift in Sources */, 168 | C82B9A451F703685009F559F /* FilterParameterVC.swift in Sources */, 169 | C8959EA81F6F377C006AC83B /* AppDelegate.swift in Sources */, 170 | ); 171 | runOnlyForDeploymentPostprocessing = 0; 172 | }; 173 | /* End PBXSourcesBuildPhase section */ 174 | 175 | /* Begin PBXVariantGroup section */ 176 | C8959EAD1F6F377C006AC83B /* Main.storyboard */ = { 177 | isa = PBXVariantGroup; 178 | children = ( 179 | C8959EAE1F6F377C006AC83B /* Base */, 180 | ); 181 | name = Main.storyboard; 182 | sourceTree = ""; 183 | }; 184 | /* End PBXVariantGroup section */ 185 | 186 | /* Begin XCBuildConfiguration section */ 187 | C8959EB11F6F377C006AC83B /* Debug */ = { 188 | isa = XCBuildConfiguration; 189 | buildSettings = { 190 | ALWAYS_SEARCH_USER_PATHS = NO; 191 | CLANG_ANALYZER_NONNULL = YES; 192 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 193 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 194 | CLANG_CXX_LIBRARY = "libc++"; 195 | CLANG_ENABLE_MODULES = YES; 196 | CLANG_ENABLE_OBJC_ARC = YES; 197 | CLANG_WARN_BOOL_CONVERSION = YES; 198 | CLANG_WARN_CONSTANT_CONVERSION = YES; 199 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 200 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 201 | CLANG_WARN_EMPTY_BODY = YES; 202 | CLANG_WARN_ENUM_CONVERSION = YES; 203 | CLANG_WARN_INFINITE_RECURSION = YES; 204 | CLANG_WARN_INT_CONVERSION = YES; 205 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 206 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 207 | CLANG_WARN_UNREACHABLE_CODE = YES; 208 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 209 | CODE_SIGN_IDENTITY = "-"; 210 | COPY_PHASE_STRIP = NO; 211 | DEBUG_INFORMATION_FORMAT = dwarf; 212 | ENABLE_STRICT_OBJC_MSGSEND = YES; 213 | ENABLE_TESTABILITY = YES; 214 | GCC_C_LANGUAGE_STANDARD = gnu99; 215 | GCC_DYNAMIC_NO_PIC = NO; 216 | GCC_NO_COMMON_BLOCKS = YES; 217 | GCC_OPTIMIZATION_LEVEL = 0; 218 | GCC_PREPROCESSOR_DEFINITIONS = ( 219 | "DEBUG=1", 220 | "$(inherited)", 221 | ); 222 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 223 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 224 | GCC_WARN_UNDECLARED_SELECTOR = YES; 225 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 226 | GCC_WARN_UNUSED_FUNCTION = YES; 227 | GCC_WARN_UNUSED_VARIABLE = YES; 228 | MACOSX_DEPLOYMENT_TARGET = 10.12; 229 | MTL_ENABLE_DEBUG_INFO = YES; 230 | ONLY_ACTIVE_ARCH = YES; 231 | SDKROOT = macosx; 232 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 233 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 234 | }; 235 | name = Debug; 236 | }; 237 | C8959EB21F6F377C006AC83B /* Release */ = { 238 | isa = XCBuildConfiguration; 239 | buildSettings = { 240 | ALWAYS_SEARCH_USER_PATHS = NO; 241 | CLANG_ANALYZER_NONNULL = YES; 242 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 243 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 244 | CLANG_CXX_LIBRARY = "libc++"; 245 | CLANG_ENABLE_MODULES = YES; 246 | CLANG_ENABLE_OBJC_ARC = YES; 247 | CLANG_WARN_BOOL_CONVERSION = YES; 248 | CLANG_WARN_CONSTANT_CONVERSION = YES; 249 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 250 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INFINITE_RECURSION = YES; 254 | CLANG_WARN_INT_CONVERSION = YES; 255 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 256 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 257 | CLANG_WARN_UNREACHABLE_CODE = YES; 258 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 259 | CODE_SIGN_IDENTITY = "-"; 260 | COPY_PHASE_STRIP = NO; 261 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 262 | ENABLE_NS_ASSERTIONS = NO; 263 | ENABLE_STRICT_OBJC_MSGSEND = YES; 264 | GCC_C_LANGUAGE_STANDARD = gnu99; 265 | GCC_NO_COMMON_BLOCKS = YES; 266 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 267 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 268 | GCC_WARN_UNDECLARED_SELECTOR = YES; 269 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 270 | GCC_WARN_UNUSED_FUNCTION = YES; 271 | GCC_WARN_UNUSED_VARIABLE = YES; 272 | MACOSX_DEPLOYMENT_TARGET = 10.12; 273 | MTL_ENABLE_DEBUG_INFO = NO; 274 | SDKROOT = macosx; 275 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 276 | }; 277 | name = Release; 278 | }; 279 | C8959EB41F6F377C006AC83B /* Debug */ = { 280 | isa = XCBuildConfiguration; 281 | buildSettings = { 282 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 283 | COMBINE_HIDPI_IMAGES = YES; 284 | DEVELOPMENT_TEAM = L2UHX34QKF; 285 | INFOPLIST_FILE = FilterShop/Info.plist; 286 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 287 | MACOSX_DEPLOYMENT_TARGET = 10.10; 288 | PRODUCT_BUNDLE_IDENTIFIER = com.xueyu.FilterShop; 289 | PRODUCT_NAME = "$(TARGET_NAME)"; 290 | SWIFT_VERSION = 3.0; 291 | }; 292 | name = Debug; 293 | }; 294 | C8959EB51F6F377C006AC83B /* Release */ = { 295 | isa = XCBuildConfiguration; 296 | buildSettings = { 297 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 298 | COMBINE_HIDPI_IMAGES = YES; 299 | DEVELOPMENT_TEAM = L2UHX34QKF; 300 | INFOPLIST_FILE = FilterShop/Info.plist; 301 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; 302 | MACOSX_DEPLOYMENT_TARGET = 10.10; 303 | PRODUCT_BUNDLE_IDENTIFIER = com.xueyu.FilterShop; 304 | PRODUCT_NAME = "$(TARGET_NAME)"; 305 | SWIFT_VERSION = 3.0; 306 | }; 307 | name = Release; 308 | }; 309 | /* End XCBuildConfiguration section */ 310 | 311 | /* Begin XCConfigurationList section */ 312 | C8959E9F1F6F377C006AC83B /* Build configuration list for PBXProject "FilterShop" */ = { 313 | isa = XCConfigurationList; 314 | buildConfigurations = ( 315 | C8959EB11F6F377C006AC83B /* Debug */, 316 | C8959EB21F6F377C006AC83B /* Release */, 317 | ); 318 | defaultConfigurationIsVisible = 0; 319 | defaultConfigurationName = Release; 320 | }; 321 | C8959EB31F6F377C006AC83B /* Build configuration list for PBXNativeTarget "FilterShop" */ = { 322 | isa = XCConfigurationList; 323 | buildConfigurations = ( 324 | C8959EB41F6F377C006AC83B /* Debug */, 325 | C8959EB51F6F377C006AC83B /* Release */, 326 | ); 327 | defaultConfigurationIsVisible = 0; 328 | defaultConfigurationName = Release; 329 | }; 330 | /* End XCConfigurationList section */ 331 | }; 332 | rootObject = C8959E9C1F6F377C006AC83B /* Project object */; 333 | } 334 | -------------------------------------------------------------------------------- /FilterShop/FilterShop.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FilterShop/FilterShop.xcodeproj/project.xcworkspace/xcuserdata/XueYu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrisYu/FilterShop/7cdbc1e80273950ea1d309a02eb80e499d2f9a76/FilterShop/FilterShop.xcodeproj/project.xcworkspace/xcuserdata/XueYu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /FilterShop/FilterShop.xcodeproj/xcuserdata/XueYu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /FilterShop/FilterShop.xcodeproj/xcuserdata/XueYu.xcuserdatad/xcschemes/FilterShop.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /FilterShop/FilterShop.xcodeproj/xcuserdata/XueYu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | FilterShop.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C8959EA31F6F377C006AC83B 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // FilterShop 4 | // 5 | // Created by Xue Yu on 9/17/17. 6 | // Copyright © 2017 XueYu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | @NSApplicationMain 12 | class AppDelegate: NSObject, NSApplicationDelegate { 13 | 14 | 15 | 16 | func applicationDidFinishLaunching(_ aNotification: Notification) { 17 | // Insert code here to initialize your application 18 | } 19 | 20 | func applicationWillTerminate(_ aNotification: Notification) { 21 | // Insert code here to tear down your application 22 | } 23 | 24 | func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 25 | return true 26 | } 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "size" : "16x16", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "size" : "16x16", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "size" : "32x32", 16 | "scale" : "1x" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "size" : "32x32", 21 | "scale" : "2x" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "size" : "128x128", 26 | "scale" : "1x" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "size" : "128x128", 31 | "scale" : "2x" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "size" : "256x256", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "size" : "256x256", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "size" : "512x512", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "size" : "512x512", 51 | "scale" : "2x" 52 | } 53 | ], 54 | "info" : { 55 | "version" : 1, 56 | "author" : "xcode" 57 | } 58 | } -------------------------------------------------------------------------------- /FilterShop/FilterShop/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 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 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 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 210 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 273 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 303 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/FilterParameter.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 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 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 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 269 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/FilterParameterVC.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FilterParameterVC.swift 3 | // FilterShop 4 | // 5 | // Created by XueYu on 9/18/17. 6 | // Copyright © 2017 XueYu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | // Display the filter Parameters in tableView 12 | class FilterParameterVC: NSViewController { 13 | 14 | @IBOutlet weak var filterParametersTableView: NSTableView! 15 | var filter: CIFilter? 16 | 17 | override func viewDidLoad() { 18 | super.viewDidLoad() 19 | 20 | filterParametersTableView.delegate = self 21 | filterParametersTableView.dataSource = self 22 | } 23 | 24 | override func viewDidAppear() { 25 | guard let window = self.view.window, 26 | let filter = filter 27 | else { return } 28 | 29 | window.title = filter.name 30 | } 31 | 32 | } 33 | 34 | 35 | extension FilterParameterVC : NSTableViewDelegate, NSTableViewDataSource { 36 | 37 | func numberOfRows(in tableView: NSTableView) -> Int { 38 | return filter?.inputKeys.count ?? 0 39 | } 40 | 41 | 42 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { 43 | 44 | guard let view = tableView.make(withIdentifier: "cell", owner: self) as? NSTableCellView, 45 | let key = filter?.inputKeys[row], 46 | let paraDict = filter?.attributes[key] as? [String: Any] 47 | else { return nil } 48 | 49 | let colId = tableColumn?.identifier ?? "" 50 | var viewText = "" 51 | 52 | switch colId { 53 | case "name": 54 | viewText = key 55 | case "description": 56 | viewText = paraDict[kCIAttributeDescription] as? String ?? "No Description" 57 | case "attributeName": 58 | viewText = paraDict[kCIAttributeClass] as? String ?? "No AttributeName" 59 | case "attributeType": 60 | viewText = paraDict[kCIAttributeType] as? String ?? "No AttributeType" 61 | case "defaultValue": 62 | viewText = String(describing:paraDict[kCIAttributeDefault]) 63 | case "minValue": 64 | viewText = String(describing: paraDict[kCIAttributeSliderMin]) 65 | case "maxValue": 66 | viewText = String(describing: paraDict[kCIAttributeSliderMax]) 67 | default: 68 | break 69 | } 70 | 71 | view.textField?.stringValue = viewText 72 | 73 | return view 74 | 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | Copyright © 2017 XueYu. All rights reserved. 27 | NSMainStoryboardFile 28 | Main 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/MediaDisplayView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // MediaDisplayView.swift 3 | // FilterShop 4 | // 5 | // Created by Xue Yu on 9/17/17. 6 | // Copyright © 2017 XueYu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | 11 | /// MediaDisplayView will be used to show the image 12 | /// It accepts drag and drop image 13 | /// The filters effects is used on layer until we wants to export it 14 | class MediaDisplayView: NSView { 15 | 16 | /// The imageUrl, shown in NSImageView, we'll use it to create NSImage and CIImage 17 | var imageUrl: URL? { 18 | didSet { 19 | guard let imageUrl = imageUrl else { return } 20 | nsimage = NSImage.init(contentsOf: imageUrl) 21 | ciimage = CIImage.init(contentsOf: imageUrl) 22 | needsDisplay = true 23 | } 24 | } 25 | 26 | /// ImageView to display Image 27 | var imageView = NSImageView() 28 | 29 | /// NSImage of the ImageView 30 | var nsimage: NSImage? { 31 | get { 32 | return imageView.image 33 | } 34 | set { 35 | imageView.image = newValue 36 | } 37 | } 38 | 39 | /// For display effciency, we'll apply the filters on layers, but for export/save we need to use ciimage 40 | var ciimage: CIImage? 41 | 42 | /// receive drag and drop, display accordingly 43 | var isReceivingDrag = false { 44 | didSet { 45 | needsDisplay = true 46 | } 47 | } 48 | 49 | /// Options of the drag and drop eare, only receive images 50 | let options = [NSPasteboardURLReadingContentsConformToTypesKey: NSImage.imageTypes()] 51 | 52 | /// Set up ImageView and layer for filter 53 | override func draw(_ dirtyRect: NSRect) { 54 | super.draw(dirtyRect) 55 | 56 | self.addSubview(imageView) 57 | imageView.frame = self.bounds 58 | 59 | self.layerUsesCoreImageFilters = true 60 | self.wantsLayer = true 61 | 62 | 63 | NSColor.gray.setFill() 64 | NSRectFill(dirtyRect) 65 | } 66 | 67 | /// Register drag and drop, also unregister for imageView, since imageView support drag and drop naturally 68 | override func awakeFromNib() { 69 | register(forDraggedTypes: [NSURLPboardType]) 70 | imageView.unregisterDraggedTypes() 71 | } 72 | 73 | 74 | 75 | /// Return drag and drop should be allowed for this 76 | func shouldAllowDrag(_ draggingInfo: NSDraggingInfo) -> Bool { 77 | 78 | var canAccept = false 79 | let pasteBoard = draggingInfo.draggingPasteboard() 80 | 81 | if pasteBoard.canReadObject(forClasses: [ NSURL.self ], options: options) { 82 | canAccept = true 83 | } 84 | 85 | return canAccept 86 | } 87 | 88 | 89 | override func prepareForDragOperation(_ sender: NSDraggingInfo) -> Bool { 90 | let allow = shouldAllowDrag(sender) 91 | return allow 92 | } 93 | 94 | 95 | override func draggingEntered(_ sender: NSDraggingInfo) -> NSDragOperation { 96 | let allow = shouldAllowDrag(sender) 97 | isReceivingDrag = allow 98 | 99 | return allow ? .copy : NSDragOperation() 100 | } 101 | 102 | override func draggingExited(_ sender: NSDraggingInfo?) { 103 | isReceivingDrag = false 104 | } 105 | 106 | 107 | override func performDragOperation(_ sender: NSDraggingInfo) -> Bool { 108 | isReceivingDrag = false 109 | 110 | let pasteBoard = sender.draggingPasteboard() 111 | 112 | if let urls = pasteBoard.readObjects(forClasses: [NSURL.self], options: options) as? [URL], 113 | let fileUrl = urls.first { 114 | imageUrl = fileUrl 115 | return true 116 | } 117 | return false 118 | } 119 | 120 | /// apply filters to layers 121 | func apply(filters: [CIFilter]) { 122 | self.layer?.filters = filters 123 | } 124 | 125 | 126 | /** 127 | Export CGImage for 128 | */ 129 | func export(filters: [CIFilter]) -> CGImage? { 130 | 131 | guard var inputImage = ciimage else { return nil } 132 | 133 | for filter in filters { 134 | filter.setValue(inputImage, forKey: kCIInputImageKey) 135 | inputImage = filter.outputImage! 136 | } 137 | 138 | let cxt = CIContext() 139 | return cxt.createCGImage(inputImage, from: inputImage.extent) 140 | } 141 | 142 | 143 | 144 | 145 | 146 | } 147 | 148 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/Model/CoreImageFilters.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CoreImageFilters.swift 3 | // FilterShop 4 | // 5 | // Created by Xue Yu on 9/17/17. 6 | // Copyright © 2017 XueYu. All rights reserved. 7 | // 8 | 9 | import CoreImage 10 | 11 | /// This struct provide all the avliable Filters from CoreImage 12 | struct CoreImageFilters { 13 | 14 | /** 15 | return all avaliable filters names as array of String 16 | */ 17 | static func avaliableFilters() -> [String] { 18 | 19 | let filterCategories = [ 20 | kCICategoryBlur, 21 | kCICategoryColorAdjustment, 22 | kCICategoryColorEffect, 23 | kCICategoryCompositeOperation, 24 | kCICategoryDistortionEffect, 25 | kCICategoryGradient, 26 | kCICategoryHalftoneEffect, 27 | kCICategoryReduction, 28 | kCICategorySharpen, 29 | kCICategoryStylize, 30 | kCICategoryTileEffect, 31 | kCICategoryTransition 32 | ] 33 | 34 | var avaliableFilters = [String]() 35 | 36 | for categoryName in filterCategories { 37 | avaliableFilters.append(categoryName) 38 | avaliableFilters.append(contentsOf: CIFilter.filterNames(inCategory: categoryName)) 39 | } 40 | 41 | return avaliableFilters 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /FilterShop/FilterShop/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // FilterShop 4 | // 5 | // Created by Xue Yu on 9/17/17. 6 | // Copyright © 2017 XueYu. All rights reserved. 7 | // 8 | 9 | import Cocoa 10 | import Quartz 11 | 12 | /// Main View Controller. 13 | /// - avaliableFiltersTableView : tableview to list all avaliable Filters. 14 | /// - chosenFiltersTableView : tableview to list all chosen Filters. 15 | /// - mediaView : display the media(image). 16 | /// - avaliableFilters : dataSource of avaliableFiltersTableView. 17 | /// - chosenFilters : dataSource of chosenFiltersTableView, and applied on mediaView. 18 | /// - curFilter : Current choosed Filter 19 | /// - saveOptions : Use IKSaveOptions from Quartz to better save the image. 20 | class ViewController: NSViewController { 21 | 22 | @IBOutlet weak var avaliableFiltersTableView: NSTableView! 23 | @IBOutlet weak var chosenFiltersTableView: NSTableView! 24 | @IBOutlet weak var mediaView: MediaDisplayView! 25 | 26 | let avaliableFilters = CoreImageFilters.avaliableFilters() 27 | var curFilter: CIFilter? 28 | var chosenFilters = [CIFilter](){ 29 | didSet { 30 | mediaView.apply(filters: chosenFilters) 31 | } 32 | } 33 | 34 | var saveOptions = IKSaveOptions() 35 | 36 | override func viewDidLoad() { 37 | super.viewDidLoad() 38 | 39 | avaliableFiltersTableView.dataSource = self 40 | avaliableFiltersTableView.delegate = self 41 | chosenFiltersTableView.dataSource = self 42 | chosenFiltersTableView.delegate = self 43 | } 44 | 45 | override var representedObject: Any? { 46 | didSet { 47 | // Update the view, if already loaded. 48 | } 49 | } 50 | 51 | /** 52 | add avaliable Filter to chosen Filter 53 | */ 54 | @IBAction func addFilterTouched(_ sender: NSButton) { 55 | let idx = avaliableFiltersTableView.row(for: sender) 56 | let chosenFilterName = avaliableFilters[idx] 57 | 58 | guard let chosenFilter = CIFilter.init(name: chosenFilterName) else { return } 59 | 60 | chosenFiltersTableView.beginUpdates() 61 | chosenFilters.append(chosenFilter) 62 | chosenFiltersTableView.insertRows(at: IndexSet(integer: chosenFilters.count - 1), withAnimation: .effectFade) 63 | chosenFiltersTableView.endUpdates() 64 | 65 | } 66 | 67 | 68 | /** 69 | remove chosen Filter from chosen Filters 70 | */ 71 | @IBAction func deleteFilterTouched(_ sender: NSButton) { 72 | let idx = chosenFiltersTableView.row(for: sender) 73 | 74 | chosenFiltersTableView.beginUpdates() 75 | chosenFilters.remove(at: idx) 76 | chosenFiltersTableView.removeRows(at: IndexSet(integer: idx), withAnimation: .effectFade) 77 | chosenFiltersTableView.endUpdates() 78 | 79 | curFilter = nil 80 | 81 | } 82 | 83 | /** 84 | show filter parameters about the touched filter 85 | */ 86 | @IBAction func infoButtonTouched(_ sender: NSButton) { 87 | performSegue(withIdentifier: "filterParameter", sender: sender) 88 | } 89 | 90 | 91 | /** 92 | prepare for segue 93 | */ 94 | override func prepare(for segue: NSStoryboardSegue, sender: Any?) { 95 | let segueId = segue.identifier ?? "UnknownSegue" 96 | if segueId == "filterParameter" { 97 | let destinationvc = segue.destinationController as? FilterParameterVC 98 | let idx = chosenFiltersTableView.row(for: sender as! NSView) 99 | curFilter = chosenFilters[idx] 100 | 101 | destinationvc?.filter = curFilter 102 | } 103 | 104 | } 105 | 106 | 107 | /** 108 | For Menu Item Open Image 109 | */ 110 | @IBAction func openImage(_ sender: AnyObject){ 111 | let openPanel = NSOpenPanel() 112 | openPanel.allowedFileTypes = ["jpg","png","pdf","pct", "bmp", "tiff"] 113 | openPanel.allowsMultipleSelection = false 114 | openPanel.canChooseDirectories = false 115 | 116 | guard let window = self.view.window else { return } 117 | openPanel.beginSheetModal(for: window) { (result) in 118 | if result == NSModalResponseOK { 119 | if let url = openPanel.url { 120 | self.mediaView.imageUrl = url 121 | } 122 | else { 123 | let alert = NSAlert() 124 | alert.messageText = "You can also drop image in gray area." 125 | alert.runModal() 126 | } 127 | } 128 | } 129 | } 130 | 131 | // Help Menu Item 132 | @IBAction func helpMenuItemTouched(_ sender: NSMenuItem) { 133 | let url = URL(string: "https://github.com/KrisYu/FilterShop")! 134 | NSWorkspace.shared().open(url) 135 | } 136 | 137 | 138 | /** 139 | For Menu Item Save Image 140 | */ 141 | @IBAction func saveAs(_ sender: AnyObject){ 142 | let savePanel = NSSavePanel() 143 | saveOptions = IKSaveOptions(imageProperties: [:], imageUTType: kUTTypePNG as String!) 144 | saveOptions.addAccessoryView(to: savePanel) 145 | 146 | guard let window = self.view.window, let _ = mediaView.ciimage else { return } 147 | savePanel.beginSheetModal(for: window) { (result) in 148 | if result == NSFileHandlingPanelOKButton { 149 | self.savePanelDidEnd(sheet: savePanel, returnCode: result) 150 | } 151 | } 152 | } 153 | 154 | func savePanelDidEnd (sheet: NSSavePanel, returnCode: NSInteger) { 155 | if returnCode == NSModalResponseOK { 156 | guard let newUTType = saveOptions.imageUTType as CFString?, 157 | let url = sheet.url as CFURL?, 158 | let cgimage = mediaView.export(filters: chosenFilters), 159 | let dest = CGImageDestinationCreateWithURL(url, newUTType, 1, nil) 160 | else { return } 161 | CGImageDestinationAddImage(dest, cgimage, nil) 162 | 163 | if CGImageDestinationFinalize(dest) { 164 | print(dest) 165 | } else { 166 | print("*** saveImageToPath - no image") 167 | } 168 | } 169 | } 170 | 171 | 172 | } 173 | 174 | 175 | extension ViewController: NSTableViewDelegate, NSTableViewDataSource { 176 | 177 | func numberOfRows(in tableView: NSTableView) -> Int { 178 | if tableView == avaliableFiltersTableView { 179 | return avaliableFilters.count 180 | } else { 181 | return chosenFilters.count 182 | } 183 | } 184 | 185 | func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? { 186 | 187 | if tableView == avaliableFiltersTableView { 188 | let filterName = avaliableFilters[row] 189 | 190 | // cell display Category and Filter in a different way 191 | if filterName.hasPrefix("CICategory") { 192 | guard let cell = tableView.make(withIdentifier: "CategoryCell", owner: self) as? NSTableCellView else { 193 | return nil 194 | } 195 | 196 | let text = CIFilter.localizedName(forCategory: filterName) 197 | cell.textField?.stringValue = text 198 | return cell 199 | } else { 200 | guard let cell = tableView.make(withIdentifier: "FilterCell", owner: self) as? NSTableCellView, 201 | let text = CIFilter.localizedName(forFilterName: filterName) else { 202 | return nil 203 | } 204 | cell.textField?.stringValue = text 205 | return cell 206 | } 207 | } else { 208 | 209 | let filterName = chosenFilters[row].name 210 | 211 | guard let cell = tableView.make(withIdentifier: "chosenFilterCell", owner: self) as? NSTableCellView else { return nil } 212 | 213 | // display the filter name in readable way 214 | cell.textField?.stringValue = CIFilter.localizedName(forFilterName: filterName) ?? "Unknown Filter" 215 | 216 | return cell 217 | } 218 | 219 | } 220 | 221 | 222 | /// Avoid row selection 223 | func tableView(_ tableView: NSTableView, shouldSelectRow row: Int) -> Bool { 224 | return false 225 | } 226 | 227 | } 228 | 229 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Xue Yu 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 | -------------------------------------------------------------------------------- /ReadMe.md: -------------------------------------------------------------------------------- 1 | # FilterShop 2 | 3 | A macOS App to explore Core Image Filters. 4 | 5 | ![](showcase.png) 6 | 7 | 8 | ## Features 9 | 10 | - [x] drag and drop image files to App 11 | - [x] add filters to see the results 12 | - [x] real time filter effects 13 | - [x] save rendered image 14 | - [x] showcase the filter default parameters 15 | 16 | ## Notice 17 | 18 | - Filters are added to layer until we save the image. 19 | - All Filter use default parameters. 20 | - Some filters are not that applicable to dropped images. So you'll not see obvious changes. 21 | - Should built on macOS 10.10+, only tested on my Mac. 22 | 23 | 24 | ## License 25 | 26 | MIT 27 | 28 | 29 | -------------------------------------------------------------------------------- /showcase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/KrisYu/FilterShop/7cdbc1e80273950ea1d309a02eb80e499d2f9a76/showcase.png --------------------------------------------------------------------------------