├── .gitignore ├── Examples ├── objective-c │ ├── TCMaskBlendExample │ │ ├── Podfile │ │ ├── TCMaskBlendExample.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── TCMaskBlendExample │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── ViewController.h │ │ │ ├── ViewController.m │ │ │ └── main.m │ ├── TCMaskCustomization │ │ ├── Podfile │ │ ├── TCMaskCustomization.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── TCMaskCustomization │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Balloon.JPEG │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ ├── ViewController.h │ │ │ ├── ViewController.m │ │ │ └── main.m │ ├── TCMaskNavigationView │ │ ├── Podfile │ │ ├── TCMaskNavigationView.xcodeproj │ │ │ ├── project.pbxproj │ │ │ └── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── TCMaskNavigationView │ │ │ ├── AppDelegate.h │ │ │ ├── AppDelegate.m │ │ │ ├── Assets.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── ConfirmViewController.h │ │ │ ├── ConfirmViewController.m │ │ │ ├── Info.plist │ │ │ ├── MainViewController.h │ │ │ ├── MainViewController.m │ │ │ └── main.m │ └── TCMaskPopView │ │ ├── Podfile │ │ ├── TCMaskPopView.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── TCMaskPopView │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Balloon.JPEG │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m └── swift │ ├── TCMaskBlendExample │ ├── Podfile │ ├── TCMaskBlendExample.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── TCMaskBlendExample.xcscmblueprint │ └── TCMaskBlendExample │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── ViewController.swift │ ├── TCMaskCustomization │ ├── Podfile │ ├── TCMaskCustomization.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── TCMaskCustomization │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Balloon.JPEG │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── ViewController.swift │ ├── TCMaskNavigationView │ ├── Podfile │ ├── TCMaskNavigationView.xcodeproj │ │ ├── project.pbxproj │ │ └── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── TCMaskNavigationView │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── ConfirmViewController.swift │ │ ├── Info.plist │ │ └── MainViewController.swift │ └── TCMaskPopView │ ├── Podfile │ ├── TCMaskPopView.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── TCMaskPopView.xcscmblueprint │ └── TCMaskPopView │ ├── AppDelegate.swift │ ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json │ ├── Balloon.JPEG │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Info.plist │ └── ViewController.swift ├── LICENSE ├── README.md ├── TCCore ├── FGCGraph.cpp ├── FGCGraph.hpp ├── FGMM.cpp ├── FGMM.hpp ├── GlobalMatting.cpp ├── GlobalMatting.hpp ├── GuidedFilter.cpp ├── GuidedFilter.hpp ├── Info.plist ├── KCenterClustering.cpp ├── KCenterClustering.hpp ├── PaintSelect.cpp ├── PaintSelect.hpp ├── QuickGraphCut.cpp ├── QuickGraphCut.hpp ├── TCCore.h ├── TCCoreLibs.h ├── TCCoreLibs0.h ├── TCCoreWrapper.h ├── TCCoreWrapper.mm ├── improc.cpp ├── improc.hpp └── precomp.hpp ├── TCMask ├── Assets.xcassets │ ├── Contents.json │ ├── add.imageset │ │ ├── Contents.json │ │ ├── add.png │ │ ├── add@2x.png │ │ └── add@3x.png │ ├── arrow_up_white.imageset │ │ ├── Contents.json │ │ ├── ic_keyboard_arrow_up_white.png │ │ ├── ic_keyboard_arrow_up_white_2x.png │ │ └── ic_keyboard_arrow_up_white_3x.png │ ├── brush.imageset │ │ ├── Contents.json │ │ ├── brush.png │ │ ├── brush@2x.png │ │ └── brush@3x.png │ ├── check.imageset │ │ ├── Contents.json │ │ ├── ic_done_white.png │ │ ├── ic_done_white_2x.png │ │ └── ic_done_white_3x.png │ ├── clear.imageset │ │ ├── Contents.json │ │ ├── ic_clear_white.png │ │ ├── ic_clear_white_2x.png │ │ └── ic_clear_white_3x.png │ ├── done.imageset │ │ ├── Contents.json │ │ ├── ic_done_white.png │ │ ├── ic_done_white_2x.png │ │ └── ic_done_white_3x.png │ ├── eraser.imageset │ │ ├── Contents.json │ │ ├── eraserwhite.png │ │ ├── eraserwhite@2x.png │ │ └── eraserwhite@3x.png │ ├── eyeblack.imageset │ │ ├── Contents.json │ │ ├── eyeblack.png │ │ ├── eyeblack@2x.png │ │ └── eyeblack@3x.png │ ├── eyewhite.imageset │ │ ├── Contents.json │ │ ├── eye.png │ │ ├── eye@2x.png │ │ └── eye@3x.png │ ├── gesture_pinch.imageset │ │ ├── Contents.json │ │ ├── gesture_pinch.png │ │ ├── gesture_pinch@2x.png │ │ └── gesture_pinch@3x.png │ ├── gesture_tap.imageset │ │ ├── Contents.json │ │ ├── gesture_tap.png │ │ ├── gesture_tap@2x.png │ │ └── gesture_tap@3x.png │ ├── gesture_twofingertap.imageset │ │ ├── Contents.json │ │ ├── gesture_twofingertap.png │ │ ├── gesture_twofingertap@2x.png │ │ └── gesture_twofingertap@3x.png │ ├── hairbrush.imageset │ │ ├── Contents.json │ │ ├── hairbrush.png │ │ ├── hairbrush@2x.png │ │ └── hairbrush@3x.png │ ├── help.imageset │ │ ├── Contents.json │ │ ├── ic_help_outline_white.png │ │ ├── ic_help_outline_white_2x.png │ │ └── ic_help_outline_white_3x.png │ ├── invert.imageset │ │ ├── Contents.json │ │ ├── invert.png │ │ ├── invert@2x.png │ │ └── invert@3x.png │ ├── next.imageset │ │ ├── Contents.json │ │ ├── ic_arrow_forward_white.png │ │ ├── ic_arrow_forward_white_2x.png │ │ └── ic_arrow_forward_white_3x.png │ ├── pointer.imageset │ │ ├── Contents.json │ │ ├── pointerwhite.png │ │ ├── pointerwhite@2x.png │ │ └── pointerwhite@3x.png │ ├── quickselect.imageset │ │ ├── Contents.json │ │ ├── quickselect.png │ │ ├── quickselect@2x.png │ │ └── quickselect@3x.png │ ├── redo.imageset │ │ ├── Contents.json │ │ ├── forward.png │ │ ├── forward@2x.png │ │ └── forward@3x.png │ ├── remove.imageset │ │ ├── Contents.json │ │ ├── ic_remove_white.png │ │ ├── ic_remove_white_2x.png │ │ └── ic_remove_white_3x.png │ ├── settings.imageset │ │ ├── Contents.json │ │ ├── setting.png │ │ ├── setting@2x.png │ │ └── setting@3x.png │ ├── subtract.imageset │ │ ├── Contents.json │ │ ├── subtract.png │ │ ├── subtract@2x.png │ │ └── subtract@3x.png │ ├── triangle.imageset │ │ ├── Contents.json │ │ ├── triangle.png │ │ ├── triangle@2x.png │ │ └── triangle@3x.png │ ├── triangle_top.imageset │ │ ├── Contents.json │ │ ├── triangle_top.png │ │ ├── triangle_top@2x.png │ │ └── triangle_top@3x.png │ └── undo.imageset │ │ ├── Contents.json │ │ ├── return.png │ │ ├── return@2x.png │ │ └── return@3x.png ├── Base.lproj │ └── MaskViewController.xib ├── BrushLog.swift ├── BrushTool.swift ├── CanvasView.swift ├── CircleView.swift ├── Extensions.swift ├── HairBrushLog.swift ├── HairBrushTool.swift ├── ImageScrollView.swift ├── Info.plist ├── MaskView.swift ├── MaskViewController.swift ├── MaskViewWizard.swift ├── QuickSelectLog.swift ├── QuickSelectTool.swift ├── TCMask.swift ├── TCMaskTool.swift ├── TCMaskView.swift ├── TCMaskViewDelegate.swift ├── TCMaskViewMode.swift ├── TCMaskViewState.swift ├── TCUIView.swift ├── Tool.swift ├── ToolBarItem.swift ├── ToolLog.swift ├── ToolManager.swift ├── ToolMenuItem.swift ├── UILockableView.swift ├── Utils.swift ├── WebViewController.swift ├── WebViewController.xib └── en.lproj │ └── MaskViewController.strings ├── TinyCrayon.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist └── xcshareddata │ └── xcschemes │ ├── TCCore.xcscheme │ └── TCMask.xcscheme └── docs ├── FAQ-android.html ├── FAQ-iOS.html ├── android-coming-soon.html ├── contact-support.html ├── css ├── bootstrap-theme.min.css ├── bootstrap.min.css ├── highlight.css ├── iconfont.css ├── iconfont.ttf ├── iconfont.woff ├── index.css └── jazzy.css ├── docs-iOS ├── Classes.html ├── Classes │ ├── TCMask.html │ ├── TCMaskView.html │ ├── TCMaskViewMode.html │ └── TCUIView.html ├── Enums.html ├── Enums │ └── TCMaskTool.html ├── Protocols.html ├── Protocols │ └── TCMaskViewDelegate.html └── index.html ├── favicons ├── android-chrome-192x192.png ├── apple-touch-icon.png ├── browserconfig.xml ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── manifest.json ├── mstile-150x150.png └── safari-pinned-tab.svg ├── guides-iOS ├── customization.html ├── get-started.html ├── submit-to-app-store.html └── work-with-layer-mask.html ├── img ├── HairBrush_xs.gif ├── IDFA.png ├── IDFA_details.png ├── QuickSelect_xs.gif ├── android_active.png ├── android_gray.png ├── balloon_cutout_sm.png ├── balloon_gray.jpg ├── balloon_gray_sm.jpg ├── balloon_mask_sm.jpg ├── balloon_sketch.jpg ├── balloon_sketch_sm.jpg ├── balloon_sm.jpg ├── banner_lg.png ├── banner_md.png ├── banner_sm.png ├── banner_xs.png ├── build_and_run_sm.png ├── carat.png ├── customize_ui_style.png ├── customize_ui_style_sm.png ├── customized_view_mode.png ├── dark_theme_settings_sm.png ├── dark_theme_sm.png ├── embed_swift.png ├── embed_swift_sm.png ├── eyeblack@3x.png ├── framework_final.png ├── framework_final_sm.png ├── iPhone6_gray.png ├── iPhone6_silver.png ├── ios_active.png ├── ios_gray.png ├── sc_add_embedded_binaries.jpg ├── sc_add_embedded_binaries_sm.png ├── sc_add_files_sm.png ├── sc_add_frameworks_sm.png ├── sc_add_tcmask_sm.png ├── viewmode1.png ├── viewmode2.png └── viewmode3.png ├── index.html ├── js ├── bootstrap.min.js ├── index.js ├── jazzy.js ├── jquery.min.js └── log.js ├── license.html ├── log.html ├── pricing.html ├── privacy-policy.html └── terms-of-use.html /.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 | TCCore/opencv2.framework/ 9 | 10 | ## Various settings 11 | *.pbxuser 12 | !default.pbxuser 13 | *.mode1v3 14 | !default.mode1v3 15 | *.mode2v3 16 | !default.mode2v3 17 | *.perspectivev3 18 | !default.perspectivev3 19 | xcuserdata/ 20 | 21 | ## Other 22 | *.moved-aside 23 | *.xcuserstate 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | ## Playgrounds 32 | timeline.xctimeline 33 | playground.xcworkspace 34 | 35 | # Swift Package Manager 36 | # 37 | # Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. 38 | # Packages/ 39 | .build/ 40 | 41 | # CocoaPods 42 | # 43 | # We recommend against adding the Pods directory to your .gitignore. However 44 | # you should judge for yourself, the pros and cons are mentioned at: 45 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 46 | # 47 | # Pods/ 48 | 49 | # Carthage 50 | # 51 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 52 | # Carthage/Checkouts 53 | 54 | Carthage/Build 55 | 56 | # fastlane 57 | # 58 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 59 | # screenshots whenever they are needed. 60 | # For more information about the recommended setup visit: 61 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 62 | 63 | fastlane/report.xml 64 | fastlane/Preview.html 65 | fastlane/screenshots 66 | fastlane/test_output 67 | 68 | .DS_Store 69 | *.zip 70 | #*# 71 | #.gitignore# 72 | zip.sh -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/Podfile: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | source 'https://github.com/CocoaPods/Specs.git' 3 | 4 | platform :ios, '10.0' 5 | use_frameworks! 6 | 7 | target 'TCMaskBlendExample' do 8 | pod 'TinyCrayon' 9 | end 10 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | @interface AppDelegate : UIResponder 28 | 29 | @property (strong, nonatomic) UIWindow *window; 30 | 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import "AppDelegate.h" 26 | 27 | @interface AppDelegate () 28 | 29 | @end 30 | 31 | @implementation AppDelegate 32 | 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 35 | // Override point for customization after application launch. 36 | return YES; 37 | } 38 | 39 | 40 | - (void)applicationWillResignActive:(UIApplication *)application { 41 | // 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. 42 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 43 | } 44 | 45 | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application { 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application { 58 | // 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. 59 | } 60 | 61 | 62 | - (void)applicationWillTerminate:(UIApplication *)application { 63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/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 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | @import TCMask; 27 | 28 | @interface ViewController : UIViewController { 29 | 30 | __weak IBOutlet UIView *containerView; 31 | __weak IBOutlet UIImageView *imageView; 32 | __weak IBOutlet UIView *buttonGroup; 33 | 34 | UIImagePickerController *imagePicker; 35 | UIImage *image; 36 | TCMask *mask; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskBlendExample/TCMaskBlendExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TCMaskBlendExample 4 | // 5 | // Created by Xin Zeng on 2/13/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskCustomization' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | @interface AppDelegate : UIResponder 28 | 29 | @property (strong, nonatomic) UIWindow *window; 30 | 31 | @end 32 | 33 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import "AppDelegate.h" 26 | 27 | @interface AppDelegate () 28 | 29 | @end 30 | 31 | @implementation AppDelegate 32 | 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 35 | // Override point for customization after application launch. 36 | return YES; 37 | } 38 | 39 | 40 | - (void)applicationWillResignActive:(UIApplication *)application { 41 | // 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. 42 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 43 | } 44 | 45 | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application { 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application { 58 | // 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. 59 | } 60 | 61 | 62 | - (void)applicationWillTerminate:(UIApplication *)application { 63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/Balloon.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/Examples/objective-c/TCMaskCustomization/TCMaskCustomization/Balloon.JPEG -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/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 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | @import TCMask; 27 | 28 | @interface ViewController : UIViewController { 29 | __weak IBOutlet UIImageView *imageView; 30 | } 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskCustomization/TCMaskCustomization/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TCMaskCustomization 4 | // 5 | // Created by Xin Zeng on 2/13/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskNavigationView' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | @interface AppDelegate : UIResponder 28 | 29 | @property (strong, nonatomic) UIWindow *window; 30 | 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import "AppDelegate.h" 26 | 27 | @interface AppDelegate () 28 | 29 | @end 30 | 31 | @implementation AppDelegate 32 | 33 | 34 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 35 | // Override point for customization after application launch. 36 | return YES; 37 | } 38 | 39 | 40 | - (void)applicationWillResignActive:(UIApplication *)application { 41 | // 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. 42 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 43 | } 44 | 45 | 46 | - (void)applicationDidEnterBackground:(UIApplication *)application { 47 | // 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. 48 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 49 | } 50 | 51 | 52 | - (void)applicationWillEnterForeground:(UIApplication *)application { 53 | // 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. 54 | } 55 | 56 | 57 | - (void)applicationDidBecomeActive:(UIApplication *)application { 58 | // 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. 59 | } 60 | 61 | 62 | - (void)applicationWillTerminate:(UIApplication *)application { 63 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 64 | } 65 | 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/ConfirmViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | 27 | @interface ConfirmViewController : UIViewController { 28 | __weak IBOutlet UIView *containerView; 29 | __weak IBOutlet UIImageView *imageView; 30 | } 31 | 32 | @property(readwrite, nonatomic) UIImage* image; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/ConfirmViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import "ConfirmViewController.h" 26 | 27 | @interface ConfirmViewController () 28 | 29 | @end 30 | 31 | @implementation ConfirmViewController 32 | 33 | - (void)viewDidLoad { 34 | [super viewDidLoad]; 35 | imageView.image = _image; 36 | CGFloat x, y, width, height; 37 | if (_image.size.width > _image.size.height) { 38 | width = containerView.frame.size.width; 39 | height = width * _image.size.height / _image.size.width; 40 | x = 0; 41 | y = (containerView.frame.size.height - height) / 2; 42 | } 43 | else { 44 | height = containerView.frame.size.height; 45 | width = height * _image.size.width / _image.size.height; 46 | x = (containerView.frame.size.width - width) / 2; 47 | y = 0; 48 | } 49 | imageView.frame = CGRectMake(x, y, width, height); 50 | } 51 | 52 | - (IBAction)doneButtonTapped:(id)sender { 53 | [self.navigationController popToRootViewControllerAnimated:true]; 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPhotoLibraryUsageDescription 6 | edit photo 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/MainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import 26 | @import TCMask; 27 | 28 | @interface MainViewController : UIViewController { 29 | UIImagePickerController *imagePicker; 30 | } 31 | 32 | @end 33 | 34 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/MainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | #import "MainViewController.h" 26 | #import "ConfirmViewController.h" 27 | @import TCMask; 28 | 29 | @interface MainViewController () 30 | 31 | @end 32 | 33 | @implementation MainViewController 34 | 35 | - (void)viewDidLoad { 36 | [super viewDidLoad]; 37 | imagePicker = [[UIImagePickerController alloc] init]; 38 | } 39 | 40 | - (IBAction)selectImageButtonTapped:(id)sender { 41 | imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; 42 | imagePicker.delegate = self; 43 | [self presentViewController:imagePicker animated:true completion:nil]; 44 | } 45 | 46 | - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { 47 | UIImage *image = info[UIImagePickerControllerOriginalImage]; 48 | [imagePicker dismissViewControllerAnimated:false completion:nil]; 49 | 50 | TCMaskView *maskView = [[TCMaskView alloc] initWithImage:image]; 51 | maskView.delegate = self; 52 | [maskView presentFromNavigationController:self.navigationController animated:true]; 53 | } 54 | 55 | - (UIViewController *)tcMaskViewWillPushViewControllerWithMask:(TCMask *)mask image:(UIImage *)image { 56 | UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil]; 57 | ConfirmViewController *controller = [storyBoard instantiateViewControllerWithIdentifier:@"confirmViewController"]; 58 | controller.image = [mask cutoutWithImage:image resize:true]; 59 | return controller; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskNavigationView/TCMaskNavigationView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TCMaskNavigationView 4 | // 5 | // Created by Xin Zeng on 2/13/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskPopView' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TCMaskPopView 4 | // 5 | // Created by Xin Zeng on 2/7/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TCMaskPopView 4 | // 5 | // Created by Xin Zeng on 2/7/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/Balloon.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/Examples/objective-c/TCMaskPopView/TCMaskPopView/Balloon.JPEG -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/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 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/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 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TCMaskPopView 4 | // 5 | // Created by Xin Zeng on 2/7/17. 6 | // Copyright © 2017 TinyCrayon. All rights reserved. 7 | // 8 | 9 | @import TCMask; 10 | #import 11 | 12 | @interface ViewController : UIViewController 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TCMaskPopView 4 | // 5 | // Created by Xin Zeng on 2/7/17. 6 | // Copyright © 2017 TinyCrayon. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | @import TCMask; 11 | 12 | @interface ViewController () 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageView; 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | } 23 | 24 | - (void)didReceiveMemoryWarning { 25 | [super didReceiveMemoryWarning]; 26 | // Dispose of any resources that can be recreated. 27 | } 28 | 29 | - (void)viewDidAppear:(BOOL)animated { 30 | [super viewDidAppear:animated]; 31 | if (_imageView.image == nil) { 32 | [self presentTCMaskView]; 33 | } 34 | } 35 | 36 | - (IBAction)editButtonTapped:(id)sender { 37 | [self presentTCMaskView]; 38 | } 39 | 40 | - (void)presentTCMaskView { 41 | UIImage *image = [UIImage imageNamed:@"Balloon.JPEG"]; 42 | TCMaskView *maskView = [[TCMaskView alloc] initWithImage:image]; 43 | maskView.delegate = self; 44 | [maskView presentFromRootViewController:self animated:true]; 45 | } 46 | 47 | - (void)tcMaskViewDidCompleteWithMask:(TCMask *)mask image:(UIImage *)image { 48 | _imageView.image = [mask cutoutWithImage:image resize:true]; 49 | } 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Examples/objective-c/TCMaskPopView/TCMaskPopView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TCMaskPopView 4 | // 5 | // Created by Xin Zeng on 2/7/17. 6 | // Copyright © 2017 TinyCrayon. 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 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskBlendExample' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample.xcodeproj/project.xcworkspace/xcshareddata/TCMaskBlendExample.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "92E0369D29B7F7796C2B802F00656CEBC4C11D77" : 9223372036854775807, 8 | "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" : 9223372036854775807, 9 | "5D611B4BA646F60700747FAA43A8E77D2570FB89" : 9223372036854775807 10 | }, 11 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "0E9C2E62-48F7-4128-90FA-0DB9B9262983", 12 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 13 | "92E0369D29B7F7796C2B802F00656CEBC4C11D77" : "TCMask-iOS\/", 14 | "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" : "TCMask-iOS-Examples\/", 15 | "5D611B4BA646F60700747FAA43A8E77D2570FB89" : "TCCore-iOS\/" 16 | }, 17 | "DVTSourceControlWorkspaceBlueprintNameKey" : "TCMaskBlendExample", 18 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 19 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "swift\/TCMaskBlendExample\/TCMaskBlendExample.xcodeproj", 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 21 | { 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:TinyCrayon\/TCMask-iOS-Examples.git", 23 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 24 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" 25 | }, 26 | { 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:TinyCrayon\/TCCore-iOS.git", 28 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 29 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "5D611B4BA646F60700747FAA43A8E77D2570FB89" 30 | }, 31 | { 32 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:TinyCrayon\/TCMask-iOS.git", 33 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 34 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "92E0369D29B7F7796C2B802F00656CEBC4C11D77" 35 | } 36 | ] 37 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | import UIKit 26 | 27 | @UIApplicationMain 28 | class AppDelegate: UIResponder, UIApplicationDelegate { 29 | 30 | var window: UIWindow? 31 | 32 | 33 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 34 | // Override point for customization after application launch. 35 | return true 36 | } 37 | 38 | func applicationWillResignActive(_ application: UIApplication) { 39 | // 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. 40 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 41 | } 42 | 43 | func applicationDidEnterBackground(_ application: UIApplication) { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | func applicationWillEnterForeground(_ application: UIApplication) { 49 | // 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. 50 | } 51 | 52 | func applicationDidBecomeActive(_ application: UIApplication) { 53 | // 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. 54 | } 55 | 56 | func applicationWillTerminate(_ application: UIApplication) { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample/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 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskBlendExample/TCMaskBlendExample/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPhotoLibraryUsageDescription 6 | edit photo 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskCustomization' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization/Balloon.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/Examples/swift/TCMaskCustomization/TCMaskCustomization/Balloon.JPEG -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization/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 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskCustomization/TCMaskCustomization/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 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskNavigationView' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView/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 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView/ConfirmViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | import UIKit 26 | 27 | class ConfirmViewController : UIViewController { 28 | 29 | @IBOutlet weak var containerView: UIView! 30 | @IBOutlet weak var imageView: UIImageView! 31 | var image: UIImage! 32 | 33 | override func viewDidLoad() { 34 | imageView.image = image 35 | 36 | // reset imageView's frame to put it in the center 37 | var x:CGFloat, y:CGFloat, width:CGFloat, height:CGFloat 38 | if (image.size.width > image.size.height) { 39 | width = containerView.frame.width 40 | height = width * image.size.height / image.size.width 41 | x = 0 42 | y = (containerView.frame.height - height) / 2 43 | } 44 | else { 45 | height = containerView.frame.height 46 | width = height * image.size.width / image.size.height 47 | x = (containerView.frame.width - width) / 2 48 | y = 0 49 | } 50 | imageView.frame = CGRect(x: x, y: y, width: width, height: height) 51 | } 52 | 53 | @IBAction func doneButtonTapped(_ sender: Any) { 54 | _ = self.navigationController?.popToRootViewController(animated: true) 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView/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 | NSPhotoLibraryUsageDescription 24 | edit photo 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskNavigationView/TCMaskNavigationView/MainViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | import UIKit 26 | import TCMask 27 | 28 | class MainViewController : UIViewController, UIImagePickerControllerDelegate, UINavigationControllerDelegate, TCMaskViewDelegate { 29 | 30 | let imagePicker = UIImagePickerController() 31 | 32 | @IBAction func selectImageButtonTapped(_ sender: Any) { 33 | imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary 34 | imagePicker.delegate = self 35 | self.present(imagePicker, animated: true, completion: nil) 36 | } 37 | 38 | func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { 39 | let image = info[UIImagePickerControllerOriginalImage] as! UIImage 40 | self.imagePicker.dismiss(animated: false, completion: {}) 41 | 42 | let maskView = TCMaskView(image: image) 43 | maskView.delegate = self 44 | maskView.presentFrom(navigationController: self.navigationController!, animated: true) 45 | } 46 | 47 | func tcMaskViewWillPushViewController(mask: TCMask, image: UIImage) -> UIViewController! { 48 | let storyboard = UIStoryboard(name: "Main", bundle: nil) 49 | let controller = storyboard.instantiateViewController(withIdentifier: "confirmViewController") as! ConfirmViewController 50 | 51 | controller.image = mask.cutout(image: image, resize: true) 52 | return controller 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/Podfile: -------------------------------------------------------------------------------- 1 | source 'https://github.com/CocoaPods/Specs.git' 2 | 3 | platform :ios, '10.0' 4 | use_frameworks! 5 | 6 | target 'TCMaskPopView' do 7 | pod 'TinyCrayon' 8 | end 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView.xcodeproj/project.xcworkspace/xcshareddata/TCMaskPopView.xcscmblueprint: -------------------------------------------------------------------------------- 1 | { 2 | "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E", 3 | "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { 4 | 5 | }, 6 | "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { 7 | "55902D36313B8085CBD4C332A2A95BF55AD92903" : 9223372036854775807, 8 | "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" : 9223372036854775807 9 | }, 10 | "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "DB9AF9AB-D5CC-4E80-8339-830A9AE92712", 11 | "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { 12 | "55902D36313B8085CBD4C332A2A95BF55AD92903" : "TinyCrayon\/", 13 | "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" : "TCMask-iOS-Examples\/" 14 | }, 15 | "DVTSourceControlWorkspaceBlueprintNameKey" : "TCMaskPopView", 16 | "DVTSourceControlWorkspaceBlueprintVersion" : 204, 17 | "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "swift\/TCMaskPopView\/TCMaskPopView.xcodeproj", 18 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ 19 | { 20 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:TinyCrayon\/TCMask-iOS-Examples.git", 21 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 22 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "4CB2ABD2473AC28E8BB8A99897752DD3F1728F2E" 23 | }, 24 | { 25 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:zengxinzhy\/TinyCrayon.git", 26 | "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", 27 | "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "55902D36313B8085CBD4C332A2A95BF55AD92903" 28 | } 29 | ] 30 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | import UIKit 26 | 27 | @UIApplicationMain 28 | class AppDelegate: UIResponder, UIApplicationDelegate { 29 | 30 | var window: UIWindow? 31 | 32 | 33 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 34 | // Override point for customization after application launch. 35 | return true 36 | } 37 | 38 | func applicationWillResignActive(_ application: UIApplication) { 39 | // 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. 40 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 41 | } 42 | 43 | func applicationDidEnterBackground(_ application: UIApplication) { 44 | // 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. 45 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 46 | } 47 | 48 | func applicationWillEnterForeground(_ application: UIApplication) { 49 | // 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. 50 | } 51 | 52 | func applicationDidBecomeActive(_ application: UIApplication) { 53 | // 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. 54 | } 55 | 56 | func applicationWillTerminate(_ application: UIApplication) { 57 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 58 | } 59 | 60 | 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/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 | "info" : { 45 | "version" : 1, 46 | "author" : "xcode" 47 | } 48 | } -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/Balloon.JPEG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/Examples/swift/TCMaskPopView/TCMaskPopView/Balloon.JPEG -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/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 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/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 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /Examples/swift/TCMaskPopView/TCMaskPopView/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // The MIT License 3 | // 4 | // Copyright (C) 2016 TinyCrayon. 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy 7 | // of this software and associated documentation files (the "Software"), to 8 | // deal in the Software without restriction, including without limitation the 9 | // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10 | // sell copies of the Software, and to permit persons to whom the Software is 11 | // furnished to do so, subject to the following conditions: 12 | // 13 | // The above copyright notice and this permission notice shall be included in 14 | // all copies or substantial portions of the Software. 15 | // 16 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22 | // IN THE SOFTWARE. 23 | // 24 | 25 | import UIKit 26 | import TCMask 27 | 28 | class ViewController: UIViewController, TCMaskViewDelegate { 29 | 30 | @IBOutlet weak var imageView: UIImageView! 31 | 32 | override func viewDidLoad() { 33 | super.viewDidLoad() 34 | // Do any additional setup after loading the view, typically from a nib. 35 | } 36 | 37 | override func didReceiveMemoryWarning() { 38 | super.didReceiveMemoryWarning() 39 | // Dispose of any resources that can be recreated. 40 | } 41 | 42 | override func viewDidAppear(_ animated: Bool) { 43 | if (imageView.image == nil) { 44 | presentTCMaskView() 45 | } 46 | } 47 | 48 | @IBAction func editButtonTapped(_ sender: Any) { 49 | presentTCMaskView() 50 | } 51 | 52 | func presentTCMaskView() { 53 | let image = UIImage(named: "Balloon.JPEG")! 54 | let maskView = TCMaskView(image: image) 55 | maskView.delegate = self 56 | maskView.presentFrom(rootViewController: self, animated: true) 57 | } 58 | 59 | func tcMaskViewDidComplete(mask: TCMask, image: UIImage) { 60 | imageView.image = mask.cutout(image: image, resize: true) 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2017 TinyCrayon 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 | -------------------------------------------------------------------------------- /TCCore/FGCGraph.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // FGCGraph.hpp 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 11/15/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef FGCGraph_hpp 10 | #define FGCGraph_hpp 11 | 12 | #import 13 | #include 14 | 15 | template class FGCGraph 16 | { 17 | public: 18 | FGCGraph(); 19 | FGCGraph( unsigned int vtxCount, unsigned int edgeCount ); 20 | ~FGCGraph(); 21 | void create( unsigned int vtxCount, unsigned int edgeCount ); 22 | int addVtx(); 23 | void addEdges( int i, int j, TWeight w, TWeight revw ); 24 | void addTermWeights( int i, TWeight sourceW, TWeight sinkW ); 25 | TWeight maxFlow(); 26 | bool inSourceSegment( int i ); 27 | private: 28 | class Vtx 29 | { 30 | public: 31 | Vtx *next; // initialized and used in maxFlow() only 32 | int parent; 33 | int first; 34 | int ts; 35 | int dist; 36 | TWeight weight; 37 | uchar t; 38 | }; 39 | class Edge 40 | { 41 | public: 42 | int dst; 43 | int next; 44 | TWeight weight; 45 | }; 46 | 47 | std::vector vtcs; 48 | std::vector edges; 49 | TWeight flow; 50 | }; 51 | 52 | #endif /* FGCGraph_hpp */ 53 | -------------------------------------------------------------------------------- /TCCore/FGMM.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // FGMM.hpp 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 11/15/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef FGMM_hpp 10 | #define FGMM_hpp 11 | 12 | #import 13 | #include 14 | 15 | using namespace cv; 16 | 17 | /* 18 | FGMM - Fast Gaussian Mixture Model 19 | */ 20 | class FGMM 21 | { 22 | public: 23 | static const int componentsCount = 5; 24 | 25 | FGMM( Mat& _model ); 26 | double operator()( const Vec3d color ) const; 27 | double operator()( int ci, const Vec3d color ) const; 28 | int whichComponent( const Vec3d color ) const; 29 | 30 | void initLearning(); 31 | void addSample( int ci, const Vec3d color ); 32 | void endLearning(); 33 | 34 | private: 35 | void calcInverseCovAndDeterm( int ci ); 36 | Mat model; 37 | double* coefs; 38 | double* mean; 39 | double* cov; 40 | 41 | double inverseCovs[componentsCount][3][3]; 42 | double covDeterms[componentsCount]; 43 | 44 | double sums[componentsCount][3]; 45 | double prods[componentsCount][3][3]; 46 | int sampleCounts[componentsCount]; 47 | int totalSampleCount; 48 | }; 49 | 50 | #endif /* FGMM_hpp */ 51 | -------------------------------------------------------------------------------- /TCCore/GlobalMatting.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // GlobalMatting.hpp 3 | // BokehEffect 4 | // 5 | // Created by Xin Zeng on 12/4/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef GlobalMatting_hpp 10 | #define GlobalMatting_hpp 11 | 12 | #import 13 | #include 14 | 15 | void expansionOfKnownRegions(cv::InputArray img, cv::InputOutputArray trimap, int niter = 9); 16 | 17 | void globalMatting(const cv::Mat &image, const cv::Mat &trimap, cv::Mat &alpha, cv::Rect rect); 18 | 19 | #endif /* GlobalMatting_hpp */ 20 | -------------------------------------------------------------------------------- /TCCore/GuidedFilter.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // GuidedFilter.hpp 3 | // GeodesicMatting 4 | // 5 | // Created by Xin Zeng on 5/4/16. 6 | // Copyright © 2016 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef GuidedFilter_hpp 10 | #define GuidedFilter_hpp 11 | 12 | #include 13 | #include 14 | 15 | class GuidedFilterImpl; 16 | 17 | class GuidedFilter 18 | { 19 | public: 20 | GuidedFilter(const cv::Mat &I, int r, double eps); 21 | ~GuidedFilter(); 22 | 23 | cv::Mat filter(const cv::Mat &p, int depth = -1) const; 24 | 25 | private: 26 | GuidedFilterImpl *impl_; 27 | }; 28 | 29 | cv::Mat guidedFilter(const cv::Mat &I, const cv::Mat &p, int r, double eps, cv::Rect rect); 30 | 31 | #endif /* GuidedFilter_hpp */ 32 | -------------------------------------------------------------------------------- /TCCore/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /TCCore/KCenterClustering.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // KCenterClustering.hpp 3 | // BlurEffect 4 | // 5 | // Created by Xin Zeng on 11/7/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef KCenterClustering_hpp 10 | #define KCenterClustering_hpp 11 | 12 | #include 13 | 14 | class KCenterClustering{ 15 | public: 16 | 17 | //Output parameters 18 | 19 | double MaxClusterRadius; //maximum cluster radius 20 | 21 | int *pClusterIndex; //pointer to a vector of length N where the i th element is the 22 | //cluster number to which the i th point belongs. 23 | double *pClusterCenters; 24 | int *pNumPoints; 25 | double *pClusterRadii; 26 | 27 | //Functions 28 | 29 | //constructor 30 | KCenterClustering(int Dim, 31 | int NSources, 32 | double *pSources, 33 | int NumClusters 34 | ); 35 | 36 | //destructor 37 | ~KCenterClustering(); 38 | 39 | //k-center clustering 40 | void Cluster(); 41 | 42 | //Compute cluster centers and the number of points in each cluster 43 | //and the radius of each cluster. 44 | 45 | void ComputeClusterCenters(); 46 | 47 | private: 48 | //Input Parameters 49 | 50 | int d; //dimension of the points. 51 | int N; //number of sources. 52 | double *px; //pointer to sources, (d*N). 53 | int K; //number of clusters 54 | double *dist_C; //distances to the center. 55 | double *r; 56 | 57 | //Functions 58 | 59 | double ddist(const int d, const double *x, const double *y); 60 | int idmax(int n, double *x); 61 | }; 62 | 63 | #endif /* KCenterClustering_hpp */ 64 | -------------------------------------------------------------------------------- /TCCore/PaintSelect.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // GrabCut.hpp 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 11/12/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef PaintSelect_hpp 10 | #define PaintSelect_hpp 11 | 12 | #import 13 | 14 | #include 15 | #include "TCCoreLibs0.h" 16 | 17 | using namespace cv; 18 | 19 | void paintSelect(const Mat &img, const Mat &mask, const Mat ®ion, Mat &result, int mode); 20 | 21 | #endif /* PaintSelect_hpp */ 22 | -------------------------------------------------------------------------------- /TCCore/QuickGraphCut.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // QuickGraphCut.hpp 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 11/14/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef QuickGraphCut_hpp 10 | #define QuickGraphCut_hpp 11 | 12 | #import 13 | #import 14 | #include 15 | 16 | #include "FGMM.hpp" 17 | #include "FGCGraph.hpp" 18 | 19 | using namespace cv; 20 | 21 | bool quickGraphCut(const Mat &img, Mat &mask, int iterCount); 22 | 23 | #endif /* QuickGraphCut_hpp */ 24 | -------------------------------------------------------------------------------- /TCCore/TCCore.h: -------------------------------------------------------------------------------- 1 | // 2 | // TCCore.h 3 | // TCCore 4 | // 5 | // Created by Xin Zeng on 10/5/21. 6 | // 7 | 8 | #import 9 | 10 | //! Project version number for TCCore. 11 | FOUNDATION_EXPORT double TCCoreVersionNumber; 12 | 13 | //! Project version string for TCCore. 14 | FOUNDATION_EXPORT const unsigned char TCCoreVersionString[]; 15 | 16 | // In this header, you should import all the public headers of your framework using statements like #import 17 | 18 | 19 | #import "TCCoreWrapper.h" 20 | -------------------------------------------------------------------------------- /TCCore/TCCoreLibs.h: -------------------------------------------------------------------------------- 1 | // 2 | // TCCoreLibs.h 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 11/8/15. 6 | // Copyright © 2015 Xin Zeng. All rights reserved. 7 | // 8 | 9 | #ifndef TCCoreLibs_h 10 | #define TCCoreLibs_h 11 | 12 | #define GC_MASK_BGD 0 13 | #define GC_MASK_PR_BGD 1 14 | #define GC_MASK_PR_FGD 2 15 | #define GC_MASK_FGD 3 16 | 17 | #define GC_PASS_THROUGH_BGD 4 18 | #define GC_PASS_THROUGH_PR_BGD 5 19 | #define GC_PASS_THROUGH_PR_FGD 6 20 | #define GC_PASS_THROUGH_FGD 7 21 | 22 | #define GC_FLAG_PASS 0x04 23 | #define GC_FLAG_ALPHA 0x08 24 | 25 | #define GC_UNINIT 255 26 | 27 | #define GC_MASK 0x3 28 | #define GC_LOG_MASK 0x0F 29 | 30 | #define GC_MODE_FGD 0 31 | #define GC_MODE_BGD 1 32 | 33 | #define GM_BGD 0 34 | #define GM_PASS_THROUGH 64 35 | #define GM_UNKNOWN 128 36 | #define GM_UNINIT 192 37 | #define GM_FGD 255 38 | 39 | #endif /* TCCoreLibs_h */ 40 | -------------------------------------------------------------------------------- /TCCore/TCCoreLibs0.h: -------------------------------------------------------------------------------- 1 | // 2 | // TCCoreLibs0.h 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 1/2/17. 6 | // 7 | // 8 | 9 | #ifndef TCCoreLibs0_h 10 | #define TCCoreLibs0_h 11 | 12 | #include "TCCoreLibs.h" 13 | #include 14 | 15 | #define TC_ASSERT(_exp, _msg, ...) do { \ 16 | if (!(_exp)) { printf(_msg, ##__VA_ARGS__); \ 17 | assert(false); }} while(false) 18 | 19 | #define bit(_val, _flag) ((_val) & (_flag)) 20 | #define bis(_val, _flag) ((_val) |= (_flag)) 21 | #define bic(_val, _flag) ((_val) &= (~(_flag))) 22 | 23 | #define IS_BOUNDARY(_mat, _p) (\ 24 | (((_p).x > 0) && ((_mat).at(cv::Point((_p).x - 1, (_p).y)) != (_mat).at((_p)))) || \ 25 | (((_p).y > 0) && ((_mat).at(cv::Point((_p).x, (_p).y - 1)) != (_mat).at((_p)))) || \ 26 | (((_p).x < (_mat).cols - 1) && ((_mat).at(cv::Point((_p).x + 1, (_p).y)) != (_mat).at((_p)))) || \ 27 | (((_p).y < (_mat).rows - 1) && ((_mat).at(cv::Point((_p).x, (_p).y + 1)) != (_mat).at((_p))))) 28 | 29 | #define TC_RGBA 0 30 | #define TC_ARGB 1 31 | 32 | #ifdef DEVICE_OS_IOS 33 | #define DEVICE_COLOR_SPACE TC_RGBA 34 | #define RGB_VAL(_img, _y, _x) (*(cv::Vec3b*)&_img.at((_y), (_x))) 35 | #else 36 | #define DEVICE_COLOR_SPACE TC_ARGB 37 | #define RGB_VAL(_img, _y, _x) (*(cv::Vec3b*)((uchar *)&_img.at((_y), (_x)) + 1)) 38 | #endif 39 | 40 | #define RGB_VALP(_img, _p) RGB_VAL((_img), (_p).y, (_p).x) 41 | 42 | #define TC_ARGB_TO_RGB(_dst, _src, _cnt) \ 43 | do { \ 44 | for (int _i = 0; _i < (_cnt); _i++) \ 45 | *((cv::Vec3b *)(_dst) + _i) = (*(unsigned int *)((_src) + 4*_i)) >> 8; \ 46 | } while(0) 47 | 48 | #define GC_IS_FGD_INT(_val) ((_val) == GC_MASK_FGD || (_val) == GC_MASK_PR_FGD) 49 | #define GC_IS_BGD_INT(_val) ((_val) == GC_MASK_BGD || (_val) == GC_MASK_PR_BGD) 50 | 51 | #define GC_VAL(_val) ((_val) & GC_MASK) 52 | #define GC_IS_FGD(_val) (GC_IS_FGD_INT(GC_VAL(_val))) 53 | #define GC_IS_BGD(_val) (GC_IS_BGD_INT(GC_VAL(_val))) 54 | 55 | #define GC_LABEL_CHANGED(_label1, _label2) \ 56 | ((GC_IS_FGD(_label1) && GC_IS_BGD(_label2)) || (GC_IS_BGD(_label1) && GC_IS_FGD(_label2))) 57 | 58 | #define PROB_VALUE(_val) ((_val) == GC_MASK_BGD ? GC_MASK_PR_BGD : (_val) == GC_MASK_FGD ? GC_MASK_PR_FGD : _val) 59 | 60 | #define GC_DEFINITE_VALUE(_val) ((_val) ^ 0x01) 61 | 62 | #define GC_IS_PASS_THROUGH(_val) (bit((_val), GC_FLAG_PASS)) 63 | 64 | #define GC_ASSERT(_val) TC_ASSERT((_val) < 4, "inv GC value: %d\n", (_val)) 65 | 66 | #define MATTING_RADIUS 8 67 | 68 | #if CV_VERSION_MAJOR > 2 69 | #define TC_StsBadArg (cv::Error::StsBadArg) 70 | #else 71 | #define TC_StsBadArg (CV_StsBadArg) 72 | #endif 73 | 74 | #endif /* TCCoreLibs0_h */ 75 | -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "add.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "add@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "add@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/add.imageset/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/add.imageset/add.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/add.imageset/add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/add.imageset/add@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/add.imageset/add@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/add.imageset/add@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/arrow_up_white.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_keyboard_arrow_up_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_keyboard_arrow_up_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_keyboard_arrow_up_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/arrow_up_white.imageset/ic_keyboard_arrow_up_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/brush.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "brush.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "brush@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "brush@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/brush.imageset/brush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/brush.imageset/brush.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/brush.imageset/brush@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/brush.imageset/brush@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/brush.imageset/brush@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/brush.imageset/brush@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/check.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_done_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_done_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_done_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/check.imageset/ic_done_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/check.imageset/ic_done_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/check.imageset/ic_done_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/check.imageset/ic_done_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/check.imageset/ic_done_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/check.imageset/ic_done_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/clear.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_clear_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_clear_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_clear_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/clear.imageset/ic_clear_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/clear.imageset/ic_clear_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/clear.imageset/ic_clear_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/clear.imageset/ic_clear_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/clear.imageset/ic_clear_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/clear.imageset/ic_clear_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/done.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_done_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_done_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_done_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/done.imageset/ic_done_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/done.imageset/ic_done_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/done.imageset/ic_done_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/done.imageset/ic_done_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/done.imageset/ic_done_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/done.imageset/ic_done_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eraser.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eraserwhite.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "eraserwhite@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "eraserwhite@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eraser.imageset/eraserwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eraser.imageset/eraserwhite.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eraser.imageset/eraserwhite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eraser.imageset/eraserwhite@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eraser.imageset/eraserwhite@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eraser.imageset/eraserwhite@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyeblack.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eyeblack.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "eyeblack@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "eyeblack@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyeblack.imageset/eyeblack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyeblack.imageset/eyeblack.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyeblack.imageset/eyeblack@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyeblack.imageset/eyeblack@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyeblack.imageset/eyeblack@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyeblack.imageset/eyeblack@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyewhite.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "eye.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "eye@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "eye@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyewhite.imageset/eye.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyewhite.imageset/eye.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyewhite.imageset/eye@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyewhite.imageset/eye@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/eyewhite.imageset/eye@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/eyewhite.imageset/eye@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_pinch.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gesture_pinch.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "gesture_pinch@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "gesture_pinch@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_pinch.imageset/gesture_pinch@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_tap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gesture_tap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "gesture_tap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "gesture_tap@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_tap.imageset/gesture_tap@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_twofingertap.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "gesture_twofingertap.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "gesture_twofingertap@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "gesture_twofingertap@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/gesture_twofingertap.imageset/gesture_twofingertap@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/hairbrush.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hairbrush.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "hairbrush@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "hairbrush@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/hairbrush.imageset/hairbrush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/hairbrush.imageset/hairbrush.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/hairbrush.imageset/hairbrush@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/hairbrush.imageset/hairbrush@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/hairbrush.imageset/hairbrush@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/hairbrush.imageset/hairbrush@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/help.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_help_outline_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_help_outline_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_help_outline_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/help.imageset/ic_help_outline_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/help.imageset/ic_help_outline_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/help.imageset/ic_help_outline_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/help.imageset/ic_help_outline_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/help.imageset/ic_help_outline_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/help.imageset/ic_help_outline_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/invert.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "invert.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "invert@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "invert@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/invert.imageset/invert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/invert.imageset/invert.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/invert.imageset/invert@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/invert.imageset/invert@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/invert.imageset/invert@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/invert.imageset/invert@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/next.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_arrow_forward_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_arrow_forward_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_arrow_forward_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/next.imageset/ic_arrow_forward_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/pointer.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "pointerwhite.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "pointerwhite@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "pointerwhite@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/pointer.imageset/pointerwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/pointer.imageset/pointerwhite.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/pointer.imageset/pointerwhite@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/pointer.imageset/pointerwhite@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/pointer.imageset/pointerwhite@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/pointer.imageset/pointerwhite@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/quickselect.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "quickselect.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "quickselect@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "quickselect@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/quickselect.imageset/quickselect.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/quickselect.imageset/quickselect.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/quickselect.imageset/quickselect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/quickselect.imageset/quickselect@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/quickselect.imageset/quickselect@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/quickselect.imageset/quickselect@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/redo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "forward.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "forward@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "forward@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/redo.imageset/forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/redo.imageset/forward.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/redo.imageset/forward@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/redo.imageset/forward@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/redo.imageset/forward@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/redo.imageset/forward@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/remove.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "ic_remove_white.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "ic_remove_white_2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "ic_remove_white_3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/remove.imageset/ic_remove_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/remove.imageset/ic_remove_white.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/remove.imageset/ic_remove_white_2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/remove.imageset/ic_remove_white_2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/remove.imageset/ic_remove_white_3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/remove.imageset/ic_remove_white_3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/settings.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "setting.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "setting@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "setting@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/settings.imageset/setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/settings.imageset/setting.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/settings.imageset/setting@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/settings.imageset/setting@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/settings.imageset/setting@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/settings.imageset/setting@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/subtract.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "subtract.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "subtract@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "subtract@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/subtract.imageset/subtract.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/subtract.imageset/subtract.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/subtract.imageset/subtract@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/subtract.imageset/subtract@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/subtract.imageset/subtract@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/subtract.imageset/subtract@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "triangle.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "triangle@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "triangle@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle.imageset/triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle.imageset/triangle.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle.imageset/triangle@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle.imageset/triangle@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle.imageset/triangle@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle.imageset/triangle@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle_top.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "triangle_top.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "triangle_top@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "triangle_top@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle_top.imageset/triangle_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle_top.imageset/triangle_top.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle_top.imageset/triangle_top@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle_top.imageset/triangle_top@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/triangle_top.imageset/triangle_top@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/triangle_top.imageset/triangle_top@3x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/undo.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "return.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "return@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "return@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/undo.imageset/return.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/undo.imageset/return.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/undo.imageset/return@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/undo.imageset/return@2x.png -------------------------------------------------------------------------------- /TCMask/Assets.xcassets/undo.imageset/return@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/TCMask/Assets.xcassets/undo.imageset/return@3x.png -------------------------------------------------------------------------------- /TCMask/BrushLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // BrushLog.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 10/23/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import TCCore 11 | 12 | class BrushLog : ToolLog { 13 | var diffs = [[UInt32]]() 14 | 15 | override var count: Int { return diffs.count } 16 | override var size: Int { 17 | var retval = 0 18 | for diff in diffs { retval += diff.count } 19 | return retval 20 | } 21 | 22 | init() { 23 | super.init(type: .brush) 24 | } 25 | 26 | func push(diff: [UInt32]) { 27 | idx = idx + 1 28 | diffs.removeLast(diffs.count - idx) 29 | diffs.append(diff) 30 | } 31 | 32 | override func undo(tool: Tool) { 33 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 34 | let hbtool = tool as! BrushTool 35 | let diff = diffs[idx] 36 | 37 | if diff.count == 0 { 38 | hbtool.invert() 39 | } 40 | else { 41 | TCCore.logDecodeDiff(to: &hbtool.maskView.opacity, from: hbtool.maskView.opacity, diff: diff, count: hbtool.maskView.opacity.count, diffCount: diff.count) 42 | TCCore.arrayCopy(&hbtool.previousAlpha, src: hbtool.maskView.opacity, count: hbtool.previousAlpha.count) 43 | } 44 | 45 | idx -= 1 46 | } 47 | 48 | override func redo(tool: Tool) { 49 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 50 | 51 | let hbtool = tool as! BrushTool 52 | idx += 1 53 | let diff = diffs[idx] 54 | 55 | if diff.count == 0 { 56 | hbtool.invert() 57 | } 58 | else { 59 | TCCore.logDecodeDiff(to: &hbtool.maskView.opacity, from: hbtool.maskView.opacity, diff: diff, count: hbtool.maskView.opacity.count, diffCount: diff.count) 60 | TCCore.arrayCopy(&hbtool.previousAlpha, src: hbtool.maskView.opacity, count: hbtool.previousAlpha.count) 61 | } 62 | } 63 | 64 | override func invert() { 65 | idx = idx + 1 66 | diffs.removeLast(diffs.count - idx) 67 | diffs.append([UInt32]()) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /TCMask/BrushTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // RegularBrushTool 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 6/22/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | import TCCore 11 | 12 | class BrushTool : Tool { 13 | var imgSize: CGSize! 14 | var previousAlpha = [UInt8]() 15 | var previousPoint = CGPoint() 16 | 17 | init(maskView: MaskView, toolManager: ToolManager) { 18 | super.init(type: .brush, maskView: maskView, toolManager: toolManager) 19 | 20 | imgSize = maskView.image.size 21 | 22 | previousAlpha = [UInt8](repeating: 0, count: maskView.opacity.count) 23 | TCCore.arrayCopy(&previousAlpha, src: maskView.opacity, count: previousAlpha.count) 24 | } 25 | 26 | override func refresh() { 27 | maskView.refresh() 28 | } 29 | 30 | override func invert() { 31 | TCCore.invertAlpha(&maskView.opacity, count: maskView.opacity.count) 32 | TCCore.arrayCopy(&previousAlpha, src: maskView.opacity, count: previousAlpha.count) 33 | refresh() 34 | } 35 | 36 | override func endProcessing() { 37 | } 38 | 39 | override func touchBegan(_ location: CGPoint) { 40 | notifyWillBeginProcessing() 41 | drawCircularGrident(center: location) 42 | previousPoint = location; 43 | } 44 | 45 | override func touchMoved(_ previousLocation: CGPoint, _ location: CGPoint) { 46 | if (round(previousLocation.x * maskView.scaleFactor) == round(location.x * maskView.scaleFactor) && round(previousLocation.y * maskView.scaleFactor) == round(location.y * maskView.scaleFactor)) { 47 | return 48 | } 49 | drawCircularGrident(center: location) 50 | } 51 | 52 | override func touchEnded(_ previousLocation: CGPoint, _ location: CGPoint) { 53 | toolManager.pushLogOfBrush(previousAlpha: previousAlpha, currentAlpha: maskView.opacity) 54 | TCCore.arrayCopy(&previousAlpha, src: maskView.opacity, count: previousAlpha.count) 55 | notifyDidEndProcessing() 56 | } 57 | 58 | func drawCircularGrident(center: CGPoint) { 59 | let params = delegate.getToolParams() 60 | let endRadius = maskView.lineWidth(scribbleSize: params.brushSize) / 2 61 | let startRadius = endRadius * params.brushHardness 62 | var outRect = CGRect() 63 | if (TCCore.drawRadialGradient(onAlpha: &maskView.opacity, size: imgSize, center: center * maskView.scaleFactor, startValue: UInt8(params.brushOpacity * params.brushOpacity * 255), startRadius: startRadius, endValue: 0, endRadius: endRadius, outRect: &outRect, add: params.add)) 64 | { 65 | maskView.refresh(outRect) 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /TCMask/CanvasView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CanvasView.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 2/16/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class CanvasView : UIView { 12 | let scaleFactor = UIScreen.main.scale 13 | var cacheContext: CGContext! 14 | var _data = [UInt8]() 15 | var data: [UInt8] { get {return _data} } 16 | 17 | required init?(coder aDecoder: NSCoder) { 18 | super.init(coder: aDecoder) 19 | self.initCacheContext() 20 | } 21 | 22 | override init(frame: CGRect) { 23 | super.init(frame: frame) 24 | self.initCacheContext() 25 | } 26 | 27 | // http://www.effectiveui.com/blog/2011/12/02/how-to-build-a-simple-painting-app-for-ios/ 28 | // How to build a Simple Painting App for iOS 29 | override func draw(_ rect: CGRect) { 30 | let ctx = UIGraphicsGetCurrentContext()! 31 | ctx.setBlendMode(CGBlendMode.copy) 32 | 33 | // Draw cache image to ctx 34 | let width = CGFloat(cacheContext.width) 35 | let height = CGFloat(cacheContext.height) 36 | let scaleX = width / self.bounds.size.width 37 | let scaleY = height / self.bounds.size.height 38 | 39 | let scaledRect = CGRect(x: round(rect.origin.x * scaleX), y: round(height - rect.origin.y * scaleY - rect.size.height * scaleY), width: round(rect.size.width * scaleX), height: round(rect.size.height * scaleY)) 40 | let cacheImage = cacheContext.makeImage()!.cropping(to: scaledRect) 41 | ctx.draw(cacheImage!, in: rect) 42 | } 43 | 44 | func initCacheContext() { 45 | let width = Int(round(self.width * scaleFactor)) 46 | let height = Int(round(self.height * scaleFactor)) 47 | self._data = [UInt8](repeating: 0, count: width * height * 4) 48 | self.cacheContext = CGContext(data: &_data, width: width, height: height, bitsPerComponent: 8, bytesPerRow: width * 4, space: CGColorSpaceCreateDeviceRGB(), bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue)! 49 | cacheContext.setLineCap(CGLineCap.round) 50 | cacheContext.setLineJoin(CGLineJoin.round) 51 | cacheContext.setShouldAntialias(false) 52 | } 53 | 54 | deinit { 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /TCMask/CircleView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // CircleView.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 5/9/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | fileprivate func < (lhs: T?, rhs: T?) -> Bool { 11 | switch (lhs, rhs) { 12 | case let (l?, r?): 13 | return l < r 14 | case (nil, _?): 15 | return true 16 | default: 17 | return false 18 | } 19 | } 20 | 21 | fileprivate func > (lhs: T?, rhs: T?) -> Bool { 22 | switch (lhs, rhs) { 23 | case let (l?, r?): 24 | return l > r 25 | default: 26 | return rhs < lhs 27 | } 28 | } 29 | 30 | 31 | class CircleView : UIView { 32 | var color: UIColor = UIColor(white: 1, alpha: 0.5) { 33 | didSet { 34 | self.setNeedsDisplay() 35 | } 36 | } 37 | 38 | var size: CGFloat = 80 { 39 | didSet { 40 | self.frame.size = CGSize(width: size, height: size) 41 | self.setNeedsDisplay() 42 | } 43 | } 44 | 45 | var stroke: Bool = false { 46 | didSet { 47 | self.setNeedsDisplay() 48 | } 49 | } 50 | 51 | var hardness: CGFloat = 1 { 52 | didSet { 53 | self.setNeedsDisplay() 54 | } 55 | } 56 | 57 | override func draw(_ rect: CGRect) { 58 | let ctx = UIGraphicsGetCurrentContext()! 59 | ctx.setBlendMode(CGBlendMode.copy) 60 | 61 | ctx.setFillColor(UIColor.clear.cgColor) 62 | ctx.fill(self.bounds) 63 | 64 | if (!self.stroke && self.hardness != 1) { 65 | let (r, g, b, _) = color.rgba()! 66 | let colorComponents = [r, g, b, 1, r, g, b, 0] 67 | let locations: [CGFloat] = [0, 1] 68 | let gradient = CGGradient(colorSpace: CGColorSpaceCreateDeviceRGB(), colorComponents: colorComponents, locations: locations, count: 2)! 69 | let center = CGPoint(x: self.width / 2, y: self.height / 2) 70 | ctx.drawRadialGradient(gradient, startCenter: center, startRadius: self.size / 2 * self.hardness, endCenter: center, endRadius: self.size / 2, options: CGGradientDrawingOptions.drawsBeforeStartLocation) 71 | } 72 | else { 73 | ctx.setFillColor(self.color.cgColor) 74 | ctx.fillEllipse(in: self.bounds) 75 | } 76 | 77 | let strokeWidth: CGFloat = size / 16 78 | if (self.stroke && self.size > strokeWidth * 2) { 79 | ctx.setFillColor(UIColor.clear.cgColor) 80 | ctx.fillEllipse(in: CGRect(x: strokeWidth, y: strokeWidth, width: self.size - 2 * strokeWidth, height: self.size - 2 * strokeWidth)) 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /TCMask/HairBrushLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HairBrushLog.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 10/12/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import TCCore 11 | 12 | class HairBrushLog : ToolLog { 13 | var diffs = [[UInt32]]() 14 | 15 | override var count: Int { return diffs.count } 16 | override var size: Int { 17 | var retval = 0 18 | for diff in diffs { retval += diff.count } 19 | return retval 20 | } 21 | 22 | init() { 23 | super.init(type: .hairBrush) 24 | } 25 | 26 | func push(diff: [UInt32]) { 27 | idx = idx + 1 28 | diffs.removeLast(diffs.count - idx) 29 | diffs.append(diff) 30 | } 31 | 32 | override func undo(tool: Tool) { 33 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 34 | let hbtool = tool as! HairBrushTool 35 | let diff = diffs[idx] 36 | 37 | if diff.count == 0 { 38 | hbtool.invert() 39 | } 40 | else { 41 | TCCore.logDecodeDiff(to: &hbtool.maskView.opacity, from: hbtool.maskView.opacity, diff: diff, count: hbtool.maskView.opacity.count, diffCount: diff.count) 42 | TCCore.arrayCopy(&hbtool.previousAlpha, src: hbtool.maskView.opacity, count: hbtool.previousAlpha.count) 43 | } 44 | 45 | idx -= 1 46 | } 47 | 48 | override func redo(tool: Tool) { 49 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 50 | let hbtool = tool as! HairBrushTool 51 | 52 | idx += 1 53 | let diff = diffs[idx] 54 | 55 | if diff.count == 0 { 56 | hbtool.invert() 57 | } 58 | else { 59 | TCCore.logDecodeDiff(to: &hbtool.maskView.opacity, from: hbtool.maskView.opacity, diff: diff, count: hbtool.maskView.opacity.count, diffCount: diff.count) 60 | TCCore.arrayCopy(&hbtool.previousAlpha, src: hbtool.maskView.opacity, count: hbtool.previousAlpha.count) 61 | } 62 | } 63 | 64 | override func invert() { 65 | idx = idx + 1 66 | diffs.removeLast(diffs.count - idx) 67 | diffs.append([UInt32]()) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /TCMask/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE) 17 | CFBundleShortVersionString 18 | $(MARKETING_VERSION) 19 | CFBundleVersion 20 | $(CURRENT_PROJECT_VERSION) 21 | 22 | 23 | -------------------------------------------------------------------------------- /TCMask/QuickSelectLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // QuickSelectLog.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 10/12/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | import TCCore 11 | 12 | class QuickSelectLog : ToolLog { 13 | var diffs = [[UInt32]]() 14 | var encodedMask: [UInt32]! 15 | var encodedAlpha: [UInt32]! 16 | 17 | override var count: Int { return diffs.count } 18 | 19 | override var size: Int { 20 | var retval = 0 21 | for diff in diffs { retval += diff.count } 22 | return retval 23 | } 24 | 25 | init() { 26 | super.init(type: .quickSelect) 27 | } 28 | 29 | func push(diff: [UInt32]) { 30 | idx = idx + 1 31 | diffs.removeLast(diffs.count - idx) 32 | diffs.append(diff) 33 | } 34 | 35 | override func undo(tool: Tool) { 36 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 37 | let qstool = tool as! QuickSelectTool 38 | 39 | if qstool.isSelectRunning { 40 | return 41 | } 42 | 43 | let diff = diffs[idx] 44 | if diff.count == 0 { 45 | qstool.invert() 46 | } 47 | else { 48 | TCCore.logDecodeDiff(to: &qstool.mask, from: qstool.mask, diff: diff, count: qstool.mask.count, diffCount: diff.count) 49 | TCCore.arrayCopy(&qstool.previousMask, src: qstool.mask, count: qstool.mask.count) 50 | } 51 | idx -= 1 52 | } 53 | 54 | override func redo(tool: Tool) { 55 | assert(tool.type == self.type, "inv type: tool:\(tool.type) self:\(self.type)") 56 | let qstool = tool as! QuickSelectTool 57 | 58 | if qstool.isSelectRunning { 59 | return 60 | } 61 | 62 | idx += 1 63 | let diff = diffs[idx] 64 | if diff.count == 0 { 65 | qstool.invert() 66 | } 67 | else { 68 | TCCore.logDecodeDiff(to: &qstool.mask, from: qstool.mask, diff: diff, count: qstool.mask.count, diffCount: diff.count) 69 | TCCore.arrayCopy(&qstool.previousMask, src: qstool.mask, count: qstool.mask.count) 70 | } 71 | } 72 | 73 | override func invert() { 74 | idx = idx + 1 75 | diffs.removeLast(diffs.count - idx) 76 | diffs.append([UInt32]()) 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /TCMask/TCMaskTool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TCMaskTool.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 2/18/17. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | /// Image masking tool 12 | @objc public enum TCMaskTool : Int { 13 | /// Brush tool 14 | case brush = 0 15 | /// Quick select tool 16 | case quickSelect = 1 17 | /// Hair brush tool 18 | case hairBrush = 2 19 | } 20 | -------------------------------------------------------------------------------- /TCMask/TCMaskViewDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TCMaskViewDelegate.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 3/2/17. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | /** 12 | Delegate methods for TCMaskView, which includes: 13 | 14 | - tcMaskViewDidExit: is called after TCMaskView exits 15 | - tcMaskViewDidComplete: is called after a popup TCMaskView completes 16 | - tcMaskViewWillPushViewController: is called before navigation controller is about to accomplish TCMaskView and process to the next UIViewController 17 | */ 18 | @objc public protocol TCMaskViewDelegate{ 19 | /** 20 | Called when the user taps 'X' button and €™TCMaskView exits. 21 | 22 | - parameter mask: Image masking result 23 | - parameter image: The original image provided to TCMaskView when 'present' was called 24 | */ 25 | @objc optional func tcMaskViewDidExit(mask: TCMask, image: UIImage) 26 | 27 | /** 28 | Called when the user taps '✓' button and €™TCMaskView completes. 29 | 30 | - parameter mask: Image masking result 31 | - parameter image: The original image provided to TCMaskView when 'present' was called 32 | */ 33 | @objc optional func tcMaskViewDidComplete(mask: TCMask, image: UIImage) 34 | 35 | /** 36 | Called when the user taps '->' button and UINavigationController is about to process to next UIViewController. 37 | 38 | - parameter mask: Image masking result 39 | - parameter image: The original image provided to TCMaskView when 'present' was called 40 | 41 | - returns: The next UIViewController where UINavigationController is about to process to 42 | */ 43 | @objc optional func tcMaskViewWillPushViewController(mask: TCMask, image: UIImage) -> UIViewController! 44 | } 45 | -------------------------------------------------------------------------------- /TCMask/TCMaskViewState.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TCMaskViewState.swift 3 | // TCMask 4 | // 5 | // Created by Xin Zeng on 6/14/18. 6 | // 7 | 8 | import Foundation 9 | 10 | /// State of TCMaskView 11 | @objc public enum TCMaskViewState : Int { 12 | /// Add 13 | case add = 0 14 | /// Subtract 15 | case subtract = 1 16 | } 17 | -------------------------------------------------------------------------------- /TCMask/TCUIView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // TCUIView.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 2/18/17. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | /** 12 | The TCUIView defines a UI component in TCMaskView. 13 | You can change the property in TCUIView to customize the UI style of TCMaskView 14 | */ 15 | open class TCUIView : NSObject { 16 | 17 | /// Background color of the view 18 | @objc open var backgroundColor: UIColor 19 | 20 | /// Tint color of the view, inside which the color of all the buttons and icons will be set to tint color 21 | @objc open var tintColor: UIColor 22 | 23 | /// Highlighted color of the view, inside which the highlighted color of all the buttons and icons will be set to highlighted color 24 | @objc open var highlightedColor: UIColor 25 | 26 | /// Text color of the view, inside which the text color of all the labels will be set to text color 27 | @objc open var textColor: UIColor 28 | 29 | override init() { 30 | backgroundColor = UIColor() 31 | tintColor = UIColor() 32 | highlightedColor = UIColor() 33 | textColor = UIColor() 34 | } 35 | 36 | func clone() -> TCUIView { 37 | let retval = TCUIView() 38 | retval.backgroundColor = backgroundColor 39 | retval.tintColor = tintColor 40 | retval.highlightedColor = highlightedColor 41 | retval.textColor = textColor 42 | return retval 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /TCMask/Tool.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Tool.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 6/23/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | protocol ToolDelegate : AnyObject { 12 | func toolWillBeginProcessing(_ tool: Tool) 13 | func toolDidEndProcessing(_ tool: Tool) 14 | func toolIsWaitingForProcessing(_ tool: Tool) 15 | func getToolParams() -> ToolParams 16 | } 17 | 18 | class Tool : NSObject, UITabBarDelegate { 19 | weak var maskView: MaskView! 20 | weak var delegate: ToolDelegate! 21 | weak var toolManager: ToolManager! 22 | 23 | let type: TCMaskTool 24 | 25 | init(type: TCMaskTool, maskView: MaskView, toolManager: ToolManager) { 26 | self.type = type 27 | self.maskView = maskView 28 | self.toolManager = toolManager 29 | super.init() 30 | } 31 | 32 | deinit { 33 | } 34 | 35 | func refresh() { 36 | fatalError("Should be overwritten by subclass") 37 | } 38 | 39 | func invert() { 40 | fatalError("Should be overwritten by subclass") 41 | } 42 | 43 | func endProcessing() { 44 | 45 | } 46 | 47 | func touchBegan(_ location: CGPoint) { 48 | 49 | } 50 | 51 | func touchMoved(_ previousLocation: CGPoint, _ location: CGPoint) { 52 | 53 | } 54 | 55 | func touchEnded(_ previousLocation: CGPoint, _ location: CGPoint) { 56 | 57 | } 58 | 59 | func notifyWillBeginProcessing() { 60 | delegate!.toolWillBeginProcessing(self) 61 | } 62 | 63 | func notifyIsWaitingForProcessing() { 64 | delegate!.toolIsWaitingForProcessing(self) 65 | } 66 | 67 | func notifyDidEndProcessing() { 68 | delegate!.toolDidEndProcessing(self) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /TCMask/ToolBarItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToolBarItem.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 7/31/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | enum ToolBarItemType { 12 | case button, state, flip 13 | } 14 | 15 | class ToolBarItem : UIView { 16 | static let iconTop: CGFloat = 9 17 | static let iconWidth: CGFloat = 30 18 | static let iconHeight: CGFloat = 30 19 | 20 | static let labelTop: CGFloat = 40 21 | static let labelHeight: CGFloat = 18 22 | 23 | weak var label: UILabel! 24 | weak var imageView: UIImageView! 25 | var action: ((_ sender: ToolBarItem) -> ())! 26 | 27 | var color = UIColor.clear 28 | var textColor = UIColor.clear 29 | var highlightedColor = UIColor.clear 30 | 31 | var onImage: UIImage! 32 | var offImage: UIImage! 33 | 34 | var onText: String! 35 | var offText: String! 36 | 37 | 38 | var type: ToolBarItemType = .button 39 | 40 | var on: Bool = false { 41 | didSet { 42 | if (self.type == .state) { 43 | _highlighted = on 44 | } 45 | else if (self.type == .flip) { 46 | _highlighted = false 47 | self.imageView?.image = on ? onImage : offImage 48 | self.label.text = on ? onText : offText 49 | } 50 | else { 51 | assert(false) 52 | } 53 | } 54 | } 55 | 56 | var _highlighted: Bool = false { 57 | didSet { 58 | if (_highlighted) { 59 | imageView.tintColor = highlightedColor 60 | label.textColor = highlightedColor 61 | } 62 | else { 63 | imageView?.tintColor = color 64 | label.textColor = textColor 65 | } 66 | } 67 | } 68 | 69 | required init?(coder aDecoder: NSCoder) { 70 | super.init(coder: aDecoder) 71 | for subview in self.subviews { 72 | if let view = subview as? UIImageView { 73 | if (view.width > 20 && view.height > 20) { 74 | view.image = view.image!.withRenderingMode(.alwaysTemplate) 75 | self.imageView = view 76 | } 77 | } 78 | else if let view = subview as? UILabel { 79 | self.label = view 80 | } 81 | } 82 | self.isAccessibilityElement = true 83 | } 84 | 85 | func refresh() { 86 | self.imageView?.tintColor = color 87 | self.label.textColor = textColor 88 | } 89 | 90 | override func touchesBegan(_ touches: Set, with event: UIEvent?) { 91 | _highlighted = !_highlighted 92 | } 93 | 94 | override func touchesEnded(_ touches: Set, with event: UIEvent?) { 95 | if (self.type == .button) { 96 | _highlighted = !_highlighted 97 | } 98 | else { 99 | self.on = !self.on 100 | } 101 | action?(self) 102 | } 103 | 104 | override func touchesCancelled(_ touches: Set, with event: UIEvent?) { 105 | self.touchesEnded(touches, with: event) 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /TCMask/ToolLog.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToolLog.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 10/12/16. 6 | // 7 | // 8 | 9 | import Foundation 10 | 11 | class ToolLog { 12 | let type: TCMaskTool 13 | var idx = -1 14 | 15 | var count: Int { return -1 } 16 | var size: Int { fatalError("should be overwrittene") } 17 | 18 | init(type: TCMaskTool) { 19 | self.type = type 20 | } 21 | 22 | func undo(tool: Tool) { 23 | fatalError("should be overwritten") 24 | } 25 | 26 | func redo(tool: Tool) { 27 | fatalError("should be overwritten") 28 | } 29 | 30 | func invert() { 31 | fatalError("should be overwritten") 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /TCMask/ToolMenuItem.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ToolMenuItem.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 3/4/17. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class ToolMenuItem : UIView { 12 | weak var imageView: UIImageView! 13 | weak var label: UILabel! 14 | 15 | required init?(coder aDecoder: NSCoder) { 16 | super.init(coder: aDecoder) 17 | for subview in self.subviews { 18 | if let view = subview as? UIImageView { 19 | view.image = view.image?.withRenderingMode(.alwaysTemplate) 20 | self.imageView = view 21 | } 22 | else if let view = subview as? UILabel { 23 | self.label = view 24 | } 25 | } 26 | self.isAccessibilityElement = true 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /TCMask/UILockableView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // UILockableView.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 6/19/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class UILockableView : UIView { 12 | var protectionCounter = 0 13 | var protected: Bool { get { return protectionCounter > 0 } } 14 | 15 | func enableProtection() { 16 | protectionCounter += 1 17 | } 18 | 19 | func disableProtection() { 20 | #if DEBUG 21 | assert(protectionCounter > 0) 22 | #endif 23 | protectionCounter -= 1 24 | } 25 | 26 | override func hitTest(_ point: CGPoint, with event: UIEvent?) -> UIView? { 27 | var retval : UIView! 28 | if protected { 29 | self.disableProtection() 30 | retval = super.hitTest(point, with: event) 31 | self.enableProtection() 32 | } 33 | else { 34 | retval = super.hitTest(point, with: event) 35 | } 36 | return retval 37 | } 38 | 39 | override func layoutSublayers(of layer: CALayer) { 40 | if protected { 41 | self.disableProtection() 42 | super.layoutSublayers(of: layer) 43 | self.enableProtection() 44 | } 45 | else { 46 | super.layoutSublayers(of: layer) 47 | } 48 | } 49 | 50 | override var subviews: [UIView] { 51 | get { 52 | if protected { 53 | return [] 54 | } 55 | return super.subviews 56 | } 57 | } 58 | 59 | override func addSubview(_ view: UIView) { 60 | if protected { 61 | #if DEBUG 62 | assert(false, "addSubview: view is locked") 63 | #else 64 | return 65 | #endif 66 | } 67 | super.addSubview(view) 68 | } 69 | 70 | override func insertSubview(_ view: UIView, at index: Int) { 71 | if protected { 72 | #if DEBUG 73 | assert(false, "insertSubview: view is locked") 74 | #else 75 | return 76 | #endif 77 | } 78 | super.insertSubview(view, at: index) 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /TCMask/WebViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WebViewController.swift 3 | // TinyCrayon 4 | // 5 | // Created by Xin Zeng on 6/2/16. 6 | // 7 | // 8 | 9 | import UIKit 10 | 11 | class WebViewController : UIViewController { 12 | 13 | @IBOutlet weak var navBar: UINavigationBar! 14 | @IBOutlet weak var navBarTitle: UINavigationItem! 15 | @IBOutlet weak var webView: UIWebView! 16 | 17 | var urlString: String! 18 | var request: URLRequest! 19 | 20 | override func viewDidLoad() { 21 | // webView.scalesPageToFit = true 22 | 23 | } 24 | 25 | override func viewWillAppear(_ animated: Bool) { 26 | super.viewWillAppear(animated) 27 | if (request == nil) { 28 | let url = URL(string: urlString)! 29 | let request = URLRequest(url: url) 30 | webView.loadRequest(request) 31 | self.setNeedsStatusBarAppearanceUpdate() 32 | } 33 | } 34 | 35 | override var preferredStatusBarStyle : UIStatusBarStyle { 36 | return UIStatusBarStyle.lightContent 37 | } 38 | 39 | func setup(_ urlStr: String) { 40 | self.urlString = urlStr 41 | } 42 | 43 | @IBAction func backButtonTapped(_ sender: UIBarButtonItem) { 44 | self.dismiss(animated: true, completion: {}) 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /TCMask/WebViewController.xib: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /TCMask/en.lproj/MaskViewController.strings: -------------------------------------------------------------------------------- 1 | 2 | /* Class = "UILabel"; text = "Brush"; ObjectID = "9Rw-6a-LgB"; */ 3 | "9Rw-6a-LgB.text" = "Brush"; 4 | 5 | /* Class = "UILabel"; text = "Brush size: 60"; ObjectID = "INd-pV-RJb"; */ 6 | "INd-pV-RJb.text" = "Brush size: 60"; 7 | 8 | /* Class = "UILabel"; text = "Image Masking Tech by TinyCrayon"; ObjectID = "K5K-6D-x1v"; */ 9 | "K5K-6D-x1v.text" = "Image Masking Tech by TinyCrayon"; 10 | 11 | /* Class = "UILabel"; text = "Hair Brush"; ObjectID = "MQI-qU-0Th"; */ 12 | "MQI-qU-0Th.text" = "Hair Brush"; 13 | 14 | /* Class = "UILabel"; text = "Quick Select"; ObjectID = "UAc-Pi-pQL"; */ 15 | "UAc-Pi-pQL.text" = "Quick Select"; 16 | 17 | /* Class = "UILabel"; text = "Brush size: 80"; ObjectID = "Xym-U9-bwk"; */ 18 | "Xym-U9-bwk.text" = "Brush size: 80"; 19 | 20 | /* Class = "UILabel"; text = "Setting"; ObjectID = "Yb6-5M-jWJ"; */ 21 | "Yb6-5M-jWJ.text" = "Setting"; 22 | 23 | /* Class = "UILabel"; text = "Invert"; ObjectID = "gVf-xn-bgt"; */ 24 | "gVf-xn-bgt.text" = "Invert"; 25 | 26 | /* Class = "UILabel"; text = "Hardness: 50"; ObjectID = "gmK-Mr-nUc"; */ 27 | "gmK-Mr-nUc.text" = "Hardness: 50"; 28 | 29 | /* Class = "UILabel"; text = "Quick Select"; ObjectID = "jpc-j7-sIF"; */ 30 | "jpc-j7-sIF.text" = "Quick Select"; 31 | 32 | /* Class = "UILabel"; text = "Brush size: 80"; ObjectID = "kEW-hC-9iw"; */ 33 | "kEW-hC-9iw.text" = "Brush size: 80"; 34 | 35 | /* Class = "UILabel"; text = "Add"; ObjectID = "lXB-bx-7X4"; */ 36 | "lXB-bx-7X4.text" = "Add"; 37 | 38 | /* Class = "UILabel"; text = "Opacity: 100"; ObjectID = "nqZ-5p-EJ3"; */ 39 | "nqZ-5p-EJ3.text" = "Opacity: 100"; 40 | -------------------------------------------------------------------------------- /TinyCrayon.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TinyCrayon.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /TinyCrayon.xcodeproj/xcshareddata/xcschemes/TCCore.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /TinyCrayon.xcodeproj/xcshareddata/xcschemes/TCMask.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 57 | 58 | 59 | 60 | 62 | 63 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /docs/css/iconfont.css: -------------------------------------------------------------------------------- 1 | 2 | @font-face {font-family: "iconfont"; 3 | src: url('iconfont.eot?t=1487926304516'); /* IE9*/ 4 | src: url('iconfont.eot?t=1487926304516#iefix') format('embedded-opentype'), /* IE6-IE8 */ 5 | url('iconfont.woff?t=1487926304516') format('woff'), /* chrome, firefox */ 6 | url('iconfont.ttf?t=1487926304516') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ 7 | url('iconfont.svg?t=1487926304516#iconfont') format('svg'); /* iOS 4.1- */ 8 | } 9 | 10 | .iconfont { 11 | font-family:"iconfont" !important; 12 | font-size:16px; 13 | font-style:normal; 14 | -webkit-font-smoothing: antialiased; 15 | -moz-osx-font-smoothing: grayscale; 16 | } 17 | 18 | .icon-iconfontxuqiudingzhi:before { content: "\e665"; } 19 | 20 | .icon-tubiao06:before { content: "\e60d"; } 21 | 22 | .icon-mianfei:before { content: "\e602"; } 23 | 24 | -------------------------------------------------------------------------------- /docs/css/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/css/iconfont.ttf -------------------------------------------------------------------------------- /docs/css/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/css/iconfont.woff -------------------------------------------------------------------------------- /docs/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /docs/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/favicons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #da532c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /docs/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /docs/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/favicon.ico -------------------------------------------------------------------------------- /docs/favicons/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "TinyCrayon", 3 | "icons": [ 4 | { 5 | "src": "\/android-chrome-192x192.png", 6 | "sizes": "192x192", 7 | "type": "image\/png" 8 | } 9 | ], 10 | "theme_color": "#ffffff", 11 | "display": "standalone" 12 | } 13 | -------------------------------------------------------------------------------- /docs/favicons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/favicons/mstile-150x150.png -------------------------------------------------------------------------------- /docs/favicons/safari-pinned-tab.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | Created by potrace 1.11, written by Peter Selinger 2001-2013 9 | 10 | 12 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /docs/img/HairBrush_xs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/HairBrush_xs.gif -------------------------------------------------------------------------------- /docs/img/IDFA.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/IDFA.png -------------------------------------------------------------------------------- /docs/img/IDFA_details.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/IDFA_details.png -------------------------------------------------------------------------------- /docs/img/QuickSelect_xs.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/QuickSelect_xs.gif -------------------------------------------------------------------------------- /docs/img/android_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/android_active.png -------------------------------------------------------------------------------- /docs/img/android_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/android_gray.png -------------------------------------------------------------------------------- /docs/img/balloon_cutout_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_cutout_sm.png -------------------------------------------------------------------------------- /docs/img/balloon_gray.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_gray.jpg -------------------------------------------------------------------------------- /docs/img/balloon_gray_sm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_gray_sm.jpg -------------------------------------------------------------------------------- /docs/img/balloon_mask_sm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_mask_sm.jpg -------------------------------------------------------------------------------- /docs/img/balloon_sketch.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_sketch.jpg -------------------------------------------------------------------------------- /docs/img/balloon_sketch_sm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_sketch_sm.jpg -------------------------------------------------------------------------------- /docs/img/balloon_sm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/balloon_sm.jpg -------------------------------------------------------------------------------- /docs/img/banner_lg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/banner_lg.png -------------------------------------------------------------------------------- /docs/img/banner_md.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/banner_md.png -------------------------------------------------------------------------------- /docs/img/banner_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/banner_sm.png -------------------------------------------------------------------------------- /docs/img/banner_xs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/banner_xs.png -------------------------------------------------------------------------------- /docs/img/build_and_run_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/build_and_run_sm.png -------------------------------------------------------------------------------- /docs/img/carat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/carat.png -------------------------------------------------------------------------------- /docs/img/customize_ui_style.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/customize_ui_style.png -------------------------------------------------------------------------------- /docs/img/customize_ui_style_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/customize_ui_style_sm.png -------------------------------------------------------------------------------- /docs/img/customized_view_mode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/customized_view_mode.png -------------------------------------------------------------------------------- /docs/img/dark_theme_settings_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/dark_theme_settings_sm.png -------------------------------------------------------------------------------- /docs/img/dark_theme_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/dark_theme_sm.png -------------------------------------------------------------------------------- /docs/img/embed_swift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/embed_swift.png -------------------------------------------------------------------------------- /docs/img/embed_swift_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/embed_swift_sm.png -------------------------------------------------------------------------------- /docs/img/eyeblack@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/eyeblack@3x.png -------------------------------------------------------------------------------- /docs/img/framework_final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/framework_final.png -------------------------------------------------------------------------------- /docs/img/framework_final_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/framework_final_sm.png -------------------------------------------------------------------------------- /docs/img/iPhone6_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/iPhone6_gray.png -------------------------------------------------------------------------------- /docs/img/iPhone6_silver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/iPhone6_silver.png -------------------------------------------------------------------------------- /docs/img/ios_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/ios_active.png -------------------------------------------------------------------------------- /docs/img/ios_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/ios_gray.png -------------------------------------------------------------------------------- /docs/img/sc_add_embedded_binaries.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/sc_add_embedded_binaries.jpg -------------------------------------------------------------------------------- /docs/img/sc_add_embedded_binaries_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/sc_add_embedded_binaries_sm.png -------------------------------------------------------------------------------- /docs/img/sc_add_files_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/sc_add_files_sm.png -------------------------------------------------------------------------------- /docs/img/sc_add_frameworks_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/sc_add_frameworks_sm.png -------------------------------------------------------------------------------- /docs/img/sc_add_tcmask_sm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/sc_add_tcmask_sm.png -------------------------------------------------------------------------------- /docs/img/viewmode1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/viewmode1.png -------------------------------------------------------------------------------- /docs/img/viewmode2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/viewmode2.png -------------------------------------------------------------------------------- /docs/img/viewmode3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TinyCrayon/TinyCrayon-iOS-SDK/3ba99ce46455c428944822c3726d2ad0810f962a/docs/img/viewmode3.png -------------------------------------------------------------------------------- /docs/js/index.js: -------------------------------------------------------------------------------- 1 | (function(factory){if(typeof define==='function'&&define.amd){define(['jquery'],factory)}else if(typeof exports==='object'){factory(require('jquery'))}else{factory(jQuery)}}(function($){var pluses=/\+/g;function encode(s){return config.raw?s:encodeURIComponent(s)}function decode(s){return config.raw?s:decodeURIComponent(s)}function stringifyCookieValue(value){return encode(config.json?JSON.stringify(value):String(value))}function parseCookieValue(s){if(s.indexOf('"')===0){s=s.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,'\\')}try{s=decodeURIComponent(s.replace(pluses,' '));return config.json?JSON.parse(s):s}catch(e){}}function read(s,converter){var value=config.raw?s:parseCookieValue(s);return $.isFunction(converter)?converter(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined&&!$.isFunction(value)){options=$.extend({},config.defaults,options);if(typeof options.expires==='number'){var days=options.expires,t=options.expires=new Date();t.setTime(+t+days*864e+5)}return(document.cookie=[encode(key),'=',stringifyCookieValue(value),options.expires?'; expires='+options.expires.toUTCString():'',options.path?'; path='+options.path:'',options.domain?'; domain='+options.domain:'',options.secure?'; secure':''].join(''))}var result=key?undefined:{};var cookies=document.cookie?document.cookie.split('; '):[];for(var i=0,l=cookies.length;i'); 30 | var item = data.Items[i]; 31 | tr.append($('').text(i + 1)); 32 | tr.append($('').text(item.bundleID)); 33 | tr.append($('').text(item.date)); 34 | tr.append($('').text(item.system)); 35 | tbody.append(tr); 36 | } 37 | } 38 | }); 39 | 40 | params = { 41 | TableName : "AndroidSubscription", 42 | } 43 | 44 | docClient.scan(params, function(err, data) { 45 | if (err) { 46 | $('#android-subscription-content .message').removeClass('hidden'); 47 | $('#android-subscription-content .message').text(err); 48 | $('#android-subscription-content .table').addClass('hidden'); 49 | console.log(err) 50 | } 51 | else { 52 | var tbody = $('#android-subscription-content table tbody'); 53 | for (var i = 0; i < data.Count; i++) { 54 | var tr = $(''); 55 | var item = data.Items[i]; 56 | tr.append($('').text(i + 1)); 57 | tr.append($('').text(item.email)); 58 | tbody.append(tr); 59 | } 60 | } 61 | }); 62 | --------------------------------------------------------------------------------