├── .gitignore ├── HZImageFilter ├── HZImageFilter.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata └── HZImageFilter │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard │ ├── Category │ ├── UIImage+Extension.h │ ├── UIImage+Extension.m │ ├── UIImageView+Gif.h │ └── UIImageView+Gif.m │ ├── Demo │ ├── Custom │ │ ├── HZFilterChainViewController.h │ │ └── HZFilterChainViewController.m │ ├── Detector │ │ ├── HZDetectorSampleViewController.h │ │ ├── HZDetectorSampleViewController.m │ │ ├── HZDetectorVideoViewController.h │ │ ├── HZDetectorVideoViewController.m │ │ ├── HZDetectorViewController.h │ │ └── HZDetectorViewController.m │ ├── Filters │ │ ├── HZCoreImageViewController.h │ │ └── HZCoreImageViewController.m │ ├── Tool.h │ └── Tool.m │ ├── Filter │ ├── HZChromaKeyFilter.h │ └── HZChromaKeyFilter.m │ ├── Resource │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── CustomFilter │ │ │ ├── Contents.json │ │ │ ├── greenBg.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── test.png │ │ │ ├── hueScale.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── hueScale.png │ │ │ └── resultBg.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── test1.jpg │ │ ├── Detector │ │ │ ├── Contents.json │ │ │ ├── detector.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── detector.png │ │ │ ├── detector2.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── img3.png │ │ │ ├── leftHeart.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── heart.png │ │ │ └── rightHeart.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── heart.png │ │ └── test.imageset │ │ │ ├── Contents.json │ │ │ └── ttttt.png │ ├── Info.plist │ ├── dataList.plist │ └── halo │ │ ├── halo_000.png │ │ ├── halo_001.png │ │ ├── halo_002.png │ │ ├── halo_003.png │ │ ├── halo_004.png │ │ ├── halo_005.png │ │ ├── halo_006.png │ │ ├── halo_007.png │ │ ├── halo_008.png │ │ ├── halo_009.png │ │ ├── halo_010.png │ │ ├── halo_011.png │ │ ├── halo_012.png │ │ ├── halo_013.png │ │ ├── halo_014.png │ │ ├── halo_015.png │ │ ├── halo_016.png │ │ ├── halo_017.png │ │ ├── halo_018.png │ │ ├── halo_019.png │ │ ├── halo_020.png │ │ ├── halo_021.png │ │ ├── halo_022.png │ │ ├── halo_023.png │ │ ├── halo_024.png │ │ ├── halo_025.png │ │ ├── halo_026.png │ │ ├── halo_027.png │ │ ├── halo_028.png │ │ ├── halo_029.png │ │ ├── halo_030.png │ │ ├── halo_031.png │ │ ├── halo_032.png │ │ ├── halo_033.png │ │ ├── halo_034.png │ │ ├── halo_035.png │ │ ├── halo_036.png │ │ ├── halo_037.png │ │ ├── halo_038.png │ │ ├── halo_039.png │ │ └── halo_040.png │ ├── Supporting Files │ └── main.m │ ├── ViewController.h │ └── ViewController.m ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xcuserstate 23 | 24 | ## Obj-C/Swift specific 25 | *.hmap 26 | *.ipa 27 | *.dSYM.zip 28 | *.dSYM 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | # Pods/ 37 | 38 | # Carthage 39 | # 40 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 41 | # Carthage/Checkouts 42 | 43 | Carthage/Build 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md 51 | 52 | fastlane/report.xml 53 | fastlane/screenshots 54 | 55 | #Code Injection 56 | # 57 | # After new code Injection tools there's a generated folder /iOSInjectionProject 58 | # https://github.com/johnno1962/injectionforxcode 59 | 60 | iOSInjectionProject/ 61 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 2505A24E1EB617C200BCC6AD /* dataList.plist in Resources */ = {isa = PBXBuildFile; fileRef = 2505A24D1EB617C200BCC6AD /* dataList.plist */; }; 11 | 2505A2521EB61CFD00BCC6AD /* HZCoreImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2505A2511EB61CFD00BCC6AD /* HZCoreImageViewController.m */; }; 12 | 2515155B1EB98748008321A3 /* Tool.m in Sources */ = {isa = PBXBuildFile; fileRef = 2515155A1EB98748008321A3 /* Tool.m */; }; 13 | 251541D81ECA9CDC00676235 /* HZChromaKeyFilter.m in Sources */ = {isa = PBXBuildFile; fileRef = 251541D71ECA9CDC00676235 /* HZChromaKeyFilter.m */; }; 14 | 2544B57B1EBB140C0036AA41 /* HZDetectorViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2544B57A1EBB140C0036AA41 /* HZDetectorViewController.m */; }; 15 | 256FFDA21EB4CECA0087FCE6 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 256FFDA11EB4CECA0087FCE6 /* main.m */; }; 16 | 256FFDA51EB4CECA0087FCE6 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 256FFDA41EB4CECA0087FCE6 /* AppDelegate.m */; }; 17 | 256FFDA81EB4CECA0087FCE6 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 256FFDA71EB4CECA0087FCE6 /* ViewController.m */; }; 18 | 256FFDAB1EB4CECA0087FCE6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 256FFDA91EB4CECA0087FCE6 /* Main.storyboard */; }; 19 | 256FFDAD1EB4CECA0087FCE6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 256FFDAC1EB4CECA0087FCE6 /* Assets.xcassets */; }; 20 | 256FFDB01EB4CECA0087FCE6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 256FFDAE1EB4CECA0087FCE6 /* LaunchScreen.storyboard */; }; 21 | 25A23EFC1ECBFD070083453C /* UIImageView+Gif.m in Sources */ = {isa = PBXBuildFile; fileRef = 25A23EFB1ECBFD070083453C /* UIImageView+Gif.m */; }; 22 | 25A4703F1ECC876D0044D92F /* HZDetectorSampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25A4703E1ECC876D0044D92F /* HZDetectorSampleViewController.m */; }; 23 | 25D488FF1ECC26CA00E01079 /* halo_000.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488D61ECC26CA00E01079 /* halo_000.png */; }; 24 | 25D489001ECC26CA00E01079 /* halo_001.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488D71ECC26CA00E01079 /* halo_001.png */; }; 25 | 25D489011ECC26CA00E01079 /* halo_002.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488D81ECC26CA00E01079 /* halo_002.png */; }; 26 | 25D489021ECC26CA00E01079 /* halo_003.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488D91ECC26CA00E01079 /* halo_003.png */; }; 27 | 25D489031ECC26CA00E01079 /* halo_004.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DA1ECC26CA00E01079 /* halo_004.png */; }; 28 | 25D489041ECC26CA00E01079 /* halo_005.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DB1ECC26CA00E01079 /* halo_005.png */; }; 29 | 25D489051ECC26CA00E01079 /* halo_006.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DC1ECC26CA00E01079 /* halo_006.png */; }; 30 | 25D489061ECC26CA00E01079 /* halo_007.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DD1ECC26CA00E01079 /* halo_007.png */; }; 31 | 25D489071ECC26CA00E01079 /* halo_008.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DE1ECC26CA00E01079 /* halo_008.png */; }; 32 | 25D489081ECC26CA00E01079 /* halo_009.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488DF1ECC26CA00E01079 /* halo_009.png */; }; 33 | 25D489091ECC26CA00E01079 /* halo_010.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E01ECC26CA00E01079 /* halo_010.png */; }; 34 | 25D4890A1ECC26CA00E01079 /* halo_011.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E11ECC26CA00E01079 /* halo_011.png */; }; 35 | 25D4890B1ECC26CA00E01079 /* halo_012.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E21ECC26CA00E01079 /* halo_012.png */; }; 36 | 25D4890C1ECC26CA00E01079 /* halo_013.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E31ECC26CA00E01079 /* halo_013.png */; }; 37 | 25D4890D1ECC26CA00E01079 /* halo_014.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E41ECC26CA00E01079 /* halo_014.png */; }; 38 | 25D4890E1ECC26CA00E01079 /* halo_015.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E51ECC26CA00E01079 /* halo_015.png */; }; 39 | 25D4890F1ECC26CA00E01079 /* halo_016.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E61ECC26CA00E01079 /* halo_016.png */; }; 40 | 25D489101ECC26CA00E01079 /* halo_017.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E71ECC26CA00E01079 /* halo_017.png */; }; 41 | 25D489111ECC26CA00E01079 /* halo_018.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E81ECC26CA00E01079 /* halo_018.png */; }; 42 | 25D489121ECC26CA00E01079 /* halo_019.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488E91ECC26CA00E01079 /* halo_019.png */; }; 43 | 25D489131ECC26CA00E01079 /* halo_020.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488EA1ECC26CA00E01079 /* halo_020.png */; }; 44 | 25D489141ECC26CA00E01079 /* halo_021.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488EB1ECC26CA00E01079 /* halo_021.png */; }; 45 | 25D489151ECC26CA00E01079 /* halo_022.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488EC1ECC26CA00E01079 /* halo_022.png */; }; 46 | 25D489161ECC26CA00E01079 /* halo_023.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488ED1ECC26CA00E01079 /* halo_023.png */; }; 47 | 25D489171ECC26CA00E01079 /* halo_024.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488EE1ECC26CA00E01079 /* halo_024.png */; }; 48 | 25D489181ECC26CA00E01079 /* halo_025.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488EF1ECC26CA00E01079 /* halo_025.png */; }; 49 | 25D489191ECC26CA00E01079 /* halo_026.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F01ECC26CA00E01079 /* halo_026.png */; }; 50 | 25D4891A1ECC26CA00E01079 /* halo_027.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F11ECC26CA00E01079 /* halo_027.png */; }; 51 | 25D4891B1ECC26CA00E01079 /* halo_028.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F21ECC26CA00E01079 /* halo_028.png */; }; 52 | 25D4891C1ECC26CA00E01079 /* halo_029.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F31ECC26CA00E01079 /* halo_029.png */; }; 53 | 25D4891D1ECC26CA00E01079 /* halo_030.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F41ECC26CA00E01079 /* halo_030.png */; }; 54 | 25D4891E1ECC26CA00E01079 /* halo_031.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F51ECC26CA00E01079 /* halo_031.png */; }; 55 | 25D4891F1ECC26CA00E01079 /* halo_032.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F61ECC26CA00E01079 /* halo_032.png */; }; 56 | 25D489201ECC26CA00E01079 /* halo_033.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F71ECC26CA00E01079 /* halo_033.png */; }; 57 | 25D489211ECC26CA00E01079 /* halo_034.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F81ECC26CA00E01079 /* halo_034.png */; }; 58 | 25D489221ECC26CA00E01079 /* halo_035.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488F91ECC26CA00E01079 /* halo_035.png */; }; 59 | 25D489231ECC26CA00E01079 /* halo_036.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488FA1ECC26CA00E01079 /* halo_036.png */; }; 60 | 25D489241ECC26CA00E01079 /* halo_037.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488FB1ECC26CA00E01079 /* halo_037.png */; }; 61 | 25D489251ECC26CA00E01079 /* halo_038.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488FC1ECC26CA00E01079 /* halo_038.png */; }; 62 | 25D489261ECC26CA00E01079 /* halo_039.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488FD1ECC26CA00E01079 /* halo_039.png */; }; 63 | 25D489271ECC26CA00E01079 /* halo_040.png in Resources */ = {isa = PBXBuildFile; fileRef = 25D488FE1ECC26CA00E01079 /* halo_040.png */; }; 64 | 25D4892A1ECC3CE900E01079 /* HZDetectorVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25D489291ECC3CE900E01079 /* HZDetectorVideoViewController.m */; }; 65 | 25D4892D1ECC450200E01079 /* UIImage+Extension.m in Sources */ = {isa = PBXBuildFile; fileRef = 25D4892C1ECC450200E01079 /* UIImage+Extension.m */; }; 66 | 25E01FFC1EB81EB90037CD2D /* HZFilterChainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 25E01FFB1EB81EB90037CD2D /* HZFilterChainViewController.m */; }; 67 | /* End PBXBuildFile section */ 68 | 69 | /* Begin PBXFileReference section */ 70 | 2505A24D1EB617C200BCC6AD /* dataList.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = dataList.plist; sourceTree = ""; }; 71 | 2505A2511EB61CFD00BCC6AD /* HZCoreImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZCoreImageViewController.m; sourceTree = ""; }; 72 | 2505A2531EB61D0D00BCC6AD /* HZCoreImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZCoreImageViewController.h; sourceTree = ""; }; 73 | 251515591EB98716008321A3 /* Tool.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Tool.h; sourceTree = ""; }; 74 | 2515155A1EB98748008321A3 /* Tool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Tool.m; sourceTree = ""; }; 75 | 251541D61ECA9BB100676235 /* HZChromaKeyFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZChromaKeyFilter.h; sourceTree = ""; }; 76 | 251541D71ECA9CDC00676235 /* HZChromaKeyFilter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZChromaKeyFilter.m; sourceTree = ""; }; 77 | 2544B5791EBB13FC0036AA41 /* HZDetectorViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZDetectorViewController.h; sourceTree = ""; }; 78 | 2544B57A1EBB140C0036AA41 /* HZDetectorViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZDetectorViewController.m; sourceTree = ""; }; 79 | 256FFD9D1EB4CECA0087FCE6 /* HZImageFilter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HZImageFilter.app; sourceTree = BUILT_PRODUCTS_DIR; }; 80 | 256FFDA11EB4CECA0087FCE6 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 81 | 256FFDA31EB4CECA0087FCE6 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 82 | 256FFDA41EB4CECA0087FCE6 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 83 | 256FFDA61EB4CECA0087FCE6 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 84 | 256FFDA71EB4CECA0087FCE6 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 85 | 256FFDAA1EB4CECA0087FCE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 86 | 256FFDAC1EB4CECA0087FCE6 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 87 | 256FFDAF1EB4CECA0087FCE6 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 88 | 256FFDB11EB4CECA0087FCE6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 89 | 25A23EFA1ECBFD070083453C /* UIImageView+Gif.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIImageView+Gif.h"; sourceTree = ""; }; 90 | 25A23EFB1ECBFD070083453C /* UIImageView+Gif.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+Gif.m"; sourceTree = ""; }; 91 | 25A4703D1ECC875C0044D92F /* HZDetectorSampleViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZDetectorSampleViewController.h; sourceTree = ""; }; 92 | 25A4703E1ECC876D0044D92F /* HZDetectorSampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZDetectorSampleViewController.m; sourceTree = ""; }; 93 | 25D488D61ECC26CA00E01079 /* halo_000.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_000.png; sourceTree = ""; }; 94 | 25D488D71ECC26CA00E01079 /* halo_001.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_001.png; sourceTree = ""; }; 95 | 25D488D81ECC26CA00E01079 /* halo_002.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_002.png; sourceTree = ""; }; 96 | 25D488D91ECC26CA00E01079 /* halo_003.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_003.png; sourceTree = ""; }; 97 | 25D488DA1ECC26CA00E01079 /* halo_004.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_004.png; sourceTree = ""; }; 98 | 25D488DB1ECC26CA00E01079 /* halo_005.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_005.png; sourceTree = ""; }; 99 | 25D488DC1ECC26CA00E01079 /* halo_006.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_006.png; sourceTree = ""; }; 100 | 25D488DD1ECC26CA00E01079 /* halo_007.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_007.png; sourceTree = ""; }; 101 | 25D488DE1ECC26CA00E01079 /* halo_008.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_008.png; sourceTree = ""; }; 102 | 25D488DF1ECC26CA00E01079 /* halo_009.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_009.png; sourceTree = ""; }; 103 | 25D488E01ECC26CA00E01079 /* halo_010.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_010.png; sourceTree = ""; }; 104 | 25D488E11ECC26CA00E01079 /* halo_011.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_011.png; sourceTree = ""; }; 105 | 25D488E21ECC26CA00E01079 /* halo_012.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_012.png; sourceTree = ""; }; 106 | 25D488E31ECC26CA00E01079 /* halo_013.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_013.png; sourceTree = ""; }; 107 | 25D488E41ECC26CA00E01079 /* halo_014.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_014.png; sourceTree = ""; }; 108 | 25D488E51ECC26CA00E01079 /* halo_015.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_015.png; sourceTree = ""; }; 109 | 25D488E61ECC26CA00E01079 /* halo_016.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_016.png; sourceTree = ""; }; 110 | 25D488E71ECC26CA00E01079 /* halo_017.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_017.png; sourceTree = ""; }; 111 | 25D488E81ECC26CA00E01079 /* halo_018.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_018.png; sourceTree = ""; }; 112 | 25D488E91ECC26CA00E01079 /* halo_019.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_019.png; sourceTree = ""; }; 113 | 25D488EA1ECC26CA00E01079 /* halo_020.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_020.png; sourceTree = ""; }; 114 | 25D488EB1ECC26CA00E01079 /* halo_021.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_021.png; sourceTree = ""; }; 115 | 25D488EC1ECC26CA00E01079 /* halo_022.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_022.png; sourceTree = ""; }; 116 | 25D488ED1ECC26CA00E01079 /* halo_023.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_023.png; sourceTree = ""; }; 117 | 25D488EE1ECC26CA00E01079 /* halo_024.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_024.png; sourceTree = ""; }; 118 | 25D488EF1ECC26CA00E01079 /* halo_025.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_025.png; sourceTree = ""; }; 119 | 25D488F01ECC26CA00E01079 /* halo_026.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_026.png; sourceTree = ""; }; 120 | 25D488F11ECC26CA00E01079 /* halo_027.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_027.png; sourceTree = ""; }; 121 | 25D488F21ECC26CA00E01079 /* halo_028.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_028.png; sourceTree = ""; }; 122 | 25D488F31ECC26CA00E01079 /* halo_029.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_029.png; sourceTree = ""; }; 123 | 25D488F41ECC26CA00E01079 /* halo_030.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_030.png; sourceTree = ""; }; 124 | 25D488F51ECC26CA00E01079 /* halo_031.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_031.png; sourceTree = ""; }; 125 | 25D488F61ECC26CA00E01079 /* halo_032.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_032.png; sourceTree = ""; }; 126 | 25D488F71ECC26CA00E01079 /* halo_033.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_033.png; sourceTree = ""; }; 127 | 25D488F81ECC26CA00E01079 /* halo_034.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_034.png; sourceTree = ""; }; 128 | 25D488F91ECC26CA00E01079 /* halo_035.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_035.png; sourceTree = ""; }; 129 | 25D488FA1ECC26CA00E01079 /* halo_036.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_036.png; sourceTree = ""; }; 130 | 25D488FB1ECC26CA00E01079 /* halo_037.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_037.png; sourceTree = ""; }; 131 | 25D488FC1ECC26CA00E01079 /* halo_038.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_038.png; sourceTree = ""; }; 132 | 25D488FD1ECC26CA00E01079 /* halo_039.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_039.png; sourceTree = ""; }; 133 | 25D488FE1ECC26CA00E01079 /* halo_040.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = halo_040.png; sourceTree = ""; }; 134 | 25D489281ECC3CDA00E01079 /* HZDetectorVideoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZDetectorVideoViewController.h; sourceTree = ""; }; 135 | 25D489291ECC3CE900E01079 /* HZDetectorVideoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZDetectorVideoViewController.m; sourceTree = ""; }; 136 | 25D4892B1ECC44F400E01079 /* UIImage+Extension.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+Extension.h"; sourceTree = ""; }; 137 | 25D4892C1ECC450200E01079 /* UIImage+Extension.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIImage+Extension.m"; sourceTree = ""; }; 138 | 25E01FFB1EB81EB90037CD2D /* HZFilterChainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HZFilterChainViewController.m; sourceTree = ""; }; 139 | 25E01FFD1EB81ECA0037CD2D /* HZFilterChainViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HZFilterChainViewController.h; sourceTree = ""; }; 140 | /* End PBXFileReference section */ 141 | 142 | /* Begin PBXFrameworksBuildPhase section */ 143 | 256FFD9A1EB4CECA0087FCE6 /* Frameworks */ = { 144 | isa = PBXFrameworksBuildPhase; 145 | buildActionMask = 2147483647; 146 | files = ( 147 | ); 148 | runOnlyForDeploymentPostprocessing = 0; 149 | }; 150 | /* End PBXFrameworksBuildPhase section */ 151 | 152 | /* Begin PBXGroup section */ 153 | 2505A24F1EB61CAB00BCC6AD /* Demo */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | 25E01FFF1EB822940037CD2D /* FilterChain(滤镜链) */, 157 | 2544B5781EBB13EB0036AA41 /* Detector(识别) */, 158 | 25E01FFE1EB822830037CD2D /* Filters(单滤镜) */, 159 | 251515591EB98716008321A3 /* Tool.h */, 160 | 2515155A1EB98748008321A3 /* Tool.m */, 161 | ); 162 | path = Demo; 163 | sourceTree = ""; 164 | }; 165 | 2505A2501EB61CBA00BCC6AD /* Resource */ = { 166 | isa = PBXGroup; 167 | children = ( 168 | 25D488D51ECC26CA00E01079 /* halo */, 169 | 256FFDAC1EB4CECA0087FCE6 /* Assets.xcassets */, 170 | 256FFDB11EB4CECA0087FCE6 /* Info.plist */, 171 | 2505A24D1EB617C200BCC6AD /* dataList.plist */, 172 | ); 173 | path = Resource; 174 | sourceTree = ""; 175 | }; 176 | 251541D51ECA9B7D00676235 /* Filter */ = { 177 | isa = PBXGroup; 178 | children = ( 179 | 251541D61ECA9BB100676235 /* HZChromaKeyFilter.h */, 180 | 251541D71ECA9CDC00676235 /* HZChromaKeyFilter.m */, 181 | ); 182 | path = Filter; 183 | sourceTree = ""; 184 | }; 185 | 2544B5781EBB13EB0036AA41 /* Detector(识别) */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | 2597F27A1ED08C4600CDC2CE /* Image */, 189 | 2597F2791ED08C3E00CDC2CE /* Video */, 190 | ); 191 | name = "Detector(识别)"; 192 | path = Detector; 193 | sourceTree = ""; 194 | }; 195 | 256FFD941EB4CECA0087FCE6 = { 196 | isa = PBXGroup; 197 | children = ( 198 | 256FFD9F1EB4CECA0087FCE6 /* HZImageFilter */, 199 | 256FFD9E1EB4CECA0087FCE6 /* Products */, 200 | ); 201 | sourceTree = ""; 202 | }; 203 | 256FFD9E1EB4CECA0087FCE6 /* Products */ = { 204 | isa = PBXGroup; 205 | children = ( 206 | 256FFD9D1EB4CECA0087FCE6 /* HZImageFilter.app */, 207 | ); 208 | name = Products; 209 | sourceTree = ""; 210 | }; 211 | 256FFD9F1EB4CECA0087FCE6 /* HZImageFilter */ = { 212 | isa = PBXGroup; 213 | children = ( 214 | 25A23EFD1ECBFD100083453C /* Category */, 215 | 2505A24F1EB61CAB00BCC6AD /* Demo */, 216 | 251541D51ECA9B7D00676235 /* Filter */, 217 | 2505A2501EB61CBA00BCC6AD /* Resource */, 218 | 256FFDA01EB4CECA0087FCE6 /* Supporting Files */, 219 | 256FFDA31EB4CECA0087FCE6 /* AppDelegate.h */, 220 | 256FFDA41EB4CECA0087FCE6 /* AppDelegate.m */, 221 | 256FFDAE1EB4CECA0087FCE6 /* LaunchScreen.storyboard */, 222 | 256FFDA91EB4CECA0087FCE6 /* Main.storyboard */, 223 | 256FFDA61EB4CECA0087FCE6 /* ViewController.h */, 224 | 256FFDA71EB4CECA0087FCE6 /* ViewController.m */, 225 | ); 226 | path = HZImageFilter; 227 | sourceTree = ""; 228 | }; 229 | 256FFDA01EB4CECA0087FCE6 /* Supporting Files */ = { 230 | isa = PBXGroup; 231 | children = ( 232 | 256FFDA11EB4CECA0087FCE6 /* main.m */, 233 | ); 234 | path = "Supporting Files"; 235 | sourceTree = ""; 236 | }; 237 | 2597F2791ED08C3E00CDC2CE /* Video */ = { 238 | isa = PBXGroup; 239 | children = ( 240 | 25A4703D1ECC875C0044D92F /* HZDetectorSampleViewController.h */, 241 | 25A4703E1ECC876D0044D92F /* HZDetectorSampleViewController.m */, 242 | 25D489281ECC3CDA00E01079 /* HZDetectorVideoViewController.h */, 243 | 25D489291ECC3CE900E01079 /* HZDetectorVideoViewController.m */, 244 | ); 245 | name = Video; 246 | sourceTree = ""; 247 | }; 248 | 2597F27A1ED08C4600CDC2CE /* Image */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | 2544B5791EBB13FC0036AA41 /* HZDetectorViewController.h */, 252 | 2544B57A1EBB140C0036AA41 /* HZDetectorViewController.m */, 253 | ); 254 | name = Image; 255 | sourceTree = ""; 256 | }; 257 | 25A23EFD1ECBFD100083453C /* Category */ = { 258 | isa = PBXGroup; 259 | children = ( 260 | 25D4892B1ECC44F400E01079 /* UIImage+Extension.h */, 261 | 25D4892C1ECC450200E01079 /* UIImage+Extension.m */, 262 | 25A23EFA1ECBFD070083453C /* UIImageView+Gif.h */, 263 | 25A23EFB1ECBFD070083453C /* UIImageView+Gif.m */, 264 | ); 265 | path = Category; 266 | sourceTree = ""; 267 | }; 268 | 25D488D51ECC26CA00E01079 /* halo */ = { 269 | isa = PBXGroup; 270 | children = ( 271 | 25D488D61ECC26CA00E01079 /* halo_000.png */, 272 | 25D488D71ECC26CA00E01079 /* halo_001.png */, 273 | 25D488D81ECC26CA00E01079 /* halo_002.png */, 274 | 25D488D91ECC26CA00E01079 /* halo_003.png */, 275 | 25D488DA1ECC26CA00E01079 /* halo_004.png */, 276 | 25D488DB1ECC26CA00E01079 /* halo_005.png */, 277 | 25D488DC1ECC26CA00E01079 /* halo_006.png */, 278 | 25D488DD1ECC26CA00E01079 /* halo_007.png */, 279 | 25D488DE1ECC26CA00E01079 /* halo_008.png */, 280 | 25D488DF1ECC26CA00E01079 /* halo_009.png */, 281 | 25D488E01ECC26CA00E01079 /* halo_010.png */, 282 | 25D488E11ECC26CA00E01079 /* halo_011.png */, 283 | 25D488E21ECC26CA00E01079 /* halo_012.png */, 284 | 25D488E31ECC26CA00E01079 /* halo_013.png */, 285 | 25D488E41ECC26CA00E01079 /* halo_014.png */, 286 | 25D488E51ECC26CA00E01079 /* halo_015.png */, 287 | 25D488E61ECC26CA00E01079 /* halo_016.png */, 288 | 25D488E71ECC26CA00E01079 /* halo_017.png */, 289 | 25D488E81ECC26CA00E01079 /* halo_018.png */, 290 | 25D488E91ECC26CA00E01079 /* halo_019.png */, 291 | 25D488EA1ECC26CA00E01079 /* halo_020.png */, 292 | 25D488EB1ECC26CA00E01079 /* halo_021.png */, 293 | 25D488EC1ECC26CA00E01079 /* halo_022.png */, 294 | 25D488ED1ECC26CA00E01079 /* halo_023.png */, 295 | 25D488EE1ECC26CA00E01079 /* halo_024.png */, 296 | 25D488EF1ECC26CA00E01079 /* halo_025.png */, 297 | 25D488F01ECC26CA00E01079 /* halo_026.png */, 298 | 25D488F11ECC26CA00E01079 /* halo_027.png */, 299 | 25D488F21ECC26CA00E01079 /* halo_028.png */, 300 | 25D488F31ECC26CA00E01079 /* halo_029.png */, 301 | 25D488F41ECC26CA00E01079 /* halo_030.png */, 302 | 25D488F51ECC26CA00E01079 /* halo_031.png */, 303 | 25D488F61ECC26CA00E01079 /* halo_032.png */, 304 | 25D488F71ECC26CA00E01079 /* halo_033.png */, 305 | 25D488F81ECC26CA00E01079 /* halo_034.png */, 306 | 25D488F91ECC26CA00E01079 /* halo_035.png */, 307 | 25D488FA1ECC26CA00E01079 /* halo_036.png */, 308 | 25D488FB1ECC26CA00E01079 /* halo_037.png */, 309 | 25D488FC1ECC26CA00E01079 /* halo_038.png */, 310 | 25D488FD1ECC26CA00E01079 /* halo_039.png */, 311 | 25D488FE1ECC26CA00E01079 /* halo_040.png */, 312 | ); 313 | path = halo; 314 | sourceTree = ""; 315 | }; 316 | 25E01FFE1EB822830037CD2D /* Filters(单滤镜) */ = { 317 | isa = PBXGroup; 318 | children = ( 319 | 2505A2531EB61D0D00BCC6AD /* HZCoreImageViewController.h */, 320 | 2505A2511EB61CFD00BCC6AD /* HZCoreImageViewController.m */, 321 | ); 322 | name = "Filters(单滤镜)"; 323 | path = Filters; 324 | sourceTree = ""; 325 | }; 326 | 25E01FFF1EB822940037CD2D /* FilterChain(滤镜链) */ = { 327 | isa = PBXGroup; 328 | children = ( 329 | 25E01FFD1EB81ECA0037CD2D /* HZFilterChainViewController.h */, 330 | 25E01FFB1EB81EB90037CD2D /* HZFilterChainViewController.m */, 331 | ); 332 | name = "FilterChain(滤镜链)"; 333 | path = Custom; 334 | sourceTree = ""; 335 | }; 336 | /* End PBXGroup section */ 337 | 338 | /* Begin PBXNativeTarget section */ 339 | 256FFD9C1EB4CECA0087FCE6 /* HZImageFilter */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = 256FFDB41EB4CECA0087FCE6 /* Build configuration list for PBXNativeTarget "HZImageFilter" */; 342 | buildPhases = ( 343 | 256FFD991EB4CECA0087FCE6 /* Sources */, 344 | 256FFD9A1EB4CECA0087FCE6 /* Frameworks */, 345 | 256FFD9B1EB4CECA0087FCE6 /* Resources */, 346 | ); 347 | buildRules = ( 348 | ); 349 | dependencies = ( 350 | ); 351 | name = HZImageFilter; 352 | productName = HZImageFilter; 353 | productReference = 256FFD9D1EB4CECA0087FCE6 /* HZImageFilter.app */; 354 | productType = "com.apple.product-type.application"; 355 | }; 356 | /* End PBXNativeTarget section */ 357 | 358 | /* Begin PBXProject section */ 359 | 256FFD951EB4CECA0087FCE6 /* Project object */ = { 360 | isa = PBXProject; 361 | attributes = { 362 | LastUpgradeCheck = 0830; 363 | ORGANIZATIONNAME = zzgo; 364 | TargetAttributes = { 365 | 256FFD9C1EB4CECA0087FCE6 = { 366 | CreatedOnToolsVersion = 8.3.2; 367 | DevelopmentTeam = 4GK5VN4446; 368 | ProvisioningStyle = Automatic; 369 | }; 370 | }; 371 | }; 372 | buildConfigurationList = 256FFD981EB4CECA0087FCE6 /* Build configuration list for PBXProject "HZImageFilter" */; 373 | compatibilityVersion = "Xcode 3.2"; 374 | developmentRegion = English; 375 | hasScannedForEncodings = 0; 376 | knownRegions = ( 377 | en, 378 | Base, 379 | ); 380 | mainGroup = 256FFD941EB4CECA0087FCE6; 381 | productRefGroup = 256FFD9E1EB4CECA0087FCE6 /* Products */; 382 | projectDirPath = ""; 383 | projectRoot = ""; 384 | targets = ( 385 | 256FFD9C1EB4CECA0087FCE6 /* HZImageFilter */, 386 | ); 387 | }; 388 | /* End PBXProject section */ 389 | 390 | /* Begin PBXResourcesBuildPhase section */ 391 | 256FFD9B1EB4CECA0087FCE6 /* Resources */ = { 392 | isa = PBXResourcesBuildPhase; 393 | buildActionMask = 2147483647; 394 | files = ( 395 | 25D4890C1ECC26CA00E01079 /* halo_013.png in Resources */, 396 | 25D489031ECC26CA00E01079 /* halo_004.png in Resources */, 397 | 256FFDB01EB4CECA0087FCE6 /* LaunchScreen.storyboard in Resources */, 398 | 25D489211ECC26CA00E01079 /* halo_034.png in Resources */, 399 | 25D489161ECC26CA00E01079 /* halo_023.png in Resources */, 400 | 25D489141ECC26CA00E01079 /* halo_021.png in Resources */, 401 | 256FFDAD1EB4CECA0087FCE6 /* Assets.xcassets in Resources */, 402 | 25D489131ECC26CA00E01079 /* halo_020.png in Resources */, 403 | 25D4891C1ECC26CA00E01079 /* halo_029.png in Resources */, 404 | 25D489271ECC26CA00E01079 /* halo_040.png in Resources */, 405 | 25D4890E1ECC26CA00E01079 /* halo_015.png in Resources */, 406 | 25D4891D1ECC26CA00E01079 /* halo_030.png in Resources */, 407 | 25D489201ECC26CA00E01079 /* halo_033.png in Resources */, 408 | 25D489251ECC26CA00E01079 /* halo_038.png in Resources */, 409 | 25D489071ECC26CA00E01079 /* halo_008.png in Resources */, 410 | 25D489181ECC26CA00E01079 /* halo_025.png in Resources */, 411 | 25D4890A1ECC26CA00E01079 /* halo_011.png in Resources */, 412 | 25D489151ECC26CA00E01079 /* halo_022.png in Resources */, 413 | 25D489231ECC26CA00E01079 /* halo_036.png in Resources */, 414 | 2505A24E1EB617C200BCC6AD /* dataList.plist in Resources */, 415 | 25D489081ECC26CA00E01079 /* halo_009.png in Resources */, 416 | 25D4890B1ECC26CA00E01079 /* halo_012.png in Resources */, 417 | 25D4891B1ECC26CA00E01079 /* halo_028.png in Resources */, 418 | 25D4891E1ECC26CA00E01079 /* halo_031.png in Resources */, 419 | 25D489001ECC26CA00E01079 /* halo_001.png in Resources */, 420 | 25D4890D1ECC26CA00E01079 /* halo_014.png in Resources */, 421 | 25D489121ECC26CA00E01079 /* halo_019.png in Resources */, 422 | 256FFDAB1EB4CECA0087FCE6 /* Main.storyboard in Resources */, 423 | 25D489021ECC26CA00E01079 /* halo_003.png in Resources */, 424 | 25D489091ECC26CA00E01079 /* halo_010.png in Resources */, 425 | 25D489191ECC26CA00E01079 /* halo_026.png in Resources */, 426 | 25D489011ECC26CA00E01079 /* halo_002.png in Resources */, 427 | 25D489241ECC26CA00E01079 /* halo_037.png in Resources */, 428 | 25D4891F1ECC26CA00E01079 /* halo_032.png in Resources */, 429 | 25D488FF1ECC26CA00E01079 /* halo_000.png in Resources */, 430 | 25D489261ECC26CA00E01079 /* halo_039.png in Resources */, 431 | 25D489061ECC26CA00E01079 /* halo_007.png in Resources */, 432 | 25D489111ECC26CA00E01079 /* halo_018.png in Resources */, 433 | 25D489101ECC26CA00E01079 /* halo_017.png in Resources */, 434 | 25D489221ECC26CA00E01079 /* halo_035.png in Resources */, 435 | 25D4891A1ECC26CA00E01079 /* halo_027.png in Resources */, 436 | 25D4890F1ECC26CA00E01079 /* halo_016.png in Resources */, 437 | 25D489041ECC26CA00E01079 /* halo_005.png in Resources */, 438 | 25D489051ECC26CA00E01079 /* halo_006.png in Resources */, 439 | 25D489171ECC26CA00E01079 /* halo_024.png in Resources */, 440 | ); 441 | runOnlyForDeploymentPostprocessing = 0; 442 | }; 443 | /* End PBXResourcesBuildPhase section */ 444 | 445 | /* Begin PBXSourcesBuildPhase section */ 446 | 256FFD991EB4CECA0087FCE6 /* Sources */ = { 447 | isa = PBXSourcesBuildPhase; 448 | buildActionMask = 2147483647; 449 | files = ( 450 | 2544B57B1EBB140C0036AA41 /* HZDetectorViewController.m in Sources */, 451 | 25A4703F1ECC876D0044D92F /* HZDetectorSampleViewController.m in Sources */, 452 | 256FFDA81EB4CECA0087FCE6 /* ViewController.m in Sources */, 453 | 25D4892D1ECC450200E01079 /* UIImage+Extension.m in Sources */, 454 | 25D4892A1ECC3CE900E01079 /* HZDetectorVideoViewController.m in Sources */, 455 | 256FFDA51EB4CECA0087FCE6 /* AppDelegate.m in Sources */, 456 | 25E01FFC1EB81EB90037CD2D /* HZFilterChainViewController.m in Sources */, 457 | 25A23EFC1ECBFD070083453C /* UIImageView+Gif.m in Sources */, 458 | 256FFDA21EB4CECA0087FCE6 /* main.m in Sources */, 459 | 2505A2521EB61CFD00BCC6AD /* HZCoreImageViewController.m in Sources */, 460 | 251541D81ECA9CDC00676235 /* HZChromaKeyFilter.m in Sources */, 461 | 2515155B1EB98748008321A3 /* Tool.m in Sources */, 462 | ); 463 | runOnlyForDeploymentPostprocessing = 0; 464 | }; 465 | /* End PBXSourcesBuildPhase section */ 466 | 467 | /* Begin PBXVariantGroup section */ 468 | 256FFDA91EB4CECA0087FCE6 /* Main.storyboard */ = { 469 | isa = PBXVariantGroup; 470 | children = ( 471 | 256FFDAA1EB4CECA0087FCE6 /* Base */, 472 | ); 473 | name = Main.storyboard; 474 | path = .; 475 | sourceTree = ""; 476 | }; 477 | 256FFDAE1EB4CECA0087FCE6 /* LaunchScreen.storyboard */ = { 478 | isa = PBXVariantGroup; 479 | children = ( 480 | 256FFDAF1EB4CECA0087FCE6 /* Base */, 481 | ); 482 | name = LaunchScreen.storyboard; 483 | path = .; 484 | sourceTree = ""; 485 | }; 486 | /* End PBXVariantGroup section */ 487 | 488 | /* Begin XCBuildConfiguration section */ 489 | 256FFDB21EB4CECA0087FCE6 /* Debug */ = { 490 | isa = XCBuildConfiguration; 491 | buildSettings = { 492 | ALWAYS_SEARCH_USER_PATHS = NO; 493 | CLANG_ANALYZER_NONNULL = YES; 494 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 495 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 496 | CLANG_CXX_LIBRARY = "libc++"; 497 | CLANG_ENABLE_MODULES = YES; 498 | CLANG_ENABLE_OBJC_ARC = YES; 499 | CLANG_WARN_BOOL_CONVERSION = YES; 500 | CLANG_WARN_CONSTANT_CONVERSION = YES; 501 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 502 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 503 | CLANG_WARN_EMPTY_BODY = YES; 504 | CLANG_WARN_ENUM_CONVERSION = YES; 505 | CLANG_WARN_INFINITE_RECURSION = YES; 506 | CLANG_WARN_INT_CONVERSION = YES; 507 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 508 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 509 | CLANG_WARN_UNREACHABLE_CODE = YES; 510 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 511 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 512 | COPY_PHASE_STRIP = NO; 513 | DEBUG_INFORMATION_FORMAT = dwarf; 514 | ENABLE_STRICT_OBJC_MSGSEND = YES; 515 | ENABLE_TESTABILITY = YES; 516 | GCC_C_LANGUAGE_STANDARD = gnu99; 517 | GCC_DYNAMIC_NO_PIC = NO; 518 | GCC_NO_COMMON_BLOCKS = YES; 519 | GCC_OPTIMIZATION_LEVEL = 0; 520 | GCC_PREPROCESSOR_DEFINITIONS = ( 521 | "DEBUG=1", 522 | "$(inherited)", 523 | ); 524 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 525 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 526 | GCC_WARN_UNDECLARED_SELECTOR = YES; 527 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 528 | GCC_WARN_UNUSED_FUNCTION = YES; 529 | GCC_WARN_UNUSED_VARIABLE = YES; 530 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 531 | MTL_ENABLE_DEBUG_INFO = YES; 532 | ONLY_ACTIVE_ARCH = YES; 533 | SDKROOT = iphoneos; 534 | }; 535 | name = Debug; 536 | }; 537 | 256FFDB31EB4CECA0087FCE6 /* Release */ = { 538 | isa = XCBuildConfiguration; 539 | buildSettings = { 540 | ALWAYS_SEARCH_USER_PATHS = NO; 541 | CLANG_ANALYZER_NONNULL = YES; 542 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 543 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 544 | CLANG_CXX_LIBRARY = "libc++"; 545 | CLANG_ENABLE_MODULES = YES; 546 | CLANG_ENABLE_OBJC_ARC = YES; 547 | CLANG_WARN_BOOL_CONVERSION = YES; 548 | CLANG_WARN_CONSTANT_CONVERSION = YES; 549 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 550 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 551 | CLANG_WARN_EMPTY_BODY = YES; 552 | CLANG_WARN_ENUM_CONVERSION = YES; 553 | CLANG_WARN_INFINITE_RECURSION = YES; 554 | CLANG_WARN_INT_CONVERSION = YES; 555 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 556 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 557 | CLANG_WARN_UNREACHABLE_CODE = YES; 558 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 559 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 560 | COPY_PHASE_STRIP = NO; 561 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 562 | ENABLE_NS_ASSERTIONS = NO; 563 | ENABLE_STRICT_OBJC_MSGSEND = YES; 564 | GCC_C_LANGUAGE_STANDARD = gnu99; 565 | GCC_NO_COMMON_BLOCKS = YES; 566 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 567 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 568 | GCC_WARN_UNDECLARED_SELECTOR = YES; 569 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 570 | GCC_WARN_UNUSED_FUNCTION = YES; 571 | GCC_WARN_UNUSED_VARIABLE = YES; 572 | IPHONEOS_DEPLOYMENT_TARGET = 10.3; 573 | MTL_ENABLE_DEBUG_INFO = NO; 574 | SDKROOT = iphoneos; 575 | VALIDATE_PRODUCT = YES; 576 | }; 577 | name = Release; 578 | }; 579 | 256FFDB51EB4CECA0087FCE6 /* Debug */ = { 580 | isa = XCBuildConfiguration; 581 | buildSettings = { 582 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 583 | DEVELOPMENT_TEAM = 4GK5VN4446; 584 | INFOPLIST_FILE = HZImageFilter/Resource/Info.plist; 585 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 586 | PRODUCT_BUNDLE_IDENTIFIER = com.zzgo.HZImageFilter; 587 | PRODUCT_NAME = "$(TARGET_NAME)"; 588 | }; 589 | name = Debug; 590 | }; 591 | 256FFDB61EB4CECA0087FCE6 /* Release */ = { 592 | isa = XCBuildConfiguration; 593 | buildSettings = { 594 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 595 | DEVELOPMENT_TEAM = 4GK5VN4446; 596 | INFOPLIST_FILE = HZImageFilter/Resource/Info.plist; 597 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 598 | PRODUCT_BUNDLE_IDENTIFIER = com.zzgo.HZImageFilter; 599 | PRODUCT_NAME = "$(TARGET_NAME)"; 600 | }; 601 | name = Release; 602 | }; 603 | /* End XCBuildConfiguration section */ 604 | 605 | /* Begin XCConfigurationList section */ 606 | 256FFD981EB4CECA0087FCE6 /* Build configuration list for PBXProject "HZImageFilter" */ = { 607 | isa = XCConfigurationList; 608 | buildConfigurations = ( 609 | 256FFDB21EB4CECA0087FCE6 /* Debug */, 610 | 256FFDB31EB4CECA0087FCE6 /* Release */, 611 | ); 612 | defaultConfigurationIsVisible = 0; 613 | defaultConfigurationName = Release; 614 | }; 615 | 256FFDB41EB4CECA0087FCE6 /* Build configuration list for PBXNativeTarget "HZImageFilter" */ = { 616 | isa = XCConfigurationList; 617 | buildConfigurations = ( 618 | 256FFDB51EB4CECA0087FCE6 /* Debug */, 619 | 256FFDB61EB4CECA0087FCE6 /* Release */, 620 | ); 621 | defaultConfigurationIsVisible = 0; 622 | defaultConfigurationName = Release; 623 | }; 624 | /* End XCConfigurationList section */ 625 | }; 626 | rootObject = 256FFD951EB4CECA0087FCE6 /* Project object */; 627 | } 628 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/29. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | @property (strong, nonatomic) UIWindow *window; 13 | @end 14 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/29. 6 | // Copyright © 2017年 zzgo. 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 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/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 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Category/UIImage+Extension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface UIImage (Extension) 11 | -(UIImage*)convertViewToImage:(UIView*)v; 12 | @end 13 | 14 | @interface CIImage (Extension) 15 | -(UIImage*)convertViewToImage:(UIView*)v; 16 | @end 17 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Category/UIImage+Extension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+Extension.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "UIImage+Extension.h" 10 | 11 | @implementation UIImage (Extension) 12 | 13 | -(UIImage*)convertViewToImage:(UIView*)v{ 14 | CGSize s = v.bounds.size; 15 | // 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了 16 | UIGraphicsBeginImageContextWithOptions(s, NO, [UIScreen mainScreen].scale); 17 | [v.layer renderInContext:UIGraphicsGetCurrentContext()]; 18 | UIImage*image = UIGraphicsGetImageFromCurrentImageContext(); 19 | UIGraphicsEndImageContext(); 20 | return image; 21 | } 22 | 23 | @end 24 | 25 | @implementation CIImage (Extension) 26 | 27 | -(UIImage*)convertViewToImage:(UIView*)v{ 28 | CGSize s = v.bounds.size; 29 | // 下面方法,第一个参数表示区域大小。第二个参数表示是否是非透明的。如果需要显示半透明效果,需要传NO,否则传YES。第三个参数就是屏幕密度了 30 | UIGraphicsBeginImageContextWithOptions(s, NO, [UIScreen mainScreen].scale); 31 | [v.layer renderInContext:UIGraphicsGetCurrentContext()]; 32 | UIImage*image = UIGraphicsGetImageFromCurrentImageContext(); 33 | UIGraphicsEndImageContext(); 34 | return image; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Category/UIImageView+Gif.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Gif.h 3 | // QLiveStream 4 | // 5 | // Created by quseit02 on 16/8/2. 6 | // Copyright © 2016年 quseit. All rights reserved. 7 | // 8 | 9 | #import 10 | @interface UIImageView (Gif) 11 | // 播放GIF 12 | - (void)playGifAnim:(NSArray *)images; 13 | // 停止动画 14 | - (void)stopGifAnim; 15 | @end 16 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Category/UIImageView+Gif.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+Gif.m 3 | // QLiveStream 4 | // 5 | // Created by quseit02 on 16/8/2. 6 | // Copyright © 2016年 quseit. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+Gif.h" 10 | @implementation UIImageView (Gif) 11 | // 播放GIF 12 | - (void)playGifAnim:(NSArray *)images 13 | { 14 | if (!images.count) { 15 | return; 16 | } 17 | //动画图片数组 18 | self.animationImages = images; 19 | //执行一次完整动画所需的时长 20 | self.animationDuration = 1.0; // 0.5; 21 | //动画重复次数, 设置成0 就是无限循环 22 | self.animationRepeatCount = 0; 23 | [self startAnimating]; 24 | } 25 | // 停止动画 26 | - (void)stopGifAnim 27 | { 28 | if (self.isAnimating) { 29 | [self stopAnimating]; 30 | } 31 | [self removeFromSuperview]; 32 | } 33 | @end 34 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Custom/HZFilterChainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZCustomFilterViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/2. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZFilterChainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Custom/HZFilterChainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZFilterChainViewController .m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/2. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "HZFilterChainViewController.h" 10 | #import "HZChromaKeyFilter.h" 11 | 12 | 13 | @interface HZFilterChainViewController () 14 | @property (weak, nonatomic) IBOutlet UIImageView *greenImageView; 15 | @property (weak, nonatomic) IBOutlet UIImageView *resultBgImageView; 16 | @property (weak, nonatomic) IBOutlet UIImageView *resultImageView; 17 | 18 | @property (nonatomic,readwrite,strong) UIImagePickerController *imagePicker; 19 | @property (nonatomic,readwrite,strong) UIView *selectedView; 20 | @end 21 | 22 | 23 | @implementation HZFilterChainViewController 24 | 25 | -(void)viewDidLoad{ 26 | [super viewDidLoad]; 27 | 28 | [self hz_addView:self.greenImageView touchAction:@selector(tapImgView:)]; 29 | [self hz_addView:self.resultBgImageView touchAction:@selector(tapImgView:)]; 30 | } 31 | 32 | 33 | #pragma mark - UIImagePickerControllerDelegate 34 | -(void)imagePickerControllerDidCancel:(UIImagePickerController *)picker{ 35 | [picker dismissViewControllerAnimated:YES completion:nil]; 36 | } 37 | 38 | - (void)imagePickerController:(UIImagePickerController *)picker 39 | didFinishPickingMediaWithInfo:(NSDictionary *)info{ 40 | 41 | [picker dismissViewControllerAnimated:YES completion:nil]; 42 | 43 | //UIImage *image=info[UIImagePickerControllerEditedImage]; 44 | UIImage *image=info[UIImagePickerControllerOriginalImage]; 45 | if (self.selectedView==self.greenImageView) { 46 | self.greenImageView.image=image; 47 | return; 48 | } 49 | 50 | self.resultBgImageView.image=image; 51 | return; 52 | } 53 | 54 | #pragma mark - Action 55 | -(void)tapImgView:(UITapGestureRecognizer *)gesture{ 56 | if (gesture.view) { 57 | self.selectedView=gesture.view; 58 | [self presentViewController:self.imagePicker animated:YES completion:nil]; 59 | } 60 | } 61 | 62 | 63 | - (IBAction)tapResultButton:(id)sender { 64 | HZChromaKeyFilter *filter=[[HZChromaKeyFilter alloc] initWithInputImage:self.greenImageView.image 65 | backgroundImage:self.resultBgImageView.image]; 66 | 67 | self.resultImageView.image=[[UIImage imageWithCIImage:filter.outputImage] copy]; 68 | } 69 | 70 | 71 | #pragma mark - private 72 | - (void)hz_addView:(UIView *)view touchAction:(SEL)action 73 | { 74 | view.userInteractionEnabled = YES; 75 | UITapGestureRecognizer *g = 76 | [[UITapGestureRecognizer alloc] initWithTarget:self action:action]; 77 | [view addGestureRecognizer:g]; 78 | } 79 | 80 | #pragma mark - getter 81 | -(UIImagePickerController *)imagePicker{ 82 | if (!_imagePicker) { 83 | _imagePicker=[UIImagePickerController new]; 84 | _imagePicker.allowsEditing = NO; 85 | _imagePicker.sourceType= UIImagePickerControllerSourceTypePhotoLibrary; 86 | _imagePicker.delegate=self; 87 | } 88 | return _imagePicker; 89 | } 90 | @end 91 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorSampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZTestVideoViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZDetectorSampleViewController : UIViewController 12 | 13 | @end 14 | 15 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorSampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZTestVideoViewController.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "HZDetectorSampleViewController.h" 10 | #import "HZDetectorVideoViewController.h" 11 | #import "UIImageView+Gif.h" 12 | 13 | @interface HZDetectorSampleViewController () 14 | @property (nonatomic,readwrite,strong) HZDetectorVideoViewController *detectorVC; 15 | @end 16 | 17 | //贴纸 18 | @interface HZDetectorSampleViewController () 19 | @property (nonatomic,readwrite,strong) UIView *faceView; 20 | @property (nonatomic,readwrite,strong) UIImageView *haloImgView; 21 | @property (nonatomic,readwrite,strong) NSArray *haloImgList; 22 | @property (nonatomic,readwrite,strong) UIImageView *leftEyeImgView; 23 | @property (nonatomic,readwrite,strong) UIImageView *rightEyeImgView; 24 | @end 25 | 26 | //导航按钮 27 | @interface HZDetectorSampleViewController () 28 | @property (nonatomic,readwrite,strong) UIButton *rightButton; 29 | @property (nonatomic,readwrite,strong) UIBarButtonItem *rightBarButtonItem; 30 | @end 31 | 32 | @implementation HZDetectorSampleViewController 33 | 34 | -(void)viewDidLoad{ 35 | [super viewDidLoad ]; 36 | 37 | self.navigationItem.rightBarButtonItem=self.rightBarButtonItem; 38 | 39 | [self addChildViewController:self.detectorVC]; 40 | [self.view addSubview:self.detectorVC.view]; 41 | self.detectorVC.view.frame=CGRectMake(0, 0, self.view.frame.size.width,self.view.frame.size.height); 42 | 43 | [self.view addSubview:self.faceView]; 44 | [self.view addSubview:self.haloImgView]; 45 | [self.haloImgView playGifAnim:self.haloImgList]; 46 | 47 | [self.view addSubview:self.leftEyeImgView]; 48 | [self.view addSubview:self.rightEyeImgView]; 49 | } 50 | 51 | #pragma mark - action 52 | -(void)onRightNavButtonTapped:(UIBarButtonItem *)sender event:(UIEvent *)event{ 53 | 54 | [self.detectorVC chanageCamera]; 55 | self.rightButton.selected=(!self.rightButton.selected); 56 | 57 | // [self.detectorVC.view removeFromSuperview]; 58 | // [self.view addSubview:self.detectorVC.view]; 59 | [self.rightButton sizeToFit]; 60 | } 61 | 62 | #pragma mark - delegate 63 | -(void)detectorVideoLocateFace:(CGRect)faceBounds{ 64 | if (CGRectEqualToRect(faceBounds, CGRectZero) ) { 65 | self.leftEyeImgView.hidden=self.rightEyeImgView.hidden=self.faceView.hidden=self.haloImgView.hidden=YES; 66 | 67 | }else{ 68 | 69 | self.faceView.hidden=self.haloImgView.hidden=NO; 70 | self.faceView.frame=faceBounds; 71 | 72 | { 73 | CGFloat haloWidth= faceBounds.size.width; 74 | CGFloat haloHeight= haloWidth * 159 / 351; 75 | 76 | CGFloat haloCenterX=faceBounds.origin.x+faceBounds.size.width/2; 77 | 78 | CGRect rect=CGRectMake(haloCenterX-haloWidth/2, faceBounds.origin.y-haloHeight, haloWidth, haloHeight); 79 | self.haloImgView.frame=rect; 80 | } 81 | 82 | } 83 | } 84 | 85 | -(void)detectorVideoLocateLeftEyeForFace:(CGRect)leftEyeBounds{ 86 | if (CGRectEqualToRect(leftEyeBounds, CGRectZero) ) { 87 | self.leftEyeImgView.hidden=YES; 88 | 89 | }else{ 90 | self.leftEyeImgView.hidden=NO; 91 | self.leftEyeImgView.frame=leftEyeBounds; 92 | } 93 | } 94 | 95 | -(void)detectorVideoLocateRightEyeForFace:(CGRect)rightEyeBounds{ 96 | if (CGRectEqualToRect(rightEyeBounds, CGRectZero) ) { 97 | self.rightEyeImgView.hidden=YES; 98 | 99 | }else{ 100 | self.rightEyeImgView.hidden=NO; 101 | self.rightEyeImgView.frame=rightEyeBounds; 102 | } 103 | } 104 | 105 | #pragma mark - getter 106 | -(UIBarButtonItem *)rightBarButtonItem{ 107 | if(!_rightBarButtonItem){ 108 | _rightBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:self.rightButton]; 109 | } 110 | return _rightBarButtonItem; 111 | } 112 | 113 | -(UIButton *)rightButton{ 114 | if (!_rightButton) { 115 | 116 | _rightButton=[UIButton buttonWithType:UIButtonTypeCustom]; 117 | [_rightButton setTitleColor:[UIColor blackColor] 118 | forState:UIControlStateNormal]; 119 | [_rightButton setTitle:@"front" 120 | forState:UIControlStateNormal]; 121 | 122 | [_rightButton setTitle:@"back" 123 | forState:UIControlStateSelected]; 124 | 125 | [_rightButton sizeToFit]; 126 | [_rightButton addTarget:self 127 | action:@selector(onRightNavButtonTapped:event:) 128 | forControlEvents:UIControlEventTouchUpInside]; 129 | 130 | } 131 | return _rightButton; 132 | } 133 | 134 | -(HZDetectorVideoViewController *)detectorVC{ 135 | if (!_detectorVC) { 136 | _detectorVC=[HZDetectorVideoViewController new]; 137 | _detectorVC.detectorDelegate=self; 138 | } 139 | return _detectorVC; 140 | } 141 | 142 | -(UIView *)faceView{ 143 | if (!_faceView) { 144 | _faceView=[UIView new]; 145 | // _faceView.layer.borderColor=[UIColor orangeColor].CGColor; 146 | // _faceView.layer.borderWidth=2; 147 | } 148 | return _faceView; 149 | } 150 | 151 | -(UIImageView *)haloImgView{ 152 | if (!_haloImgView) { 153 | _haloImgView=[UIImageView new]; 154 | } 155 | return _haloImgView; 156 | } 157 | 158 | -(NSArray *)haloImgList{ 159 | if (!_haloImgList) { 160 | NSMutableArray *list=[NSMutableArray new]; 161 | for (int i=0; i<41; i++) { 162 | if (i<10) { 163 | NSString *name=[NSString stringWithFormat:@"halo_00%d",i]; 164 | UIImage *image= [UIImage imageNamed:name]; 165 | [list addObject:image]; 166 | }else{ 167 | NSString *name=[NSString stringWithFormat:@"halo_0%d",i]; 168 | UIImage *image= [UIImage imageNamed:name]; 169 | [list addObject:image]; 170 | } 171 | } 172 | 173 | _haloImgList= [list copy]; 174 | } 175 | return _haloImgList; 176 | } 177 | 178 | -(UIImageView *)leftEyeImgView{ 179 | if (!_leftEyeImgView) { 180 | _leftEyeImgView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"leftHeart"]]; 181 | 182 | } 183 | return _leftEyeImgView; 184 | } 185 | 186 | -(UIImageView *)rightEyeImgView{ 187 | if (!_rightEyeImgView) { 188 | _rightEyeImgView=[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"rightHeart"]]; 189 | } 190 | return _rightEyeImgView; 191 | } 192 | 193 | @end 194 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorVideoViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZDetectorVideoViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | //协议 13 | @protocol DetectorVideoDelegate 14 | //协议的方法 15 | -(void)detectorVideoLocateFace:(CGRect)faceBounds; 16 | 17 | -(void)detectorVideoLocateLeftEyeForFace:(CGRect)leftEyeBounds; 18 | 19 | -(void)detectorVideoLocateRightEyeForFace:(CGRect)rightEyeBounds; 20 | @end 21 | 22 | @interface HZDetectorVideoViewController : GLKViewController 23 | @property(nonatomic,weak) id detectorDelegate; 24 | -(void)chanageCamera; 25 | @end 26 | 27 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorVideoViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZDetectorVideoViewController.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/17. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import 12 | #import "Tool.h" 13 | #import "HZDetectorVideoViewController.h" 14 | #import "UIImageView+Gif.h" 15 | #import "UIImage+Extension.h" 16 | 17 | 18 | #define kScreenWidth [self.view bounds].size.width 19 | #define kScreenHeight [self.view bounds].size.height 20 | 21 | @interface HZDetectorVideoViewController () 22 | @property (nonatomic,readwrite,strong) AVCaptureSession *session; 23 | 24 | @property (nonatomic,readwrite,assign) BOOL isDevicePositionFront; 25 | @property (nonatomic,readwrite,strong) AVCaptureDeviceInput *backCameraInput; 26 | @property (nonatomic,readwrite,strong) AVCaptureDeviceInput *frontCameraInput; 27 | 28 | @property (nonatomic,readwrite,strong) AVCaptureVideoDataOutput *dataOutput; 29 | 30 | @property (nonatomic,readwrite,strong) CIContext *ciContext; 31 | @property (nonatomic,readwrite,strong) EAGLContext *glContext; 32 | @property (nonatomic,readwrite,strong) GLKView *glkView; 33 | 34 | 35 | //@property (nonatomic,readwrite,strong) GLKBaseEffect *glEffect; 36 | @property(nonatomic,assign) int mCount; 37 | @end 38 | 39 | @implementation HZDetectorVideoViewController 40 | - (void)viewDidLoad{ 41 | [super viewDidLoad]; 42 | 43 | self.view=self.glkView; 44 | 45 | [self.session beginConfiguration]; 46 | [self.session addInput:self.backCameraInput]; 47 | self.isDevicePositionFront=NO; 48 | 49 | //对实时视频帧进行相关的渲染操作,指定代理 50 | [self.dataOutput setSampleBufferDelegate:self queue:dispatch_get_main_queue()]; 51 | 52 | [self.session addOutput:self.dataOutput]; 53 | [self.session commitConfiguration]; 54 | 55 | NSArray *array = [[self.session.outputs objectAtIndex:0] connections]; 56 | for (AVCaptureConnection *connection in array){ 57 | connection.videoOrientation = AVCaptureVideoOrientationPortrait; 58 | } 59 | 60 | [self.session startRunning]; 61 | 62 | 63 | } 64 | #pragma mark - public 65 | -(void)chanageCamera{ 66 | if (self.isDevicePositionFront) { 67 | [self changeCameraPositionWithCurrentIsFront:NO]; 68 | }else{ 69 | [self changeCameraPositionWithCurrentIsFront:YES]; 70 | } 71 | } 72 | #pragma mark - private 73 | //切换摄像头方向 74 | - (void)changeCameraPositionWithCurrentIsFront:(BOOL)isFront { 75 | 76 | if (isFront) { 77 | [self.session stopRunning]; 78 | [self.session removeInput:self.backCameraInput]; 79 | 80 | self.isDevicePositionFront=YES; 81 | 82 | if ([self.session canAddInput:self.frontCameraInput]) { 83 | 84 | [self.session addInput:self.frontCameraInput]; 85 | 86 | [self.session commitConfiguration]; 87 | NSArray *array = [[self.session.outputs objectAtIndex:0] connections]; 88 | for (AVCaptureConnection *connection in array){ 89 | connection.videoOrientation = AVCaptureVideoOrientationPortrait; 90 | } 91 | 92 | [self.session startRunning]; 93 | } 94 | 95 | } else { 96 | [self.session stopRunning]; 97 | [self.session removeInput:self.frontCameraInput]; 98 | self.isDevicePositionFront=NO; 99 | 100 | if ([self.session canAddInput:self.backCameraInput]) { 101 | [self.session addInput:self.backCameraInput]; 102 | [self.session commitConfiguration]; 103 | 104 | NSArray *array = [[self.session.outputs objectAtIndex:0] connections]; 105 | for (AVCaptureConnection *connection in array){ 106 | connection.videoOrientation = AVCaptureVideoOrientationPortrait; 107 | } 108 | [self.session startRunning]; 109 | } 110 | } 111 | 112 | } 113 | 114 | //获取可用的摄像头 115 | - (AVCaptureDevice *)cameroWithPosition:(AVCaptureDevicePosition)position{ 116 | 117 | if ([[UIDevice currentDevice].systemVersion floatValue] >= 10.0) { 118 | AVCaptureDeviceDiscoverySession *dissession = 119 | [AVCaptureDeviceDiscoverySession discoverySessionWithDeviceTypes:@[AVCaptureDeviceTypeBuiltInDualCamera,AVCaptureDeviceTypeBuiltInTelephotoCamera,AVCaptureDeviceTypeBuiltInWideAngleCamera] 120 | mediaType:AVMediaTypeVideo 121 | position:position]; 122 | for (AVCaptureDevice *device in dissession.devices) { 123 | if ([device position] == position ) { 124 | return device; 125 | } 126 | } 127 | } else { 128 | NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo]; 129 | for (AVCaptureDevice *device in devices) { 130 | if ([device position] == position) { 131 | return device; 132 | } 133 | } 134 | } 135 | return nil; 136 | } 137 | 138 | -(CIImage *)inputCIImageForDetector:(CIImage *)image{ 139 | NSDictionary *opts = [NSDictionary dictionaryWithObject:CIDetectorAccuracyLow 140 | forKey:CIDetectorAccuracy]; 141 | CIDetector *detector=[CIDetector detectorOfType:CIDetectorTypeFace context:nil options:opts]; 142 | NSArray *faceArray = [detector featuresInImage:image 143 | options:nil]; 144 | 145 | if (!(faceArray.count==1)) { 146 | 147 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateFace:)]) { 148 | [self.detectorDelegate detectorVideoLocateFace:CGRectZero]; 149 | } 150 | 151 | return image; 152 | } 153 | //得到图片的尺寸 154 | CGSize ciImageSize=[image extent].size; 155 | CGAffineTransform transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, -1); 156 | transform = CGAffineTransformTranslate(transform,0,-ciImageSize.height); 157 | for (CIFeature *f in faceArray){ 158 | CIFaceFeature *faceFeature=(CIFaceFeature *)f; 159 | // 实现坐标转换 160 | CGSize viewSize =self.view.bounds.size; 161 | CGFloat scale = MIN(viewSize.width / ciImageSize.width,viewSize.height / ciImageSize.height); 162 | 163 | CGFloat offsetX = (viewSize.width - ciImageSize.width * scale) / 2; 164 | CGFloat offsetY = (viewSize.height - ciImageSize.height * scale) / 2; 165 | // 缩放 166 | CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale); 167 | //获取人脸的frame 168 | CGRect faceViewBounds = CGRectApplyAffineTransform(faceFeature.bounds, transform); 169 | // 修正 170 | faceViewBounds = CGRectApplyAffineTransform(faceViewBounds,scaleTransform); 171 | faceViewBounds.origin.x += offsetX; 172 | faceViewBounds.origin.y += offsetY; 173 | 174 | // NSLog(@"faceBounds: x %f, y%f",faceFeature.bounds.origin.x,faceFeature.bounds.origin.y); 175 | // NSLog(@"glkView : w %f, h%f",self.view.bounds.size.width,self.view.bounds.size.height); 176 | // NSLog(@"imageSize : w %f, h%f",ciImageSize.width,ciImageSize.height); 177 | 178 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateFace:)]) { 179 | [self.detectorDelegate detectorVideoLocateFace:faceViewBounds]; 180 | } 181 | 182 | // 判断是否有右眼位置 183 | if(faceFeature.hasRightEyePosition){ 184 | CGFloat x=faceFeature.rightEyePosition.x; 185 | CGFloat y=faceFeature.rightEyePosition.y; 186 | 187 | 188 | CGSize size=CGSizeMake(faceViewBounds.size.width/3, faceViewBounds.size.width/3); 189 | CGRect rightEyeRect=CGRectMake(x-size.width/2,y-size.height/2, size.width, size.height); 190 | 191 | //获取人脸的frame 192 | CGRect rightEyeBounds = CGRectApplyAffineTransform(rightEyeRect, transform); 193 | rightEyeBounds=CGRectApplyAffineTransform(rightEyeBounds,scaleTransform); 194 | rightEyeBounds.origin.x += offsetX; 195 | rightEyeBounds.origin.y += offsetY; 196 | 197 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateRightEyeForFace:)]) { 198 | [self.detectorDelegate detectorVideoLocateRightEyeForFace:rightEyeBounds]; 199 | } 200 | 201 | }else{ 202 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateRightEyeForFace:)]) { 203 | [self.detectorDelegate detectorVideoLocateRightEyeForFace:CGRectZero]; 204 | } 205 | } 206 | 207 | // 判断是否有左眼位置 208 | if(faceFeature.hasLeftEyePosition){ 209 | 210 | CGFloat x=faceFeature.leftEyePosition.x; 211 | CGFloat y=faceFeature.leftEyePosition.y; 212 | CGSize size=CGSizeMake(faceViewBounds.size.width/3, faceViewBounds.size.width/3); 213 | CGRect leftEyeRect=CGRectMake(x-size.width/2,y-size.height/2, size.width, size.height); 214 | 215 | //获取人脸的frame 216 | CGRect leftEyeBounds = CGRectApplyAffineTransform(leftEyeRect, transform); 217 | leftEyeBounds=CGRectApplyAffineTransform(leftEyeBounds,scaleTransform); 218 | leftEyeBounds.origin.x += offsetX; 219 | leftEyeBounds.origin.y += offsetY; 220 | 221 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateLeftEyeForFace:)]) { 222 | [self.detectorDelegate detectorVideoLocateLeftEyeForFace:leftEyeBounds]; 223 | } 224 | 225 | }else{ 226 | if ([self.detectorDelegate respondsToSelector:@selector(detectorVideoLocateLeftEyeForFace:)]) { 227 | [self.detectorDelegate detectorVideoLocateLeftEyeForFace:CGRectZero]; 228 | } 229 | } 230 | 231 | } 232 | 233 | return image; 234 | } 235 | 236 | -(void)drawImage:(CIImage *)image{ 237 | [self.glkView bindDrawable]; 238 | 239 | if( !(self.glContext == [EAGLContext currentContext])) { 240 | [EAGLContext setCurrentContext:self.glContext]; 241 | } 242 | // clear eagl view to grey 243 | glClearColor(0.5, 0.5, 0.5, 1.0); 244 | glClear(GL_COLOR_BUFFER_BIT); 245 | 246 | // set the blend mode to "source over" so that CI will use that 247 | glEnable(GL_BLEND); 248 | glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 249 | 250 | [self.ciContext drawImage:image 251 | inRect:CGRectMake(0, 0, kScreenWidth*2, kScreenHeight*2) 252 | fromRect:CGRectMake(0, 0, [image extent].size.width,[image extent].size.height) ]; 253 | 254 | [self.glkView display]; 255 | } 256 | 257 | -(void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection { 258 | 259 | CVPixelBufferRef pixelBuffer = (CVPixelBufferRef)CMSampleBufferGetImageBuffer(sampleBuffer); 260 | CIImage *image = [CIImage imageWithCVPixelBuffer:pixelBuffer]; 261 | 262 | self.mCount++; 263 | if (self.mCount%5==0) { 264 | image=[self inputCIImageForDetector:image]; 265 | self.mCount=0; 266 | } 267 | 268 | 269 | [self drawImage:image]; 270 | } 271 | 272 | #pragma mark - private 273 | 274 | #pragma mark - getter 275 | -(EAGLContext *)glContext{ 276 | if (!_glContext) { 277 | _glContext = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; 278 | } 279 | return _glContext; 280 | } 281 | 282 | -(GLKView *)glkView{ 283 | if (!_glkView) { 284 | _glkView = [[GLKView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth*2, kScreenHeight*2) 285 | context:self.glContext]; 286 | 287 | _glkView.drawableColorFormat = GLKViewDrawableColorFormatRGB565; 288 | 289 | _glkView.drawableDepthFormat = GLKViewDrawableDepthFormat24; 290 | } 291 | return _glkView; 292 | } 293 | 294 | -(CIContext *)ciContext{ 295 | if (!_ciContext) { 296 | _ciContext = [CIContext contextWithEAGLContext:self.glContext]; 297 | } 298 | return _ciContext; 299 | } 300 | 301 | -(AVCaptureSession *)session{ 302 | if (!_session) { 303 | _session = [[AVCaptureSession alloc] init]; 304 | [_session setSessionPreset: AVCaptureSessionPresetHigh]; 305 | } 306 | return _session; 307 | } 308 | 309 | //摄像头输入 310 | - (AVCaptureDeviceInput *)backCameraInput { 311 | if (_backCameraInput == nil) { 312 | NSError *error; 313 | _backCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:[self cameroWithPosition:AVCaptureDevicePositionBack] error:&error]; 314 | if (error) { 315 | NSLog(@"后置摄像头获取失败"); 316 | } 317 | } 318 | self.isDevicePositionFront = NO; 319 | return _backCameraInput; 320 | } 321 | 322 | - (AVCaptureDeviceInput *)frontCameraInput { 323 | if (_frontCameraInput == nil) { 324 | NSError *error; 325 | _frontCameraInput = [[AVCaptureDeviceInput alloc] initWithDevice:[self cameroWithPosition:AVCaptureDevicePositionFront] 326 | error:&error]; 327 | if (error) { 328 | NSLog(@"前置摄像头获取失败"); 329 | } 330 | } 331 | self.isDevicePositionFront = YES; 332 | 333 | return _frontCameraInput; 334 | } 335 | 336 | -(AVCaptureVideoDataOutput *)dataOutput{ 337 | if (!_dataOutput) { 338 | //output 339 | _dataOutput = [[AVCaptureVideoDataOutput alloc] init]; 340 | 341 | [_dataOutput setAlwaysDiscardsLateVideoFrames:YES]; 342 | //conn.videoMaxFrameDuration = CMTimeMake(1,rate); 343 | 344 | [_dataOutput setVideoSettings:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:kCVPixelFormatType_32BGRA] 345 | forKey:(id)kCVPixelBufferPixelFormatTypeKey]]; 346 | } 347 | return _dataOutput; 348 | } 349 | @end 350 | 351 | 352 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZDetectorViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/4. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZDetectorViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Detector/HZDetectorViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZDetectorViewController.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/4. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "HZDetectorViewController.h" 10 | #import 11 | #import "UIImageView+Gif.h" 12 | 13 | @interface HZDetectorViewController () 14 | @property (weak, nonatomic) IBOutlet UIImageView *oldImageView; 15 | 16 | @end 17 | 18 | @implementation HZDetectorViewController 19 | 20 | 21 | - (IBAction)tapSubmitButton:(id)sender { 22 | for (UIView *view in self.oldImageView.subviews) { 23 | [view removeFromSuperview]; 24 | } 25 | 26 | // 图像识别能力:可以在CIDetectorAccuracyHigh(较强的处理能力)与CIDetectorAccuracyLow(较弱的处理能力)中选择,因为想让准确度高一些在这里选择CIDetectorAccuracyHigh 27 | NSDictionary *opts = [NSDictionary dictionaryWithObject:CIDetectorAccuracyHigh 28 | forKey:CIDetectorAccuracy]; 29 | 30 | CIDetector *detector=[CIDetector detectorOfType:CIDetectorTypeFace context:nil options:opts]; 31 | 32 | // CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeFace 33 | // context:nil 34 | // options:nil]; 35 | 36 | CIImage *image=[[CIImage alloc] initWithImage:self.oldImageView.image]; 37 | NSArray *faceArray = [detector featuresInImage:image 38 | options:nil]; 39 | 40 | /** 将 Core Image 坐标转换成 UIView 坐标 **/ 41 | //得到图片的尺寸 42 | CGSize ciImageSize= [image extent].size;; 43 | //将image沿y轴对称 44 | CGAffineTransform transform = CGAffineTransformScale(CGAffineTransformIdentity, 1, -1); 45 | //y轴负方向平移 46 | transform = CGAffineTransformTranslate(transform,0,-ciImageSize.height); 47 | 48 | for (CIFeature *f in faceArray){ 49 | 50 | if ([f.type isEqualToString:CIFeatureTypeFace]) { 51 | 52 | CIFaceFeature *faceFeature=(CIFaceFeature *)f; 53 | // 实现坐标转换 54 | CGSize viewSize = self.oldImageView.bounds.size; 55 | CGFloat scale = MIN(viewSize.width / ciImageSize.width, 56 | viewSize.height / ciImageSize.height); 57 | CGFloat offsetX = (viewSize.width - ciImageSize.width * scale) / 2; 58 | CGFloat offsetY = (viewSize.height - ciImageSize.height * scale) / 2; 59 | // 缩放 60 | CGAffineTransform scaleTransform = CGAffineTransformMakeScale(scale, scale); 61 | //获取人脸的frame 62 | CGRect faceViewBounds = CGRectApplyAffineTransform(faceFeature.bounds, transform); 63 | // 修正 64 | faceViewBounds = CGRectApplyAffineTransform(faceViewBounds,scaleTransform); 65 | faceViewBounds.origin.x += offsetX; 66 | faceViewBounds.origin.y += offsetY; 67 | 68 | UIView *faceView=[[UIView alloc] initWithFrame:faceViewBounds]; 69 | faceView.layer.borderWidth=3; 70 | faceView.layer.borderColor=[UIColor orangeColor].CGColor; 71 | 72 | [self.oldImageView addSubview:faceView]; 73 | 74 | /** 加光环 **/ 75 | UIImageView *imageView=[UIImageView new]; 76 | CGFloat haloWidth= faceViewBounds.size.width; 77 | CGFloat haloHeight= haloWidth * 159 / 351; 78 | 79 | CGFloat haloCenterX=faceViewBounds.origin.x+faceViewBounds.size.width/2; 80 | 81 | CGRect rect=CGRectMake(haloCenterX-haloWidth/2, faceViewBounds.origin.y-haloHeight, haloWidth, haloHeight); 82 | imageView.frame=rect; 83 | [self.oldImageView addSubview:imageView]; 84 | 85 | 86 | NSMutableArray *list=[NSMutableArray new]; 87 | for (int i=0; i<41; i++) { 88 | if (i<10) { 89 | NSString *name=[NSString stringWithFormat:@"halo_00%d",i]; 90 | UIImage *image= [UIImage imageNamed:name]; 91 | [list addObject:image]; 92 | }else{ 93 | NSString *name=[NSString stringWithFormat:@"halo_0%d",i]; 94 | UIImage *image= [UIImage imageNamed:name]; 95 | [list addObject:image]; 96 | } 97 | } 98 | 99 | [imageView playGifAnim:[list copy]]; 100 | 101 | // 判断是否有左眼位置 102 | if(faceFeature.hasLeftEyePosition){ 103 | 104 | CGFloat x=faceFeature.leftEyePosition.x; 105 | CGFloat y=faceFeature.leftEyePosition.y; 106 | CGRect leftEyeRect=CGRectMake(x-10/2,y-10/2, 10, 10); 107 | 108 | //获取人脸的frame 109 | CGRect leftEyeBounds = CGRectApplyAffineTransform(leftEyeRect, transform); 110 | leftEyeBounds=CGRectApplyAffineTransform(leftEyeBounds,scaleTransform); 111 | leftEyeBounds.origin.x += offsetX; 112 | leftEyeBounds.origin.y += offsetY; 113 | 114 | UIView *leftEyeView = [[UIView alloc] initWithFrame:leftEyeBounds]; 115 | leftEyeView .backgroundColor = [UIColor orangeColor]; 116 | [self.oldImageView addSubview:leftEyeView ]; 117 | 118 | } 119 | // 判断是否有右眼位置 120 | if(faceFeature.hasRightEyePosition){ 121 | CGFloat x=faceFeature.rightEyePosition.x; 122 | CGFloat y=faceFeature.rightEyePosition.y; 123 | CGRect rightEyeRect=CGRectMake(x-10/2,y-10/2, 10, 10); 124 | 125 | //获取人脸的frame 126 | CGRect rightEyeBounds = CGRectApplyAffineTransform(rightEyeRect, transform); 127 | rightEyeBounds=CGRectApplyAffineTransform(rightEyeBounds,scaleTransform); 128 | rightEyeBounds.origin.x += offsetX; 129 | rightEyeBounds.origin.y += offsetY; 130 | 131 | UIView *rightEyeView = [[UIView alloc] initWithFrame:rightEyeBounds]; 132 | rightEyeView.backgroundColor = [UIColor orangeColor]; 133 | [self.oldImageView addSubview:rightEyeView]; 134 | 135 | } 136 | // 判断是否有嘴位置 137 | if(faceFeature.hasMouthPosition){ 138 | 139 | } 140 | 141 | } 142 | 143 | } 144 | 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Filters/HZCoreImageViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZCoreImageViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/30. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZCoreImageViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Filters/HZCoreImageViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZCoreImageViewController.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/30. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "HZCoreImageViewController.h" 10 | 11 | #define ScreenWidth [self.view bounds].size.width 12 | #define ScreenHeight [self.view bounds].size.height 13 | 14 | @interface HZCoreImageViewController () 15 | @property (nonatomic,readwrite,strong) NSMutableArray *dataList; 16 | @property (nonatomic,readwrite,strong) UIPickerView *pickerView; 17 | @property (nonatomic,readwrite,strong) UIImageView *imageView; 18 | @property (nonatomic,readwrite,strong) UIImage *originImage; 19 | 20 | @property (nonatomic,readwrite,strong) UIButton *rightButton; 21 | @property (nonatomic,readwrite,strong) UIBarButtonItem *rightBarButtonItem; 22 | @end 23 | 24 | @implementation HZCoreImageViewController 25 | 26 | - (void)viewDidLoad { 27 | [super viewDidLoad]; 28 | 29 | self.view.backgroundColor=[UIColor whiteColor]; 30 | self.navigationItem.rightBarButtonItem=self.rightBarButtonItem; 31 | 32 | [self.view addSubview:self.imageView]; 33 | [self.view addSubview:self.pickerView]; 34 | } 35 | 36 | #pragma mark 滤镜处理事件 37 | 38 | 39 | #pragma mark - action 40 | -(void)onRightNavButtonTapped:(UIBarButtonItem *)sender event:(UIEvent *)event{ 41 | if(self.rightButton.selected){ 42 | 43 | //picker关闭 44 | [UIView beginAnimations:nil context:nil]; 45 | [UIView setAnimationDuration:0.3]; 46 | self.pickerView.frame = CGRectMake(0, ScreenHeight, ScreenWidth, CGRectGetHeight(self.pickerView.bounds)); 47 | [UIView commitAnimations]; 48 | 49 | }else{ 50 | //picker显示 51 | [UIView beginAnimations:nil context:nil]; 52 | [UIView setAnimationDuration:0.3]; 53 | self.pickerView.frame = CGRectMake(0, ScreenHeight - CGRectGetHeight(self.pickerView.bounds), ScreenWidth, CGRectGetHeight(self.pickerView.bounds)); 54 | [UIView commitAnimations]; 55 | 56 | } 57 | 58 | self.rightButton.selected=(!self.rightButton.selected); 59 | 60 | } 61 | 62 | - (void)fliterEvent:(NSString *)filterName 63 | { 64 | if ([filterName isEqualToString:@"OriginImage"]) { 65 | self.imageView.image = self.originImage; 66 | 67 | }else{ 68 | //将UIImage转换成CIImage 69 | CIImage *ciImage = [[CIImage alloc] initWithImage:self.originImage]; 70 | //创建滤镜 71 | CIFilter *filter = [CIFilter filterWithName:filterName 72 | keysAndValues:kCIInputImageKey,ciImage, nil]; 73 | //已有的值不改变,其他的设为默认值 74 | [filter setDefaults]; 75 | 76 | //获取绘制上下文 77 | CIContext *context = [CIContext contextWithOptions:nil]; 78 | 79 | //渲染并输出CIImage 80 | CIImage *outputImage = [filter outputImage]; 81 | 82 | //创建CGImage句柄 83 | CGImageRef cgImage = [context createCGImage:outputImage fromRect:[outputImage extent]]; 84 | 85 | //获取图片 86 | UIImage *image = [UIImage imageWithCGImage:cgImage]; 87 | 88 | //释放CGImage句柄 89 | CGImageRelease(cgImage); 90 | 91 | self.imageView.image = image; 92 | } 93 | 94 | } 95 | 96 | #pragma mark - PickerView 97 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { 98 | return 1; 99 | } 100 | 101 | - (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { 102 | return [self.dataList count]; 103 | } 104 | 105 | - (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { 106 | return [self.dataList objectAtIndex:row]; 107 | } 108 | 109 | - (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { 110 | [self fliterEvent:[self.dataList objectAtIndex:row]]; 111 | } 112 | 113 | #pragma mark - getter 114 | -(UIImage *)originImage{ 115 | if (!_originImage) { 116 | _originImage = [UIImage imageNamed:@"test"]; 117 | } 118 | return _originImage; 119 | } 120 | 121 | -(UIImageView *)imageView{ 122 | if (!_imageView) { 123 | _imageView=[[UIImageView alloc] initWithImage:self.originImage]; 124 | 125 | _imageView.frame = self.view.frame; 126 | _imageView.center = self.view.center; 127 | } 128 | return _imageView; 129 | } 130 | 131 | -(UIPickerView *)pickerView{ 132 | 133 | if (!_pickerView) { 134 | int pickerHeight = 200;//pickerView的高度 135 | _pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, ScreenHeight, ScreenWidth, pickerHeight)]; 136 | _pickerView.delegate = self; 137 | _pickerView.dataSource = self; 138 | _pickerView.showsSelectionIndicator = YES; 139 | _pickerView.backgroundColor = [UIColor colorWithWhite:0.8 alpha:0.9]; 140 | } 141 | return _pickerView; 142 | } 143 | 144 | -(NSMutableArray *)dataList{ 145 | if (!_dataList) { 146 | _dataList= 147 | _dataList = [[NSMutableArray alloc] initWithObjects: 148 | @"OriginImage", 149 | @"CIPhotoEffectMono", 150 | @"CIPhotoEffectChrome", 151 | @"CIPhotoEffectFade", 152 | @"CIPhotoEffectInstant", 153 | @"CIPhotoEffectNoir", 154 | @"CIPhotoEffectProcess", 155 | @"CIPhotoEffectTonal", 156 | @"CIPhotoEffectTransfer", 157 | @"CISRGBToneCurveToLinear", 158 | @"CIVignetteEffect", 159 | nil]; 160 | } 161 | return _dataList; 162 | } 163 | 164 | -(UIBarButtonItem *)rightBarButtonItem{ 165 | if(!_rightBarButtonItem){ 166 | _rightBarButtonItem=[[UIBarButtonItem alloc] initWithCustomView:self.rightButton]; 167 | } 168 | return _rightBarButtonItem; 169 | } 170 | 171 | -(UIButton *)rightButton{ 172 | if (!_rightButton) { 173 | 174 | _rightButton=[UIButton buttonWithType:UIButtonTypeCustom]; 175 | [_rightButton setTitleColor:[UIColor blackColor] 176 | forState:UIControlStateNormal]; 177 | [_rightButton setTitle:@"Filter" 178 | forState:UIControlStateNormal]; 179 | 180 | [_rightButton setTitle:@"hide" 181 | forState:UIControlStateSelected]; 182 | 183 | [_rightButton sizeToFit]; 184 | [_rightButton addTarget:self 185 | action:@selector(onRightNavButtonTapped:event:) 186 | forControlEvents:UIControlEventTouchUpInside]; 187 | 188 | } 189 | return _rightButton; 190 | } 191 | @end 192 | 193 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Tool.h: -------------------------------------------------------------------------------- 1 | // 2 | // RSBToHSV.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/3. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | #import 9 | @interface Tool : NSObject 10 | void RGBtoHSV( float r, float g, float b, float *h, float *s, float *v ); 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Demo/Tool.m: -------------------------------------------------------------------------------- 1 | // 2 | // Tool.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/3. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "Tool.h" 10 | 11 | @implementation Tool 12 | 13 | void RGBtoHSV( float r, float g, float b, float *h, float *s, float *v ){ 14 | float min, max, delta; 15 | min = MIN( r, MIN(g, b) ); 16 | max = MAX( r, MAX(g, b) ); 17 | *v = max; // v 18 | delta = max - min; 19 | if( max != 0 ) 20 | *s = delta / max; // s 21 | else { 22 | // r = g = b = 0 // s = 0, v is undefined 23 | *s = 0; 24 | *h = -1; 25 | return; 26 | } 27 | if( r == max ) 28 | *h = ( g - b ) / delta; // between yellow & magenta 29 | else if( g == max ) 30 | *h = 2 + ( b - r ) / delta; // between cyan & yellow 31 | else 32 | *h = 4 + ( r - g ) / delta; // between magenta & cyan 33 | *h *= 60; // degrees 34 | if( *h < 0 ) 35 | *h += 360; 36 | } 37 | @end 38 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Filter/HZChromaKeyFilter.h: -------------------------------------------------------------------------------- 1 | // 2 | // HZChromaKeyFilter.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/16. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface HZChromaKeyFilter : CIFilter 12 | 13 | -(instancetype)initWithInputImage:(UIImage *)image 14 | backgroundImage:(UIImage *)bgImage; 15 | 16 | @property (nonatomic,readwrite,strong) UIImage *inputFilterImage; 17 | @property (nonatomic,readwrite,strong) UIImage *backgroundImage; 18 | @end 19 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Filter/HZChromaKeyFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // HZChromaKeyFilter.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/5/16. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "Tool.h" 10 | #import "HZChromaKeyFilter.h" 11 | 12 | @interface HZChromaKeyFilter () 13 | @end 14 | 15 | @implementation HZChromaKeyFilter 16 | -(instancetype)initWithInputImage:(UIImage *)image 17 | backgroundImage:(UIImage *)bgImage{ 18 | self=[super init]; 19 | 20 | if (!self) { 21 | return nil; 22 | } 23 | 24 | 25 | 26 | self.inputFilterImage=image; 27 | self.backgroundImage=bgImage; 28 | 29 | return self; 30 | 31 | } 32 | 33 | -(CIImage *)outputImage{ 34 | 35 | CIFilter *colorCubeFilter= [CIFilter filterWithName:@"CIColorCube"]; 36 | 37 | // Allocate memory 38 | const unsigned int size = 64; 39 | float *cubeData = (float *)malloc (size * size * size * sizeof (float) * 4); 40 | [colorCubeFilter setValue:@(size) forKey:@"inputCubeDimension"]; 41 | 42 | CIImage *myImage = [[CIImage alloc] initWithImage:self.inputFilterImage]; 43 | [colorCubeFilter setValue:myImage forKey:@"inputImage"]; 44 | 45 | 46 | 47 | float rgb[3], hsv[3], *c = cubeData; 48 | // Populate cube with a simple gradient going from 0 to 1 49 | for (int z = 0; z < size; z++){ 50 | rgb[2] = ((double)z)/(size-1); // Blue value 51 | for (int y = 0; y < size; y++){ 52 | rgb[1] = ((double)y)/(size-1); // Green value 53 | for (int x = 0; x < size; x ++){ 54 | rgb[0] = ((double)x)/(size-1); // Red value 55 | // Convert RGB to HSV 56 | // You can find publicly available rgbToHSV functions on the Internet 57 | RGBtoHSV(rgb[0],rgb[1],rgb[2], &hsv[0],&hsv[1],&hsv[2]); 58 | //green 59 | // float alpha = (hsv[0] > 80 && hsv[0] < 160) ? 0.0f:1.0f; 60 | //颜色判断 61 | float alpha = (hsv[0] >=85 && hsv[0] <= 155) ? 0.0f:1.0f; 62 | //饱和度 63 | if (hsv[1]<0.2) { 64 | alpha=1.0f; 65 | } 66 | //亮度 67 | if (hsv[2]<0.2) { 68 | alpha=1.0f; 69 | } 70 | //blue float alpha = (hsv[0] > 210 && hsv[0] < 270) ? 0.0f:1.0f; 71 | 72 | // Calculate premultiplied alpha values for the cube 73 | c[0] = rgb[0] * alpha; 74 | c[1] = rgb[1] * alpha; 75 | c[2] = rgb[2] * alpha; 76 | c[3] = alpha; 77 | c += 4; 78 | } 79 | } 80 | } 81 | 82 | 83 | // Create memory with the cube data 84 | NSData *data = [NSData dataWithBytesNoCopy:cubeData 85 | length:size * size * size * sizeof (float) * 4 86 | freeWhenDone:YES]; 87 | [colorCubeFilter setValue:data forKey:@"inputCubeData"]; 88 | 89 | myImage = [colorCubeFilter outputImage]; 90 | 91 | 92 | #pragma mark 组合 93 | CIImage *backgroundCIImage = [[CIImage alloc] initWithImage:self.backgroundImage]; 94 | CIImage *resulImage = [[CIFilter filterWithName:@"CISourceOverCompositing" 95 | keysAndValues:kCIInputImageKey,myImage,kCIInputBackgroundImageKey,backgroundCIImage,nil] 96 | valueForKey:kCIOutputImageKey]; 97 | 98 | return resulImage; 99 | } 100 | 101 | @end 102 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/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 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/greenBg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "test.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/greenBg.imageset/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/greenBg.imageset/test.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/hueScale.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "hueScale.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/hueScale.imageset/hueScale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/hueScale.imageset/hueScale.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/resultBg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "test1.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/resultBg.imageset/test1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/CustomFilter/resultBg.imageset/test1.jpg -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "detector.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector.imageset/detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector.imageset/detector.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector2.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "img3.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector2.imageset/img3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/detector2.imageset/img3.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/leftHeart.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "heart.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/leftHeart.imageset/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/leftHeart.imageset/heart.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/rightHeart.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "heart.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/rightHeart.imageset/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/Detector/rightHeart.imageset/heart.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/test.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "ttttt.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/Assets.xcassets/test.imageset/ttttt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/Assets.xcassets/test.imageset/ttttt.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/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 | app 需要您的同意才能使用 相册 25 | NSCameraUsageDescription 26 | app 需要您的同意才能使用 相机 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/dataList.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | vc 7 | HZCoreImageViewController 8 | imageName 9 | collection_profile 10 | title 11 | Filters 12 | 13 | 14 | StoryBoardID 15 | FilterChainVC 16 | vc 17 | HZFilterChainViewController 18 | title 19 | FilterChain 20 | 21 | 22 | StoryBoardID 23 | detectorVC 24 | title 25 | DetectorImage 26 | 27 | 28 | vc 29 | HZDetectorSampleViewController 30 | title 31 | DetectorVideo 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_000.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_001.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_002.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_003.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_004.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_005.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_006.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_007.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_008.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_009.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_010.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_011.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_012.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_013.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_014.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_015.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_016.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_017.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_018.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_019.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_020.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_021.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_022.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_023.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_024.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_025.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_026.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_027.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_028.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_029.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_030.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_031.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_032.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_032.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_033.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_034.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_035.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_036.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_037.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_038.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_039.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Resource/halo/halo_040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZenonHuang/HZImageFilter/37ccfa0cdb354b90711d24bad1214b345f24d8e9/HZImageFilter/HZImageFilter/Resource/halo/halo_040.png -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/Supporting Files/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/29. 6 | // Copyright © 2017年 zzgo. 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 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/29. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /HZImageFilter/HZImageFilter/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // HZImageFilter 4 | // 5 | // Created by zz go on 2017/4/29. 6 | // Copyright © 2017年 zzgo. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | 12 | static NSString *DataCellIdentifier = @"DataCellTableIdentifier"; 13 | @interface ViewController () 14 | @property (nonatomic, readwrite, strong) UITableView *tableView; 15 | @property (nonatomic, readwrite, strong) NSArray *totalArray; 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view, typically from a nib. 23 | self.navigationItem.title=@"HZImageFilter"; 24 | 25 | NSString *mineListPath = [[NSBundle mainBundle] pathForResource:@"dataList" ofType:@"plist"]; 26 | self.totalArray = [[NSArray alloc] initWithContentsOfFile:mineListPath]; 27 | 28 | [self.view addSubview:self.tableView]; 29 | } 30 | 31 | 32 | - (void)didReceiveMemoryWarning { 33 | [super didReceiveMemoryWarning]; 34 | // Dispose of any resources that can be recreated. 35 | } 36 | #pragma mark - UITableViewDataSource 37 | -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 38 | { 39 | return self.totalArray.count; 40 | } 41 | 42 | -(UITableViewCell *)tableView:(UITableView *)tableView 43 | cellForRowAtIndexPath:(NSIndexPath *)indexPath 44 | { 45 | UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:DataCellIdentifier 46 | forIndexPath:indexPath]; 47 | 48 | NSDictionary *dic = self.totalArray[indexPath.row]; 49 | NSString *title=dic[@"title"] ; 50 | // NSString *imageName=dic[@"imageName"]; 51 | //个人设置 52 | cell.textLabel.text=title; 53 | // cell.imageView.image=[UIImage imageNamed:imageName]; 54 | 55 | return cell; 56 | } 57 | 58 | 59 | #pragma mark - UITableViewDelegate 60 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ 61 | // if (indexPath.section==0) { 62 | // return 100; 63 | // } 64 | return 44; 65 | } 66 | 67 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 68 | [tableView deselectRowAtIndexPath:indexPath animated:YES];// 取消选中 69 | NSDictionary *dic = self.totalArray[indexPath.row]; 70 | 71 | NSString *sbID=dic[@"StoryBoardID"]; 72 | if (sbID) { 73 | if (sbID.length>0) { 74 | 75 | //获取storyboard: 通过bundle根据storyboard的名字来获取我们的storyboard, 76 | UIStoryboard *story = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]]; 77 | //由storyboard根据myView的storyBoardID来获取我们要切换的视图 78 | UIViewController *vc = [story instantiateViewControllerWithIdentifier:sbID]; 79 | 80 | [self.navigationController pushViewController:vc animated:YES]; 81 | return; 82 | } 83 | } 84 | 85 | 86 | 87 | //得到target名,如Target_TabBar。 88 | NSString *targetClassString = dic[@"vc"]; 89 | //得到方法名,Action_%@: , 如Action_nativeTabBarController 90 | // NSString *actionString = [NSString stringWithFormat:@"Action_%@:", actionName]; 91 | 92 | Class targetClass = NSClassFromString(targetClassString); 93 | id target = [[targetClass alloc] init]; 94 | // SEL action = NSSelectorFromString(actionString); 95 | if ([target isKindOfClass:[UIViewController class]]) { 96 | [self.navigationController pushViewController:target animated:YES]; 97 | } 98 | } 99 | 100 | 101 | -(UITableView *)tableView{ 102 | if (!_tableView) { 103 | //-kNavigationBarHeight 104 | CGSize size = [UIScreen mainScreen].bounds.size; 105 | _tableView=[[UITableView alloc] initWithFrame:CGRectMake(0,0, size.width, size.height) 106 | style:UITableViewStyleGrouped]; 107 | 108 | [_tableView registerClass:[UITableViewCell class] 109 | forCellReuseIdentifier:DataCellIdentifier]; 110 | 111 | // _tableView.separatorStyle= UITableViewCellSeparatorStyleNone; 112 | _tableView.delegate=self; 113 | _tableView.dataSource=self; 114 | 115 | //去除footer底下横线 116 | _tableView.tableFooterView=[UIView new]; 117 | } 118 | return _tableView; 119 | } 120 | @end 121 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 zzgo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # HZImageFilter 2 | iOS 原生图片滤镜使用,并根据苹果文档尝试了抠图,拼图。最后再把滤镜添加到视频上。 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 | --------------------------------------------------------------------------------