├── LICENSE.md ├── ObjectCaptureCocoa.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── saibalaji.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── saibalaji.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ └── xcschememanagement.plist ├── ObjectCaptureCocoa ├── AppDelegate.swift ├── Assets.xcassets │ ├── AccentColor.colorset │ │ └── Contents.json │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── Contents.json ├── Base.lproj │ └── Main.storyboard ├── ObjectCaptureCocoa.entitlements ├── Service │ └── ObjectCaptureService.swift └── ViewController.swift └── README.md /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Sai Balaji 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 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 55; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | E40F885A28D82EC80086F1B2 /* ObjectCaptureService.swift in Sources */ = {isa = PBXBuildFile; fileRef = E40F885928D82EC80086F1B2 /* ObjectCaptureService.swift */; }; 11 | E40F889528D7796C00084D63 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E40F889428D7796C00084D63 /* AppDelegate.swift */; }; 12 | E40F889728D7796C00084D63 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E40F889628D7796C00084D63 /* ViewController.swift */; }; 13 | E40F889928D7796D00084D63 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E40F889828D7796D00084D63 /* Assets.xcassets */; }; 14 | E40F889C28D7796D00084D63 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E40F889A28D7796D00084D63 /* Main.storyboard */; }; 15 | /* End PBXBuildFile section */ 16 | 17 | /* Begin PBXFileReference section */ 18 | E40F885928D82EC80086F1B2 /* ObjectCaptureService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ObjectCaptureService.swift; sourceTree = ""; }; 19 | E40F889128D7796C00084D63 /* ObjectCaptureCocoa.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ObjectCaptureCocoa.app; sourceTree = BUILT_PRODUCTS_DIR; }; 20 | E40F889428D7796C00084D63 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 21 | E40F889628D7796C00084D63 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 22 | E40F889828D7796D00084D63 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 23 | E40F889B28D7796D00084D63 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 24 | E40F889D28D7796D00084D63 /* ObjectCaptureCocoa.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ObjectCaptureCocoa.entitlements; sourceTree = ""; }; 25 | /* End PBXFileReference section */ 26 | 27 | /* Begin PBXFrameworksBuildPhase section */ 28 | E40F888E28D7796C00084D63 /* Frameworks */ = { 29 | isa = PBXFrameworksBuildPhase; 30 | buildActionMask = 2147483647; 31 | files = ( 32 | ); 33 | runOnlyForDeploymentPostprocessing = 0; 34 | }; 35 | /* End PBXFrameworksBuildPhase section */ 36 | 37 | /* Begin PBXGroup section */ 38 | E40F885828D82EB80086F1B2 /* Service */ = { 39 | isa = PBXGroup; 40 | children = ( 41 | E40F885928D82EC80086F1B2 /* ObjectCaptureService.swift */, 42 | ); 43 | path = Service; 44 | sourceTree = ""; 45 | }; 46 | E40F888828D7796C00084D63 = { 47 | isa = PBXGroup; 48 | children = ( 49 | E40F889328D7796C00084D63 /* ObjectCaptureCocoa */, 50 | E40F889228D7796C00084D63 /* Products */, 51 | ); 52 | sourceTree = ""; 53 | }; 54 | E40F889228D7796C00084D63 /* Products */ = { 55 | isa = PBXGroup; 56 | children = ( 57 | E40F889128D7796C00084D63 /* ObjectCaptureCocoa.app */, 58 | ); 59 | name = Products; 60 | sourceTree = ""; 61 | }; 62 | E40F889328D7796C00084D63 /* ObjectCaptureCocoa */ = { 63 | isa = PBXGroup; 64 | children = ( 65 | E40F885828D82EB80086F1B2 /* Service */, 66 | E40F889428D7796C00084D63 /* AppDelegate.swift */, 67 | E40F889628D7796C00084D63 /* ViewController.swift */, 68 | E40F889828D7796D00084D63 /* Assets.xcassets */, 69 | E40F889A28D7796D00084D63 /* Main.storyboard */, 70 | E40F889D28D7796D00084D63 /* ObjectCaptureCocoa.entitlements */, 71 | ); 72 | path = ObjectCaptureCocoa; 73 | sourceTree = ""; 74 | }; 75 | /* End PBXGroup section */ 76 | 77 | /* Begin PBXNativeTarget section */ 78 | E40F889028D7796C00084D63 /* ObjectCaptureCocoa */ = { 79 | isa = PBXNativeTarget; 80 | buildConfigurationList = E40F88A028D7796D00084D63 /* Build configuration list for PBXNativeTarget "ObjectCaptureCocoa" */; 81 | buildPhases = ( 82 | E40F888D28D7796C00084D63 /* Sources */, 83 | E40F888E28D7796C00084D63 /* Frameworks */, 84 | E40F888F28D7796C00084D63 /* Resources */, 85 | ); 86 | buildRules = ( 87 | ); 88 | dependencies = ( 89 | ); 90 | name = ObjectCaptureCocoa; 91 | productName = ObjectCaptureCocoa; 92 | productReference = E40F889128D7796C00084D63 /* ObjectCaptureCocoa.app */; 93 | productType = "com.apple.product-type.application"; 94 | }; 95 | /* End PBXNativeTarget section */ 96 | 97 | /* Begin PBXProject section */ 98 | E40F888928D7796C00084D63 /* Project object */ = { 99 | isa = PBXProject; 100 | attributes = { 101 | BuildIndependentTargetsInParallel = 1; 102 | LastSwiftUpdateCheck = 1340; 103 | LastUpgradeCheck = 1340; 104 | TargetAttributes = { 105 | E40F889028D7796C00084D63 = { 106 | CreatedOnToolsVersion = 13.4.1; 107 | }; 108 | }; 109 | }; 110 | buildConfigurationList = E40F888C28D7796C00084D63 /* Build configuration list for PBXProject "ObjectCaptureCocoa" */; 111 | compatibilityVersion = "Xcode 13.0"; 112 | developmentRegion = en; 113 | hasScannedForEncodings = 0; 114 | knownRegions = ( 115 | en, 116 | Base, 117 | ); 118 | mainGroup = E40F888828D7796C00084D63; 119 | productRefGroup = E40F889228D7796C00084D63 /* Products */; 120 | projectDirPath = ""; 121 | projectRoot = ""; 122 | targets = ( 123 | E40F889028D7796C00084D63 /* ObjectCaptureCocoa */, 124 | ); 125 | }; 126 | /* End PBXProject section */ 127 | 128 | /* Begin PBXResourcesBuildPhase section */ 129 | E40F888F28D7796C00084D63 /* Resources */ = { 130 | isa = PBXResourcesBuildPhase; 131 | buildActionMask = 2147483647; 132 | files = ( 133 | E40F889928D7796D00084D63 /* Assets.xcassets in Resources */, 134 | E40F889C28D7796D00084D63 /* Main.storyboard in Resources */, 135 | ); 136 | runOnlyForDeploymentPostprocessing = 0; 137 | }; 138 | /* End PBXResourcesBuildPhase section */ 139 | 140 | /* Begin PBXSourcesBuildPhase section */ 141 | E40F888D28D7796C00084D63 /* Sources */ = { 142 | isa = PBXSourcesBuildPhase; 143 | buildActionMask = 2147483647; 144 | files = ( 145 | E40F889728D7796C00084D63 /* ViewController.swift in Sources */, 146 | E40F885A28D82EC80086F1B2 /* ObjectCaptureService.swift in Sources */, 147 | E40F889528D7796C00084D63 /* AppDelegate.swift in Sources */, 148 | ); 149 | runOnlyForDeploymentPostprocessing = 0; 150 | }; 151 | /* End PBXSourcesBuildPhase section */ 152 | 153 | /* Begin PBXVariantGroup section */ 154 | E40F889A28D7796D00084D63 /* Main.storyboard */ = { 155 | isa = PBXVariantGroup; 156 | children = ( 157 | E40F889B28D7796D00084D63 /* Base */, 158 | ); 159 | name = Main.storyboard; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXVariantGroup section */ 163 | 164 | /* Begin XCBuildConfiguration section */ 165 | E40F889E28D7796D00084D63 /* Debug */ = { 166 | isa = XCBuildConfiguration; 167 | buildSettings = { 168 | ALWAYS_SEARCH_USER_PATHS = NO; 169 | CLANG_ANALYZER_NONNULL = YES; 170 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 171 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 172 | CLANG_ENABLE_MODULES = YES; 173 | CLANG_ENABLE_OBJC_ARC = YES; 174 | CLANG_ENABLE_OBJC_WEAK = YES; 175 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 176 | CLANG_WARN_BOOL_CONVERSION = YES; 177 | CLANG_WARN_COMMA = YES; 178 | CLANG_WARN_CONSTANT_CONVERSION = YES; 179 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 180 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 181 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 182 | CLANG_WARN_EMPTY_BODY = YES; 183 | CLANG_WARN_ENUM_CONVERSION = YES; 184 | CLANG_WARN_INFINITE_RECURSION = YES; 185 | CLANG_WARN_INT_CONVERSION = YES; 186 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 187 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 188 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 189 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 190 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 191 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 192 | CLANG_WARN_STRICT_PROTOTYPES = YES; 193 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 194 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 195 | CLANG_WARN_UNREACHABLE_CODE = YES; 196 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 197 | COPY_PHASE_STRIP = NO; 198 | DEBUG_INFORMATION_FORMAT = dwarf; 199 | ENABLE_STRICT_OBJC_MSGSEND = YES; 200 | ENABLE_TESTABILITY = YES; 201 | GCC_C_LANGUAGE_STANDARD = gnu11; 202 | GCC_DYNAMIC_NO_PIC = NO; 203 | GCC_NO_COMMON_BLOCKS = YES; 204 | GCC_OPTIMIZATION_LEVEL = 0; 205 | GCC_PREPROCESSOR_DEFINITIONS = ( 206 | "DEBUG=1", 207 | "$(inherited)", 208 | ); 209 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 210 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 211 | GCC_WARN_UNDECLARED_SELECTOR = YES; 212 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 213 | GCC_WARN_UNUSED_FUNCTION = YES; 214 | GCC_WARN_UNUSED_VARIABLE = YES; 215 | MACOSX_DEPLOYMENT_TARGET = 12.3; 216 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 217 | MTL_FAST_MATH = YES; 218 | ONLY_ACTIVE_ARCH = YES; 219 | SDKROOT = macosx; 220 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 221 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 222 | }; 223 | name = Debug; 224 | }; 225 | E40F889F28D7796D00084D63 /* Release */ = { 226 | isa = XCBuildConfiguration; 227 | buildSettings = { 228 | ALWAYS_SEARCH_USER_PATHS = NO; 229 | CLANG_ANALYZER_NONNULL = YES; 230 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 231 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; 232 | CLANG_ENABLE_MODULES = YES; 233 | CLANG_ENABLE_OBJC_ARC = YES; 234 | CLANG_ENABLE_OBJC_WEAK = YES; 235 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 236 | CLANG_WARN_BOOL_CONVERSION = YES; 237 | CLANG_WARN_COMMA = YES; 238 | CLANG_WARN_CONSTANT_CONVERSION = YES; 239 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 240 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 241 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 242 | CLANG_WARN_EMPTY_BODY = YES; 243 | CLANG_WARN_ENUM_CONVERSION = YES; 244 | CLANG_WARN_INFINITE_RECURSION = YES; 245 | CLANG_WARN_INT_CONVERSION = YES; 246 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 247 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 248 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 249 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 250 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 251 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 252 | CLANG_WARN_STRICT_PROTOTYPES = YES; 253 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 254 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 255 | CLANG_WARN_UNREACHABLE_CODE = YES; 256 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 257 | COPY_PHASE_STRIP = NO; 258 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 259 | ENABLE_NS_ASSERTIONS = NO; 260 | ENABLE_STRICT_OBJC_MSGSEND = YES; 261 | GCC_C_LANGUAGE_STANDARD = gnu11; 262 | GCC_NO_COMMON_BLOCKS = YES; 263 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 264 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 265 | GCC_WARN_UNDECLARED_SELECTOR = YES; 266 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 267 | GCC_WARN_UNUSED_FUNCTION = YES; 268 | GCC_WARN_UNUSED_VARIABLE = YES; 269 | MACOSX_DEPLOYMENT_TARGET = 12.3; 270 | MTL_ENABLE_DEBUG_INFO = NO; 271 | MTL_FAST_MATH = YES; 272 | SDKROOT = macosx; 273 | SWIFT_COMPILATION_MODE = wholemodule; 274 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 275 | }; 276 | name = Release; 277 | }; 278 | E40F88A128D7796D00084D63 /* Debug */ = { 279 | isa = XCBuildConfiguration; 280 | buildSettings = { 281 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 282 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 283 | CODE_SIGN_ENTITLEMENTS = ObjectCaptureCocoa/ObjectCaptureCocoa.entitlements; 284 | CODE_SIGN_STYLE = Automatic; 285 | COMBINE_HIDPI_IMAGES = YES; 286 | CURRENT_PROJECT_VERSION = 1; 287 | DEVELOPMENT_TEAM = RRW6B7FDKR; 288 | ENABLE_HARDENED_RUNTIME = YES; 289 | GENERATE_INFOPLIST_FILE = YES; 290 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 291 | INFOPLIST_KEY_NSMainStoryboardFile = Main; 292 | INFOPLIST_KEY_NSPrincipalClass = NSApplication; 293 | LD_RUNPATH_SEARCH_PATHS = ( 294 | "$(inherited)", 295 | "@executable_path/../Frameworks", 296 | ); 297 | MARKETING_VERSION = 1.0; 298 | PRODUCT_BUNDLE_IDENTIFIER = com.KaitouCreations.ObjectCaptureCocoa; 299 | PRODUCT_NAME = "$(TARGET_NAME)"; 300 | SWIFT_EMIT_LOC_STRINGS = YES; 301 | SWIFT_VERSION = 5.0; 302 | }; 303 | name = Debug; 304 | }; 305 | E40F88A228D7796D00084D63 /* Release */ = { 306 | isa = XCBuildConfiguration; 307 | buildSettings = { 308 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 309 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 310 | CODE_SIGN_ENTITLEMENTS = ObjectCaptureCocoa/ObjectCaptureCocoa.entitlements; 311 | CODE_SIGN_STYLE = Automatic; 312 | COMBINE_HIDPI_IMAGES = YES; 313 | CURRENT_PROJECT_VERSION = 1; 314 | DEVELOPMENT_TEAM = RRW6B7FDKR; 315 | ENABLE_HARDENED_RUNTIME = YES; 316 | GENERATE_INFOPLIST_FILE = YES; 317 | INFOPLIST_KEY_NSHumanReadableCopyright = ""; 318 | INFOPLIST_KEY_NSMainStoryboardFile = Main; 319 | INFOPLIST_KEY_NSPrincipalClass = NSApplication; 320 | LD_RUNPATH_SEARCH_PATHS = ( 321 | "$(inherited)", 322 | "@executable_path/../Frameworks", 323 | ); 324 | MARKETING_VERSION = 1.0; 325 | PRODUCT_BUNDLE_IDENTIFIER = com.KaitouCreations.ObjectCaptureCocoa; 326 | PRODUCT_NAME = "$(TARGET_NAME)"; 327 | SWIFT_EMIT_LOC_STRINGS = YES; 328 | SWIFT_VERSION = 5.0; 329 | }; 330 | name = Release; 331 | }; 332 | /* End XCBuildConfiguration section */ 333 | 334 | /* Begin XCConfigurationList section */ 335 | E40F888C28D7796C00084D63 /* Build configuration list for PBXProject "ObjectCaptureCocoa" */ = { 336 | isa = XCConfigurationList; 337 | buildConfigurations = ( 338 | E40F889E28D7796D00084D63 /* Debug */, 339 | E40F889F28D7796D00084D63 /* Release */, 340 | ); 341 | defaultConfigurationIsVisible = 0; 342 | defaultConfigurationName = Release; 343 | }; 344 | E40F88A028D7796D00084D63 /* Build configuration list for PBXNativeTarget "ObjectCaptureCocoa" */ = { 345 | isa = XCConfigurationList; 346 | buildConfigurations = ( 347 | E40F88A128D7796D00084D63 /* Debug */, 348 | E40F88A228D7796D00084D63 /* Release */, 349 | ); 350 | defaultConfigurationIsVisible = 0; 351 | defaultConfigurationName = Release; 352 | }; 353 | /* End XCConfigurationList section */ 354 | }; 355 | rootObject = E40F888928D7796C00084D63 /* Project object */; 356 | } 357 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/project.xcworkspace/xcuserdata/saibalaji.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SaiBalaji-PSS/ObjectCapture-App/7d045f1d89f5172ae842884e5af458b8e03bb362/ObjectCaptureCocoa.xcodeproj/project.xcworkspace/xcuserdata/saibalaji.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/xcuserdata/saibalaji.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 21 | 22 | 23 | 25 | 37 | 38 | 39 | 41 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa.xcodeproj/xcuserdata/saibalaji.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ObjectCaptureCocoa.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // ObjectCaptureCocoa 4 | // 5 | // Created by Sai Balaji on 18/09/22. 6 | // 7 | 8 | import Cocoa 9 | 10 | @main 11 | class AppDelegate: NSObject, NSApplicationDelegate { 12 | 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 applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 25 | return true 26 | } 27 | 28 | 29 | } 30 | 31 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "idiom" : "mac", 15 | "scale" : "1x", 16 | "size" : "32x32" 17 | }, 18 | { 19 | "idiom" : "mac", 20 | "scale" : "2x", 21 | "size" : "32x32" 22 | }, 23 | { 24 | "idiom" : "mac", 25 | "scale" : "1x", 26 | "size" : "128x128" 27 | }, 28 | { 29 | "idiom" : "mac", 30 | "scale" : "2x", 31 | "size" : "128x128" 32 | }, 33 | { 34 | "idiom" : "mac", 35 | "scale" : "1x", 36 | "size" : "256x256" 37 | }, 38 | { 39 | "idiom" : "mac", 40 | "scale" : "2x", 41 | "size" : "256x256" 42 | }, 43 | { 44 | "idiom" : "mac", 45 | "scale" : "1x", 46 | "size" : "512x512" 47 | }, 48 | { 49 | "idiom" : "mac", 50 | "scale" : "2x", 51 | "size" : "512x512" 52 | } 53 | ], 54 | "info" : { 55 | "author" : "xcode", 56 | "version" : 1 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/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 | 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 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 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 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | Default 531 | 532 | 533 | 534 | 535 | 536 | 537 | Left to Right 538 | 539 | 540 | 541 | 542 | 543 | 544 | Right to Left 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 553 | 554 | 555 | Default 556 | 557 | 558 | 559 | 560 | 561 | 562 | Left to Right 563 | 564 | 565 | 566 | 567 | 568 | 569 | Right to Left 570 | 571 | 572 | 573 | 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | 614 | 615 | 616 | 617 | 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | 647 | 648 | 649 | 650 | 651 | 652 | 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 674 | 675 | 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 684 | 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 727 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 770 | 771 | 772 | 773 | 774 | 775 | 776 | 777 | 788 | 789 | 790 | 791 | 792 | 793 | 794 | 795 | 796 | 797 | 798 | 799 | 800 | 801 | 802 | 803 | 804 | 805 | 806 | 807 | 808 | 809 | 810 | 811 | 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/ObjectCaptureCocoa.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/Service/ObjectCaptureService.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ObjectCaptureService.swift 3 | // ObjectCaptureCocoa 4 | // 5 | // Created by Sai Balaji on 19/09/22. 6 | // 7 | 8 | import Foundation 9 | import RealityKit 10 | 11 | class ObjectCaptureService{ 12 | static var Shared = ObjectCaptureService() 13 | 14 | func beginScan(inputURL: String,outputURL: String,onCompletion:@escaping(Error?,PhotogrammetrySession?)->(Void)){ 15 | let inputFolderURL = URL(fileURLWithPath: inputURL,isDirectory: true) 16 | let outputURL = URL(fileURLWithPath: outputURL) 17 | 18 | let session = try! PhotogrammetrySession(input: inputFolderURL, configuration: PhotogrammetrySession.Configuration()) 19 | let request = PhotogrammetrySession.Request.modelFile(url: outputURL, detail: .medium) 20 | do{ 21 | try session.process(requests: [request]) 22 | onCompletion(nil,session) 23 | } 24 | catch{ 25 | onCompletion(error,nil) 26 | } 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ObjectCaptureCocoa/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // ObjectCaptureCocoa 4 | // 5 | // Created by Sai Balaji on 18/09/22. 6 | // 7 | 8 | import Cocoa 9 | import RealityKit 10 | import SceneKit 11 | 12 | class ViewController: NSViewController { 13 | 14 | @IBOutlet weak var sceneView: SCNView! 15 | @IBOutlet weak var StatusLabel: NSTextField! 16 | @IBOutlet weak var PreviewImageView: NSImageView! 17 | @IBOutlet weak var ProgressBar: NSProgressIndicator! 18 | private var FilePath = [String]() 19 | private var PreviewTimer: Timer? 20 | private var InputURL: String = "" 21 | private var OutputURL: String? 22 | private var OutputFilePath: String = "" 23 | private var Model: SCNScene? 24 | 25 | override func viewDidLoad() { 26 | super.viewDidLoad() 27 | 28 | // Do any additional setup after loading the view. 29 | ProgressBar.isIndeterminate = false 30 | 31 | 32 | } 33 | 34 | override var representedObject: Any? { 35 | didSet { 36 | // Update the view, if already loaded. 37 | } 38 | } 39 | //MARK: - PICK IMAGE 40 | @IBAction func pickBtnPressed(_ sender: Any) { 41 | print("Pick") 42 | let dialog = NSOpenPanel() 43 | dialog.title = "Pick an image" 44 | dialog.showsResizeIndicator = true 45 | 46 | dialog.canChooseDirectories = true 47 | if(dialog.runModal() == NSApplication.ModalResponse.OK){ 48 | 49 | self.InputURL = dialog.directoryURL!.path 50 | print(InputURL) 51 | } 52 | } 53 | 54 | 55 | 56 | @IBAction func outputLocationBtnPressed(_ sender: Any) { 57 | let dialog = NSOpenPanel() 58 | dialog.title = "Set the output location" 59 | dialog.showsResizeIndicator = true 60 | dialog.canChooseDirectories = true 61 | if(dialog.runModal() == NSApplication.ModalResponse.OK){ 62 | OutputURL = dialog.directoryURL!.path 63 | //print(OutputURL) 64 | } 65 | 66 | } 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | //MARK: - SCAN IMAGE 76 | @IBAction func scanBtnPressed(_ sender: Any) { 77 | 78 | let fm = try! FileManager.default.contentsOfDirectory(atPath: InputURL) 79 | for i in fm{ 80 | self.FilePath.append(InputURL + "/" + i) 81 | } 82 | 83 | guard let OutputURL = OutputURL else { 84 | return 85 | } 86 | 87 | OutputFilePath = OutputURL + "/" + "\(UUID().uuidString).usdz" 88 | 89 | ObjectCaptureService.Shared.beginScan(inputURL: InputURL, outputURL: OutputFilePath) { error, session in 90 | if let error = error { 91 | print(error) 92 | } 93 | if let session = session { 94 | 95 | do{ 96 | 97 | _ = Task.init { 98 | do{ 99 | for try await output in session.outputs{ 100 | switch output{ 101 | case .processingComplete: 102 | print("All requests Complete") 103 | self.StatusLabel.stringValue = "Processing Complete" 104 | // print(self.FilePath.first) 105 | self.PreviewTimer?.invalidate() 106 | self.load3DPreview() 107 | break 108 | case .inputComplete: 109 | print("Input complelte") 110 | self.StatusLabel.stringValue = "Input Processing Complete" 111 | self.PreviewTimer = Timer.scheduledTimer(timeInterval: 1.0, target: self, selector: #selector(self.showImageSlideShow), userInfo: self, repeats: true) 112 | break 113 | 114 | case .processingCancelled: 115 | print("Processing cancelled") 116 | 117 | break 118 | 119 | case .requestProgress(_, fractionComplete: let fraction): 120 | print("Progress\(fraction * 100)") 121 | self.ProgressBar.doubleValue = fraction * 100 122 | self.StatusLabel.stringValue = "Processing..." 123 | break 124 | 125 | 126 | 127 | default: 128 | print("Default") 129 | 130 | } 131 | } 132 | 133 | 134 | 135 | 136 | } 137 | 138 | catch{ 139 | print("Error \(error.localizedDescription)") 140 | } 141 | } 142 | } 143 | 144 | } 145 | } 146 | 147 | 148 | 149 | } 150 | 151 | @objc func showImageSlideShow(){ 152 | if let randomImagePath = FilePath.randomElement(){ 153 | PreviewImageView.image = NSImage(byReferencingFile: randomImagePath) 154 | } 155 | 156 | } 157 | 158 | 159 | 160 | 161 | 162 | 163 | @IBAction func stopBtnPressed(_ sender: Any) { 164 | 165 | if let Model = Model { 166 | Model.rootNode.removeAllActions() 167 | } 168 | } 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | } 179 | 180 | 181 | extension ViewController{ 182 | func load3DPreview(){ 183 | 184 | 185 | Model = try! SCNScene(url:URL(string: OutputFilePath)!) 186 | 187 | Model!.rootNode.runAction((SCNAction.repeatForever(SCNAction.rotate(by: 0.5, around: SCNVector3(x: 0, y: 1, z: 0), duration: 1.0)))) 188 | 189 | 190 | 191 | sceneView.allowsCameraControl = true 192 | 193 | let lightNode = SCNNode() 194 | lightNode.light = SCNLight() 195 | lightNode.light?.type = .ambient 196 | lightNode.position = SCNVector3(x: 0, y: 10, z: 20) 197 | Model!.rootNode.addChildNode(lightNode) 198 | sceneView.scene = Model 199 | } 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | } 221 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ObjectCapture-App 2 | ![ezgif com-gif-maker (4)](https://user-images.githubusercontent.com/51410810/191278394-efdb31a4-cce0-4184-a8d0-faac0c486f3a.gif) 3 | 4 | A MacOS app built using Swift, Appkit, RealityKit Object capture which 5 | uses a series of 2D images to construct a 3D Mesh with textures, 6 | lighting. The app has built-in model viewer which uses Scenekit with metal to render the preview of the generated 3D Model. 7 | --------------------------------------------------------------------------------