├── QSImageProcessDemo ├── Pods │ ├── Headers │ │ ├── Private │ │ │ ├── SDWebImage │ │ │ │ ├── UIImage+GIF.h │ │ │ │ ├── SDImageCache.h │ │ │ │ ├── NSImage+WebCache.h │ │ │ │ ├── SDWebImageCompat.h │ │ │ │ ├── UIView+WebCache.h │ │ │ │ ├── SDImageCacheConfig.h │ │ │ │ ├── SDWebImageDecoder.h │ │ │ │ ├── SDWebImageManager.h │ │ │ │ ├── UIButton+WebCache.h │ │ │ │ ├── SDWebImageDownloader.h │ │ │ │ ├── SDWebImageOperation.h │ │ │ │ ├── SDWebImagePrefetcher.h │ │ │ │ ├── UIImage+MultiFormat.h │ │ │ │ ├── UIImageView+WebCache.h │ │ │ │ ├── NSData+ImageContentType.h │ │ │ │ ├── UIView+WebCacheOperation.h │ │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ │ └── UIImageView+HighlightedWebCache.h │ │ │ ├── MLeaksFinder │ │ │ │ ├── MLeaksFinder.h │ │ │ │ ├── MLeaksMessenger.h │ │ │ │ ├── MLeakedObjectProxy.h │ │ │ │ ├── UITouch+MemoryLeak.h │ │ │ │ ├── UIView+MemoryLeak.h │ │ │ │ ├── NSObject+MemoryLeak.h │ │ │ │ ├── UIApplication+MemoryLeak.h │ │ │ │ ├── UIViewController+MemoryLeak.h │ │ │ │ ├── UITabBarController+MemoryLeak.h │ │ │ │ ├── UINavigationController+MemoryLeak.h │ │ │ │ ├── UIPageViewController+MemoryLeak.h │ │ │ │ └── UISplitViewController+MemoryLeak.h │ │ │ ├── FBRetainCycleDetector │ │ │ │ ├── fishhook.h │ │ │ │ ├── Struct.h │ │ │ │ ├── Type.h │ │ │ │ ├── BaseType.h │ │ │ │ ├── FBRetainCycleUtils.h │ │ │ │ ├── FBNodeEnumerator.h │ │ │ │ ├── FBObjectiveCBlock.h │ │ │ │ ├── FBObjectiveCObject.h │ │ │ │ ├── FBBlockInterface.h │ │ │ │ ├── FBAssociationManager.h │ │ │ │ ├── FBBlockStrongLayout.h │ │ │ │ ├── FBClassStrongLayout.h │ │ │ │ ├── FBObjectiveCGraphElement.h │ │ │ │ ├── FBRetainCycleDetector.h │ │ │ │ ├── FBIvarReference.h │ │ │ │ ├── FBObjectGraphConfiguration.h │ │ │ │ ├── FBObjectReference.h │ │ │ │ ├── FBObjectiveCNSCFTimer.h │ │ │ │ ├── FBStandardGraphEdgeFilters.h │ │ │ │ ├── FBClassStrongLayoutHelpers.h │ │ │ │ ├── FBRetainCycleDetector+Internal.h │ │ │ │ ├── FBStructEncodingParser.h │ │ │ │ ├── FBBlockStrongRelationDetector.h │ │ │ │ ├── FBObjectInStructReference.h │ │ │ │ ├── FBAssociationManager+Internal.h │ │ │ │ └── FBObjectiveCGraphElement+Internal.h │ │ │ └── QSDispatchQueue │ │ │ │ └── QSDispatchQueue.h │ │ └── Public │ │ │ ├── SDWebImage │ │ │ ├── UIImage+GIF.h │ │ │ ├── SDImageCache.h │ │ │ ├── NSImage+WebCache.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── UIView+WebCache.h │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── UIView+WebCacheOperation.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ └── UIImageView+HighlightedWebCache.h │ │ │ ├── MLeaksFinder │ │ │ ├── MLeaksFinder.h │ │ │ └── NSObject+MemoryLeak.h │ │ │ ├── QSDispatchQueue │ │ │ └── QSDispatchQueue.h │ │ │ └── FBRetainCycleDetector │ │ │ ├── FBObjectiveCBlock.h │ │ │ ├── FBObjectiveCObject.h │ │ │ ├── FBAssociationManager.h │ │ │ ├── FBObjectiveCGraphElement.h │ │ │ ├── FBRetainCycleDetector.h │ │ │ ├── FBObjectGraphConfiguration.h │ │ │ ├── FBObjectiveCNSCFTimer.h │ │ │ └── FBStandardGraphEdgeFilters.h │ ├── Target Support Files │ │ ├── SDWebImage │ │ │ ├── SDWebImage-dummy.m │ │ │ ├── SDWebImage-prefix.pch │ │ │ └── SDWebImage.xcconfig │ │ ├── MLeaksFinder │ │ │ ├── MLeaksFinder-dummy.m │ │ │ ├── MLeaksFinder-prefix.pch │ │ │ └── MLeaksFinder.xcconfig │ │ ├── QSDispatchQueue │ │ │ ├── QSDispatchQueue-dummy.m │ │ │ ├── QSDispatchQueue-prefix.pch │ │ │ └── QSDispatchQueue.xcconfig │ │ ├── FBRetainCycleDetector │ │ │ ├── FBRetainCycleDetector-dummy.m │ │ │ ├── FBRetainCycleDetector-prefix.pch │ │ │ └── FBRetainCycleDetector.xcconfig │ │ └── Pods-QSImageProcessDemo │ │ │ ├── Pods-QSImageProcessDemo-dummy.m │ │ │ ├── Pods-QSImageProcessDemo.debug.xcconfig │ │ │ └── Pods-QSImageProcessDemo.release.xcconfig │ ├── MLeaksFinder │ │ ├── MLeaksFinder │ │ │ ├── UITouch+MemoryLeak.h │ │ │ ├── UIView+MemoryLeak.h │ │ │ ├── UIApplication+MemoryLeak.h │ │ │ ├── MLeakedObjectProxy.h │ │ │ ├── UIViewController+MemoryLeak.h │ │ │ ├── UITabBarController+MemoryLeak.h │ │ │ ├── UIPageViewController+MemoryLeak.h │ │ │ ├── UINavigationController+MemoryLeak.h │ │ │ ├── UISplitViewController+MemoryLeak.h │ │ │ ├── UIView+MemoryLeak.m │ │ │ ├── MLeaksMessenger.h │ │ │ ├── UITabBarController+MemoryLeak.m │ │ │ ├── UIPageViewController+MemoryLeak.m │ │ │ ├── UISplitViewController+MemoryLeak.m │ │ │ ├── NSObject+MemoryLeak.h │ │ │ ├── MLeaksFinder.h │ │ │ ├── UITouch+MemoryLeak.m │ │ │ ├── UIApplication+MemoryLeak.m │ │ │ ├── MLeaksMessenger.m │ │ │ └── UIViewController+MemoryLeak.m │ │ ├── README-CN.md │ │ └── LICENSE │ ├── SDWebImage │ │ ├── SDWebImage │ │ │ ├── SDWebImageOperation.h │ │ │ ├── NSImage+WebCache.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── SDWebImageDecoder.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── NSImage+WebCache.m │ │ │ ├── SDImageCacheConfig.m │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── UIView+WebCacheOperation.h │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── UIImage+GIF.m │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── UIView+WebCacheOperation.m │ │ │ ├── SDWebImageCompat.m │ │ │ └── UIView+WebCache.h │ │ └── LICENSE │ ├── FBRetainCycleDetector │ │ ├── FBRetainCycleDetector │ │ │ ├── Detector │ │ │ │ ├── FBRetainCycleDetector+Internal.h │ │ │ │ ├── FBNodeEnumerator.h │ │ │ │ └── FBNodeEnumerator.mm │ │ │ ├── Graph │ │ │ │ ├── Internal │ │ │ │ │ └── FBObjectiveCGraphElement+Internal.h │ │ │ │ ├── FBObjectiveCBlock.h │ │ │ │ ├── FBObjectiveCObject.h │ │ │ │ ├── Specialization │ │ │ │ │ ├── FBObjectiveCNSCFTimer.h │ │ │ │ │ └── FBObjectiveCNSCFTimer.mm │ │ │ │ ├── FBObjectGraphConfiguration.m │ │ │ │ ├── FBObjectiveCBlock.m │ │ │ │ ├── FBObjectiveCGraphElement.h │ │ │ │ └── FBObjectGraphConfiguration.h │ │ │ ├── Layout │ │ │ │ ├── Classes │ │ │ │ │ ├── FBClassStrongLayoutHelpers.m │ │ │ │ │ ├── FBClassStrongLayoutHelpers.h │ │ │ │ │ ├── Reference │ │ │ │ │ │ ├── FBObjectInStructReference.h │ │ │ │ │ │ ├── FBIvarReference.h │ │ │ │ │ │ ├── FBObjectInStructReference.m │ │ │ │ │ │ ├── FBObjectReference.h │ │ │ │ │ │ └── FBIvarReference.m │ │ │ │ │ ├── Parser │ │ │ │ │ │ ├── BaseType.h │ │ │ │ │ │ ├── Type.h │ │ │ │ │ │ ├── Struct.h │ │ │ │ │ │ ├── FBStructEncodingParser.h │ │ │ │ │ │ └── Struct.mm │ │ │ │ │ └── FBClassStrongLayout.h │ │ │ │ └── Blocks │ │ │ │ │ ├── FBBlockStrongLayout.h │ │ │ │ │ ├── FBBlockStrongRelationDetector.m │ │ │ │ │ ├── FBBlockStrongRelationDetector.h │ │ │ │ │ └── FBBlockInterface.h │ │ │ ├── Associations │ │ │ │ ├── Internal │ │ │ │ │ └── FBAssociationManager+Internal.h │ │ │ │ └── FBAssociationManager.h │ │ │ ├── FBRetainCycleUtils.h │ │ │ ├── Filtering │ │ │ │ ├── FBStandardGraphEdgeFilters.h │ │ │ │ └── FBStandardGraphEdgeFilters.mm │ │ │ └── FBRetainCycleUtils.m │ │ ├── LICENSE │ │ └── fishhook │ │ │ └── fishhook.h │ ├── Manifest.lock │ └── QSDispatchQueue │ │ ├── LICENSE │ │ ├── QSDispatchQueue │ │ └── QSDispatchQueue.h │ │ └── README.md ├── QSImageProcessDemo │ ├── Images │ │ ├── icon.jpeg │ │ └── icon_lena.png │ ├── ViewController.h │ ├── Controllers │ │ ├── QSMainViewController.h │ │ ├── QSWebImageController.h │ │ └── QSLocalImageController.h │ ├── Views │ │ ├── QSImageCell.h │ │ ├── QSWebImageCell.h │ │ ├── QSImageCell.m │ │ └── QSWebImageCell.m │ ├── AppDelegate.h │ ├── main.m │ ├── QSImageProcess │ │ ├── UIColor+QSImageProcess.h │ │ ├── SDWebImageExtension │ │ │ ├── UIImageView+QSImageProcess.h │ │ │ └── UIImageView+QSImageProcess.m │ │ ├── QSImageProcess.h │ │ ├── UIColor+QSImageProcess.m │ │ ├── QSImageProcessUtil.h │ │ ├── QSImageProcessConfig.h │ │ └── QSImageProcessConfig.m │ ├── ViewController.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── AppDelegate.m ├── Podfile ├── QSImageProcessDemo.xcodeproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── QSImageProcessDemo.xcworkspace │ └── contents.xcworkspacedata ├── Podfile.lock ├── QSImageProcessDemoTests │ ├── Info.plist │ └── QSImageProcessDemoTests.m └── QSImageProcessDemoUITests │ ├── Info.plist │ └── QSImageProcessDemoUITests.m ├── QSImageProcess ├── SDWebImage │ ├── SDWebImageOperation.h │ ├── NSImage+WebCache.h │ ├── UIImage+MultiFormat.h │ ├── SDWebImageDecoder.h │ ├── UIImage+GIF.h │ ├── NSImage+WebCache.m │ ├── SDImageCacheConfig.m │ ├── NSData+ImageContentType.h │ ├── UIView+WebCacheOperation.h │ ├── SDImageCacheConfig.h │ ├── NSData+ImageContentType.m │ ├── UIImage+GIF.m │ ├── UIImageView+HighlightedWebCache.m │ ├── UIView+WebCacheOperation.m │ ├── SDWebImageCompat.m │ └── UIView+WebCache.h ├── UIColor+QSImageProcess.h ├── SDWebImageExtension │ ├── UIImageView+QSImageProcess.h │ └── UIImageView+QSImageProcess.m ├── QSImageProcess.h ├── UIColor+QSImageProcess.m ├── QSImageProcessUtil.h ├── QSDispatchQueue │ └── QSDispatchQueue.h ├── QSImageProcessConfig.h └── QSImageProcessConfig.m ├── QSImageProcess.podspec ├── LICENSE ├── README.md └── .gitignore /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/MLeaksFinder.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/MLeaksFinder.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/MLeaksFinder/MLeaksFinder.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/MLeaksFinder.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/fishhook.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/fishhook/fishhook.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/MLeaksMessenger.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/MLeaksMessenger.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDecoder.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/MLeakedObjectProxy.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/MLeakedObjectProxy.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UITouch+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UITouch+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UIView+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UIView+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/NSObject+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/NSObject+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/QSDispatchQueue/QSDispatchQueue.h: -------------------------------------------------------------------------------- 1 | ../../../QSDispatchQueue/QSDispatchQueue/QSDispatchQueue.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/MLeaksFinder/NSObject+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/NSObject+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/QSDispatchQueue/QSDispatchQueue.h: -------------------------------------------------------------------------------- 1 | ../../../QSDispatchQueue/QSDispatchQueue/QSDispatchQueue.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UIApplication+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UIApplication+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UIViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UIViewController+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/Struct.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/Struct.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/Type.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/Type.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UITabBarController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UITabBarController+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/BaseType.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/BaseType.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBRetainCycleUtils.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/FBRetainCycleUtils.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UINavigationController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UINavigationController+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UIPageViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UIPageViewController+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/MLeaksFinder/UISplitViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | ../../../MLeaksFinder/MLeaksFinder/UISplitViewController+MemoryLeak.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBObjectiveCBlock.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCBlock.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBNodeEnumerator.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBNodeEnumerator.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectiveCBlock.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCBlock.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectiveCObject.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCObject.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBObjectiveCObject.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCObject.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBBlockInterface.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockInterface.h -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Images/icon.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buaa0300/QSImageProcess/HEAD/QSImageProcessDemo/QSImageProcessDemo/Images/icon.jpeg -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBAssociationManager.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Associations/FBAssociationManager.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBBlockStrongLayout.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockStrongLayout.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBClassStrongLayout.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectiveCGraphElement.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBRetainCycleDetector.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBRetainCycleDetector.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBAssociationManager.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Associations/FBAssociationManager.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBObjectiveCGraphElement.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBRetainCycleDetector.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBRetainCycleDetector.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBIvarReference.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBIvarReference.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectGraphConfiguration.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectGraphConfiguration.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectReference.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBObjectReference.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBObjectGraphConfiguration.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectGraphConfiguration.h -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Images/icon_lena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/buaa0300/QSImageProcess/HEAD/QSImageProcessDemo/QSImageProcessDemo/Images/icon_lena.png -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectiveCNSCFTimer.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/Specialization/FBObjectiveCNSCFTimer.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBStandardGraphEdgeFilters.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Filtering/FBStandardGraphEdgeFilters.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBObjectiveCNSCFTimer.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/Specialization/FBObjectiveCNSCFTimer.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Public/FBRetainCycleDetector/FBStandardGraphEdgeFilters.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Filtering/FBStandardGraphEdgeFilters.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBClassStrongLayoutHelpers.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayoutHelpers.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBRetainCycleDetector+Internal.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBRetainCycleDetector+Internal.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBStructEncodingParser.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/FBStructEncodingParser.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBBlockStrongRelationDetector.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockStrongRelationDetector.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectInStructReference.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBObjectInStructReference.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBAssociationManager+Internal.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Associations/Internal/FBAssociationManager+Internal.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Headers/Private/FBRetainCycleDetector/FBObjectiveCGraphElement+Internal.h: -------------------------------------------------------------------------------- 1 | ../../../FBRetainCycleDetector/FBRetainCycleDetector/Graph/Internal/FBObjectiveCGraphElement+Internal.h -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/MLeaksFinder/MLeaksFinder-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MLeaksFinder : NSObject 3 | @end 4 | @implementation PodsDummy_MLeaksFinder 5 | @end 6 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | 3 | target 'QSImageProcessDemo' do 4 | 5 | pod 'QSDispatchQueue' 6 | pod 'SDWebImage', '~>4.1.0' 7 | #内存泄漏检测 8 | pod 'MLeaksFinder' 9 | 10 | end 11 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/QSDispatchQueue/QSDispatchQueue-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_QSDispatchQueue : NSObject 3 | @end 4 | @implementation PodsDummy_QSDispatchQueue 5 | @end 6 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/FBRetainCycleDetector/FBRetainCycleDetector-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_FBRetainCycleDetector : NSObject 3 | @end 4 | @implementation PodsDummy_FBRetainCycleDetector 5 | @end 6 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/Pods-QSImageProcessDemo/Pods-QSImageProcessDemo-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_QSImageProcessDemo : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_QSImageProcessDemo 5 | @end 6 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/MLeaksFinder/MLeaksFinder-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/QSDispatchQueue/QSDispatchQueue-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/FBRetainCycleDetector/FBRetainCycleDetector-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Controllers/QSMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSMainViewController.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSMainViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Controllers/QSWebImageController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSWebImageController.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSWebImageController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Controllers/QSLocalImageController.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSLocalImageController.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSLocalImageController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Views/QSImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageCell.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSImageCell : UICollectionViewCell 12 | 13 | - (void)layoutWithData:(id)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Views/QSWebImageCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSWebImageCell.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSWebImageCell : UICollectionViewCell 12 | 13 | - (void)layoutWithData:(id)data; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UITouch+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITouch+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 8/31/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UITouch (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIView+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UIView (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIApplication+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 5/11/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UIApplication (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/MLeakedObjectProxy.h: -------------------------------------------------------------------------------- 1 | // 2 | // MLeakedObjectProxy.h 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 7/15/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface MLeakedObjectProxy : NSObject 12 | 13 | + (BOOL)isAnyObjectLeakedAtPtrs:(NSSet *)ptrs; 14 | + (void)addLeakedObject:(id)object; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UIViewController (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UITabBarController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBarController+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UITabBarController (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIPageViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIPageViewController+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UIPageViewController (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UINavigationController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UINavigationController (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UISplitViewController+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // UISplitViewController+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MLeaksFinder.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @interface UISplitViewController (MemoryLeak) 15 | 16 | @end 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. 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 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /QSImageProcess/UIColor+QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (QSImageProcess) 12 | 13 | + (UIColor *) colorWithRGB:(NSUInteger)rgb; 14 | 15 | + (UIColor *) colorWithRGB:(NSUInteger)rgb alpha:(CGFloat)alpha; 16 | 17 | - (NSString *) colorValue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/UIColor+QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (QSImageProcess) 12 | 13 | + (UIColor *) colorWithRGB:(NSUInteger)rgb; 14 | 15 | + (UIColor *) colorWithRGB:(NSUInteger)rgb alpha:(CGFloat)alpha; 16 | 17 | - (NSString *) colorValue; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /QSImageProcess.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "QSImageProcess" 3 | s.version = "1.0.0" 4 | s.summary = "A tool for process local image or web image" 5 | s.homepage = "https://github.com/buaa0300/QSImageProcess" 6 | s.license = "MIT" 7 | s.authors = {"南华coder" => "buaa0300@163.com"} 8 | s.platform = :ios, "7.0" 9 | s.source = {:git => "https://github.com/buaa0300/QSImageProcess.git", :tag => s.version} 10 | s.requires_arc = true 11 | s.source_files = "QSImageProcess/*" 12 | s.dependency "QSDispatchQueue" 13 | s.dependency "SDWebImage", "~>4.1.0" 14 | end 15 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 15 | - (nullable NSData *)sd_imageData; 16 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIView+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UIView+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @implementation UIView (MemoryLeak) 15 | 16 | - (BOOL)willDealloc { 17 | if (![super willDealloc]) { 18 | return NO; 19 | } 20 | 21 | [self willReleaseChildren:self.subviews]; 22 | 23 | return YES; 24 | } 25 | 26 | @end 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBRetainCycleDetector+Internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBRetainCycleDetector.h" 11 | 12 | @interface FBRetainCycleDetector () 13 | 14 | // Unit tests 15 | - (NSArray *)_shiftToUnifiedCycle:(NSArray *)array; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 15 | - (nullable NSData *)sd_imageData; 16 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/MLeaksMessenger.h: -------------------------------------------------------------------------------- 1 | // 2 | // MLeaksMessenger.h 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 7/17/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface MLeaksMessenger : NSObject 13 | 14 | + (void)alertWithTitle:(NSString *)title message:(NSString *)message; 15 | + (void)alertWithTitle:(NSString *)title 16 | message:(NSString *)message 17 | delegate:(id)delegate 18 | additionalButtonTitle:(NSString *)additionalButtonTitle; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) james 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | @interface UIImage (ForceDecode) 14 | 15 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 16 | 17 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/Internal/FBObjectiveCGraphElement+Internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectiveCGraphElement.h" 13 | 14 | @interface FBObjectiveCGraphElement () 15 | 16 | - (instancetype)initWithObject:(id)object; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UITabBarController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBarController+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UITabBarController+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @implementation UITabBarController (MemoryLeak) 15 | 16 | - (BOOL)willDealloc { 17 | if (![super willDealloc]) { 18 | return NO; 19 | } 20 | 21 | [self willReleaseChildren:self.viewControllers]; 22 | 23 | return YES; 24 | } 25 | 26 | @end 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/SDWebImageDecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) james 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | @interface UIImage (ForceDecode) 14 | 15 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 16 | 17 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view, typically from a nib. 20 | } 21 | 22 | 23 | - (void)didReceiveMemoryWarning { 24 | [super didReceiveMemoryWarning]; 25 | // Dispose of any resources that can be recreated. 26 | } 27 | 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIPageViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIPageViewController+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UIPageViewController+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @implementation UIPageViewController (MemoryLeak) 15 | 16 | - (BOOL)willDealloc { 17 | if (![super willDealloc]) { 18 | return NO; 19 | } 20 | 21 | [self willReleaseChildren:self.viewControllers]; 22 | 23 | return YES; 24 | } 25 | 26 | @end 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UISplitViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UISplitViewController+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UISplitViewController+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | @implementation UISplitViewController (MemoryLeak) 15 | 16 | - (BOOL)willDealloc { 17 | if (![super willDealloc]) { 18 | return NO; 19 | } 20 | 21 | [self willReleaseChildren:self.viewControllers]; 22 | 23 | return YES; 24 | } 25 | 26 | @end 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCBlock.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectiveCGraphElement.h" 13 | 14 | @class FBGraphEdgeFilterProvider; 15 | 16 | /** 17 | Object Graph element representing block. 18 | */ 19 | @interface FBObjectiveCBlock : FBObjectiveCGraphElement 20 | @end 21 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Compatibility method - creates an animated UIImage from an NSData, it will only contain the 1st frame image 16 | */ 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 18 | 19 | /** 20 | * Checks if an UIImage instance is a GIF. Will use the `images` array 21 | */ 22 | - (BOOL)isGIF; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/README-CN.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | **1) 引进 MLeaksFinder 后没生效?** 3 | 4 | * 先验证引进是否正确,在 UIViewController+MemoryLeak.m 的 `+ (void)load` 方法里加断点,看 app 启动时有没有进入。 5 | 6 | **2) 可以手动引进 MLeaksFinder 吗?** 7 | 8 | * 直接把 MLeaksFinder 的代码放到项目里即生效。如果把 MLeaksFinder 做为子工程,需要在主工程的 Build Settings -> Other Linker Flags 加上 `-ObjC`。 9 | * 只是引进 MLeaksFinder 的代码 Retain Cycle 功能还未生效,可以再手动加入 FBRetainCycleDetector 代码,然后把 MLeaksFinder.h 里的 `//#define MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 1` 打开。 10 | 11 | **3) Fail to find a retain cycle?** 12 | 13 | * 内存泄漏不一定是循环引用造成的。 14 | * 有的循环引用 FBRetainCycleDetector 不一定能找出。 15 | 16 | **4) 如何关掉 MLeaksFinder?** 17 | 18 | * 把 MLeaksFinder.h 里的 `//#define MEMORY_LEAKS_FINDER_ENABLED 0` 打开。 19 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Compatibility method - creates an animated UIImage from an NSData, it will only contain the 1st frame image 16 | */ 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 18 | 19 | /** 20 | * Checks if an UIImage instance is a GIF. Will use the `images` array 21 | */ 22 | - (BOOL)isGIF; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FBRetainCycleDetector (0.1.3) 3 | - MLeaksFinder (0.2.1): 4 | - FBRetainCycleDetector 5 | - QSDispatchQueue (1.0.1) 6 | - SDWebImage (4.1.0): 7 | - SDWebImage/Core (= 4.1.0) 8 | - SDWebImage/Core (4.1.0) 9 | 10 | DEPENDENCIES: 11 | - MLeaksFinder 12 | - QSDispatchQueue 13 | - SDWebImage (~> 4.1.0) 14 | 15 | SPEC CHECKSUMS: 16 | FBRetainCycleDetector: f0c7b290bf48ae77f6ae060843ce34ae341781eb 17 | MLeaksFinder: 0850e2f2abc7227adc4d4e2d1992b431264eb4d5 18 | QSDispatchQueue: 3981828538f605d115001ab033e60465a359951a 19 | SDWebImage: 0e435c14e402a6730315a0fb79f95e68654d55a4 20 | 21 | PODFILE CHECKSUM: c4eefc62dc82515961a824ba6933e663c9a2f48d 22 | 23 | COCOAPODS: 1.2.1 24 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/NSObject+MemoryLeak.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSObject+MemoryLeak.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define MLCheck(TARGET) [self willReleaseObject:(TARGET) relationship:@#TARGET]; 12 | 13 | @interface NSObject (MemoryLeak) 14 | 15 | - (BOOL)willDealloc; 16 | - (void)willReleaseObject:(id)object relationship:(NSString *)relationship; 17 | 18 | - (void)willReleaseChild:(id)child; 19 | - (void)willReleaseChildren:(NSArray *)children; 20 | 21 | - (NSArray *)viewStack; 22 | 23 | + (void)swizzleSEL:(SEL)originalSEL withSEL:(SEL)swizzledSEL; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - FBRetainCycleDetector (0.1.3) 3 | - MLeaksFinder (0.2.1): 4 | - FBRetainCycleDetector 5 | - QSDispatchQueue (1.0.1) 6 | - SDWebImage (4.1.0): 7 | - SDWebImage/Core (= 4.1.0) 8 | - SDWebImage/Core (4.1.0) 9 | 10 | DEPENDENCIES: 11 | - MLeaksFinder 12 | - QSDispatchQueue 13 | - SDWebImage (~> 4.1.0) 14 | 15 | SPEC CHECKSUMS: 16 | FBRetainCycleDetector: f0c7b290bf48ae77f6ae060843ce34ae341781eb 17 | MLeaksFinder: 0850e2f2abc7227adc4d4e2d1992b431264eb4d5 18 | QSDispatchQueue: 3981828538f605d115001ab033e60465a359951a 19 | SDWebImage: 0e435c14e402a6730315a0fb79f95e68654d55a4 20 | 21 | PODFILE CHECKSUM: c4eefc62dc82515961a824ba6933e663c9a2f48d 22 | 23 | COCOAPODS: 1.2.1 24 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/MLeaksFinder.h: -------------------------------------------------------------------------------- 1 | // 2 | // MLeaksFinder.h 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "NSObject+MemoryLeak.h" 10 | 11 | //#define MEMORY_LEAKS_FINDER_ENABLED 0 12 | 13 | #ifdef MEMORY_LEAKS_FINDER_ENABLED 14 | #define _INTERNAL_MLF_ENABLED MEMORY_LEAKS_FINDER_ENABLED 15 | #else 16 | #define _INTERNAL_MLF_ENABLED DEBUG 17 | #endif 18 | 19 | //#define MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 1 20 | 21 | #ifdef MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 22 | #define _INTERNAL_MLF_RC_ENABLED MEMORY_LEAKS_FINDER_RETAIN_CYCLE_ENABLED 23 | #elif COCOAPODS 24 | #define _INTERNAL_MLF_RC_ENABLED COCOAPODS 25 | #endif 26 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCObject.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectiveCGraphElement.h" 13 | 14 | @class FBGraphEdgeFilterProvider; 15 | 16 | /** 17 | FBObjectiveCGraphElement specialization that can gather all references kept in ivars, as part of collection 18 | etc. 19 | */ 20 | @interface FBObjectiveCObject : FBObjectiveCGraphElement 21 | @end 22 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayoutHelpers.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #if __has_feature(objc_arc) 11 | #error This file must be compiled with MRR. Use -fno-objc-arc flag. 12 | #endif 13 | 14 | #import "FBClassStrongLayoutHelpers.h" 15 | 16 | id FBExtractObjectByOffset(id obj, NSUInteger index) { 17 | id *idx = (id *)((uintptr_t)obj + (index * sizeof(void *))); 18 | 19 | return *idx; 20 | } 21 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | return NO; 27 | } 28 | 29 | @end 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _maxCacheAge = kDefaultCacheMaxCacheAge; 21 | _maxCacheSize = 0; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/Specialization/FBObjectiveCNSCFTimer.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectiveCObject.h" 13 | 14 | /** 15 | Specialization of FBObjectiveCObject for NSTimer. 16 | Standard methods that FBObjectiveCObject uses will not fetch us all objects retained by NSTimer. 17 | One good example is target of NSTimer. 18 | */ 19 | @interface FBObjectiveCNSCFTimer : FBObjectiveCObject 20 | @end 21 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | return NO; 27 | } 28 | 29 | @end 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemoTests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemoUITests/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 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _maxCacheAge = kDefaultCacheMaxCacheAge; 21 | _maxCacheSize = 0; 22 | } 23 | return self; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/QSDispatchQueue/QSDispatchQueue.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/QSDispatchQueue 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/QSDispatchQueue" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | PODS_BUILD_DIR = $BUILD_DIR 5 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/QSDispatchQueue 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = -framework "ImageIO" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockStrongLayout.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /** 17 | Returns an array of id objects that will have only those references 18 | that are retained by block. 19 | */ 20 | NSArray *_Nullable FBGetBlockStrongReferences(void *_Nonnull block); 21 | 22 | BOOL FBObjectIsBlock(void *_Nullable object); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/MLeaksFinder/MLeaksFinder.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MLeaksFinder 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MLeaksFinder" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FBRetainCycleDetector" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MLeaksFinder 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Associations/Internal/FBAssociationManager+Internal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBAssociationManager.h" 11 | #import "FBRetainCycleDetector.h" 12 | 13 | #if _INTERNAL_RCD_ENABLED 14 | 15 | namespace FB { namespace AssociationManager { 16 | 17 | void _threadUnsafeResetAssociationAtKey(id object, void *key); 18 | void _threadUnsafeSetStrongAssociation(id object, void *key, id value); 19 | void _threadUnsafeRemoveAssociations(id object); 20 | 21 | NSArray *associations(id object); 22 | 23 | } } 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayoutHelpers.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | Returns object on given index for obj in its ivar layout. 20 | It will try to map the object to an Objective-C object, so if the index 21 | is invalid it will crash with BAD_ACCESS. 22 | 23 | It cannot be called under ARC. 24 | */ 25 | id FBExtractObjectByOffset(id obj, NSUInteger index); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP 20 | }; 21 | 22 | @interface NSData (ImageContentType) 23 | 24 | /** 25 | * Return image format 26 | * 27 | * @param data the input image data 28 | * 29 | * @return the image format as `SDImageFormat` (enum) 30 | */ 31 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImageExtension/UIImageView+QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QSImageProcessConfig.h" 11 | 12 | @interface UIImageView (QSImageProcess) 13 | 14 | /** 15 | 加载并显示网络图片,调用前需要先设置好UIImageView的frame或bounds 16 | 17 | @param url 图片url 18 | @param placeholder 图片处理配置对象 19 | */ 20 | - (void)qs_setImageWithURL:(nullable NSURL *)url 21 | placeholderImage:(nullable UIImage *)placeholder; 22 | 23 | 24 | /** 25 | 加载并显示网络图片 26 | 27 | @param url 图片url 28 | @param placeholder 占位图 29 | @param config 图片处理配置对象 30 | */ 31 | - (void)qs_setImageWithURL:(nullable NSURL *)url 32 | placeholderImage:(nullable UIImage *)placeholder 33 | config:(QSImageProcessConfig *)config; 34 | 35 | 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/FBRetainCycleDetector/FBRetainCycleDetector.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/FBRetainCycleDetector 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = -l"c++" -framework "CoreGraphics" -framework "Foundation" -framework "UIKit" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/FBRetainCycleDetector 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP 20 | }; 21 | 22 | @interface NSData (ImageContentType) 23 | 24 | /** 25 | * Return image format 26 | * 27 | * @param data the input image data 28 | * 29 | * @return the image format as `SDImageFormat` (enum) 30 | */ 31 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/SDWebImageExtension/UIImageView+QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QSImageProcessConfig.h" 11 | 12 | @interface UIImageView (QSImageProcess) 13 | 14 | /** 15 | 加载并显示网络图片,调用前需要先设置好UIImageView的frame或bounds 16 | 17 | @param url 图片url 18 | @param placeholder 图片处理配置对象 19 | */ 20 | - (void)qs_setImageWithURL:(nullable NSURL *)url 21 | placeholderImage:(nullable UIImage *)placeholder; 22 | 23 | 24 | /** 25 | 加载并显示网络图片 26 | 27 | @param url 图片url 28 | @param placeholder 占位图 29 | @param config 图片处理配置对象 30 | */ 31 | - (void)qs_setImageWithURL:(nullable NSURL *)url 32 | placeholderImage:(nullable UIImage *)placeholder 33 | config:(QSImageProcessConfig *)config; 34 | 35 | 36 | 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBNodeEnumerator.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBObjectiveCGraphElement; 13 | 14 | /** 15 | FBNodeEnumerator wraps any object graph element (FBObjectiveCGraphElement) and lets you enumerate over its 16 | retained references 17 | */ 18 | @interface FBNodeEnumerator : NSEnumerator 19 | 20 | /** 21 | Designated initializer 22 | */ 23 | - (nonnull instancetype)initWithObject:(nonnull FBObjectiveCGraphElement *)object; 24 | 25 | - (nullable FBNodeEnumerator *)nextObject; 26 | 27 | @property (nonatomic, strong, readonly, nonnull) FBObjectiveCGraphElement *object; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBObjectInStructReference.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectReference.h" 13 | 14 | /** 15 | Struct object is an Objective-C object that is created inside 16 | a struct. In Objective-C++ that object will be retained 17 | by an object owning the struct, therefore will be listed in 18 | ivar layout for the class. 19 | */ 20 | 21 | @interface FBObjectInStructReference : NSObject 22 | 23 | - (nonnull instancetype)initWithIndex:(NSUInteger)index 24 | namePath:(nullable NSArray *)namePath; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/BaseType.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | namespace FB { namespace RetainCycleDetector { namespace Parser { 15 | class BaseType { 16 | public: 17 | virtual ~BaseType() {} 18 | }; 19 | 20 | class Unresolved: public BaseType { 21 | public: 22 | std::string value; 23 | Unresolved(std::string value): value(value) {} 24 | Unresolved(Unresolved&&) = default; 25 | Unresolved &operator=(Unresolved&&) = default; 26 | 27 | Unresolved(const Unresolved&) = delete; 28 | Unresolved &operator=(const Unresolved&) = delete; 29 | }; 30 | } } } 31 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UITouch+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITouch+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 8/31/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UITouch+MemoryLeak.h" 10 | #import 11 | 12 | #if _INTERNAL_MLF_ENABLED 13 | 14 | extern const void *const kLatestSenderKey; 15 | 16 | @implementation UITouch (MemoryLeak) 17 | 18 | + (void)load { 19 | static dispatch_once_t onceToken; 20 | dispatch_once(&onceToken, ^{ 21 | [self swizzleSEL:@selector(setView:) withSEL:@selector(swizzled_setView:)]; 22 | }); 23 | } 24 | 25 | - (void)swizzled_setView:(UIView *)view { 26 | [self swizzled_setView:view]; 27 | 28 | if (view) { 29 | objc_setAssociatedObject([UIApplication sharedApplication], 30 | kLatestSenderKey, 31 | @((uintptr_t)view), 32 | OBJC_ASSOCIATION_RETAIN); 33 | } 34 | } 35 | 36 | @end 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Views/QSImageCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageCell.m 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import "QSImageCell.h" 10 | #import "QSImageProcess.h" 11 | 12 | @interface QSImageCell() 13 | 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | 16 | @end 17 | 18 | @implementation QSImageCell 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame { 21 | 22 | if (self = [super initWithFrame:frame]) { 23 | 24 | self.imageView = [[UIImageView alloc] init]; 25 | self.imageView.frame = self.bounds; 26 | [self.contentView addSubview:self.imageView]; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)layoutWithData:(id)data{ 32 | 33 | [[QSImageProcess sharedInstance]processImage:[UIImage imageNamed:@"icon_lena.png"] config:(QSImageProcessConfig *)data completed:^(UIImage *outputImage) { 34 | 35 | self.imageView.image = outputImage; 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Views/QSWebImageCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSWebImageCell.m 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import "QSWebImageCell.h" 10 | #import "UIImageView+QSImageProcess.h" 11 | 12 | @interface QSWebImageCell() 13 | 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | 16 | @end 17 | 18 | @implementation QSWebImageCell 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame { 21 | 22 | if (self = [super initWithFrame:frame]) { 23 | 24 | self.imageView = [[UIImageView alloc] init]; 25 | self.imageView.frame = self.bounds; 26 | [self.contentView addSubview:self.imageView]; 27 | } 28 | return self; 29 | } 30 | 31 | - (void)layoutWithData:(id)data{ 32 | 33 | [self.imageView qs_setImageWithURL:[NSURL URLWithString:@"http://img6.faloo.com/Picture/0x0/0/183/183388.jpg"] placeholderImage:[UIImage imageNamed:@"icon.jpeg"] config:(QSImageProcessConfig *)data]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIApplication+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIApplication+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 5/11/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UIApplication+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | #import 12 | 13 | #if _INTERNAL_MLF_ENABLED 14 | 15 | extern const void *const kLatestSenderKey; 16 | 17 | @implementation UIApplication (MemoryLeak) 18 | 19 | + (void)load { 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | [self swizzleSEL:@selector(sendAction:to:from:forEvent:) withSEL:@selector(swizzled_sendAction:to:from:forEvent:)]; 23 | }); 24 | } 25 | 26 | - (BOOL)swizzled_sendAction:(SEL)action to:(id)target from:(id)sender forEvent:(UIEvent *)event { 27 | objc_setAssociatedObject(self, kLatestSenderKey, @((uintptr_t)sender), OBJC_ASSOCIATION_RETAIN); 28 | 29 | return [self swizzled_sendAction:action to:target from:sender forEvent:event]; 30 | } 31 | 32 | @end 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectGraphConfiguration.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBObjectGraphConfiguration.h" 11 | 12 | @implementation FBObjectGraphConfiguration 13 | 14 | - (instancetype)initWithFilterBlocks:(NSArray *)filterBlocks 15 | shouldInspectTimers:(BOOL)shouldInspectTimers 16 | { 17 | if (self = [super init]) { 18 | _filterBlocks = [filterBlocks copy]; 19 | _shouldInspectTimers = shouldInspectTimers; 20 | _layoutCache = [NSMutableDictionary new]; 21 | } 22 | 23 | return self; 24 | } 25 | 26 | - (instancetype)init 27 | { 28 | // By default we are inspecting timers 29 | return [self initWithFilterBlocks:@[] 30 | shouldInspectTimers:YES]; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBIvarReference.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | 14 | #import "FBObjectReference.h" 15 | 16 | typedef NS_ENUM(NSUInteger, FBType) { 17 | FBObjectType, 18 | FBBlockType, 19 | FBStructType, 20 | FBUnknownType, 21 | }; 22 | 23 | @interface FBIvarReference : NSObject 24 | 25 | @property (nonatomic, copy, readonly, nullable) NSString *name; 26 | @property (nonatomic, readonly) FBType type; 27 | @property (nonatomic, readonly) ptrdiff_t offset; 28 | @property (nonatomic, readonly) NSUInteger index; 29 | @property (nonatomic, readonly, nonnull) Ivar ivar; 30 | 31 | - (nonnull instancetype)initWithIvar:(nonnull Ivar)ivar; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 南华coder 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 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemoTests/QSImageProcessDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessDemoTests.m 3 | // QSImageProcessDemoTests 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSImageProcessDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation QSImageProcessDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 Zeposhe 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/QSDispatchQueue/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 南华coder 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 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /QSImageProcess/QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QSImageProcessConfig.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef void(^QSImageProcessCompletedBlock)(UIImage *outputImage); 15 | 16 | @class QSImageProcessConfig; 17 | 18 | @interface QSImageProcess : NSObject 19 | 20 | /** 21 | 图片处理配置对象 22 | */ 23 | @property (nonatomic,strong)QSImageProcessConfig *config; 24 | 25 | 26 | + (nonnull instancetype)sharedInstance; 27 | 28 | 29 | /** 30 | 异步图片处理 31 | 32 | @param image 待处理的图片 33 | @param config 图片处理配置对象 34 | @param completedBlock 处理完成块 35 | */ 36 | - (void)processImage:(UIImage *)image 37 | config:(QSImageProcessConfig *)config 38 | completed:(QSImageProcessCompletedBlock)completedBlock; 39 | 40 | 41 | 42 | /** 43 | 同步图片处理 44 | 45 | @param image 待处理的图片 46 | @param config 图片处理配置对象 47 | @return 返回处理好的图片 48 | */ 49 | - (UIImage *)processImage:(UIImage *)image 50 | config:(QSImageProcessConfig *)config; 51 | 52 | 53 | @end 54 | 55 | NS_ASSUME_NONNULL_END 56 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/QSImageProcess.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcess.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "QSImageProcessConfig.h" 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | typedef void(^QSImageProcessCompletedBlock)(UIImage *outputImage); 15 | 16 | @class QSImageProcessConfig; 17 | 18 | @interface QSImageProcess : NSObject 19 | 20 | /** 21 | 图片处理配置对象 22 | */ 23 | @property (nonatomic,strong)QSImageProcessConfig *config; 24 | 25 | 26 | + (nonnull instancetype)sharedInstance; 27 | 28 | 29 | /** 30 | 异步图片处理 31 | 32 | @param image 待处理的图片 33 | @param config 图片处理配置对象 34 | @param completedBlock 处理完成块 35 | */ 36 | - (void)processImage:(UIImage *)image 37 | config:(QSImageProcessConfig *)config 38 | completed:(QSImageProcessCompletedBlock)completedBlock; 39 | 40 | 41 | 42 | /** 43 | 同步图片处理 44 | 45 | @param image 待处理的图片 46 | @param config 图片处理配置对象 47 | @return 返回处理好的图片 48 | */ 49 | - (UIImage *)processImage:(UIImage *)image 50 | config:(QSImageProcessConfig *)config; 51 | 52 | 53 | @end 54 | 55 | NS_ASSUME_NONNULL_END 56 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | @interface UIView (WebCacheOperation) 16 | 17 | /** 18 | * Set the image load operation (storage in a UIView based dictionary) 19 | * 20 | * @param operation the operation 21 | * @param key key for storing the operation 22 | */ 23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 24 | 25 | /** 26 | * Cancel all operations for the current UIView and key 27 | * 28 | * @param key key for identifying the operations 29 | */ 30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 31 | 32 | /** 33 | * Just remove the operations corresponding to the current UIView and key without cancelling them 34 | * 35 | * @param key key for identifying the operations 36 | */ 37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/Type.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import 13 | #import 14 | #import 15 | 16 | #import "BaseType.h" 17 | 18 | namespace FB { namespace RetainCycleDetector { namespace Parser { 19 | class Type: public BaseType { 20 | public: 21 | const std::string name; 22 | const std::string typeEncoding; 23 | 24 | Type(const std::string &name, 25 | const std::string &typeEncoding): name(name), typeEncoding(typeEncoding) {} 26 | Type(Type&&) = default; 27 | Type &operator=(Type&&) = default; 28 | 29 | Type(const Type&) = delete; 30 | Type &operator=(const Type&) = delete; 31 | 32 | virtual void passTypePath(std::vector typePath) { 33 | this->typePath = typePath; 34 | } 35 | 36 | std::vector typePath; 37 | }; 38 | } } } 39 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Associations/FBAssociationManager.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | FBAssociationManager is a tracker of object associations. For given object it can return all objects that 14 | are being retained by this object with objc_setAssociatedObject & retain policy. 15 | */ 16 | @interface FBAssociationManager : NSObject 17 | 18 | /** 19 | Start tracking associations. It will use fishhook to swizzle C methods: 20 | objc_(set/remove)AssociatedObject and inject some tracker code. 21 | */ 22 | + (void)hook; 23 | 24 | /** 25 | Stop tracking associations, fishhooks. 26 | */ 27 | + (void)unhook; 28 | 29 | /** 30 | For given object return all objects that are retained by it using associated objects. 31 | 32 | @return NSArray of objects associated with given object 33 | */ 34 | + (nullable NSArray *)associationsForObject:(nullable id)object; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | @interface UIView (WebCacheOperation) 16 | 17 | /** 18 | * Set the image load operation (storage in a UIView based dictionary) 19 | * 20 | * @param operation the operation 21 | * @param key key for storing the operation 22 | */ 23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 24 | 25 | /** 26 | * Cancel all operations for the current UIView and key 27 | * 28 | * @param key key for identifying the operations 29 | */ 30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 31 | 32 | /** 33 | * Just remove the operations corresponding to the current UIView and key without cancelling them 34 | * 35 | * @param key key for identifying the operations 36 | */ 37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /QSImageProcess/UIColor+QSImageProcess.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+QSImageProcess.m 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "UIColor+QSImageProcess.h" 10 | 11 | @implementation UIColor (QSImageProcess) 12 | 13 | + (UIColor *) colorWithRGB:(NSUInteger)rgb{ 14 | 15 | return [UIColor colorWithRGB:rgb alpha:1.0f]; 16 | } 17 | 18 | + (UIColor *) colorWithRGB:(NSUInteger)rgb alpha:(CGFloat)alpha{ 19 | 20 | NSUInteger red = ( (rgb&0xff0000) >> 16 ); 21 | NSUInteger green = ( (rgb&0xff00) >> 8 ); 22 | NSUInteger blue = ( rgb & 0xFF ); 23 | CGFloat r = (CGFloat)red / 255.0f; 24 | CGFloat g = (CGFloat)green / 255.0f; 25 | CGFloat b = (CGFloat)blue / 255.0f; 26 | 27 | return [UIColor colorWithRed:r green:g blue:b alpha:alpha]; 28 | } 29 | 30 | 31 | - (NSString *)colorValue{ 32 | 33 | CGFloat redValue, greenValue, blueValue, alphaValue; 34 | NSString *value = @"novalue"; 35 | if ([self getRed:&redValue green:&greenValue blue:&blueValue alpha:&alphaValue]) { 36 | value = [NSString stringWithFormat:@"%.0lf_%.0lf_%.0lf_%.0lf",redValue,greenValue,blueValue,alphaValue]; 37 | } 38 | return value; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The maximum length of time to keep an image in the cache, in seconds 32 | */ 33 | @property (assign, nonatomic) NSInteger maxCacheAge; 34 | 35 | /** 36 | * The maximum size of the cache, in bytes. 37 | */ 38 | @property (assign, nonatomic) NSUInteger maxCacheSize; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The maximum length of time to keep an image in the cache, in seconds 32 | */ 33 | @property (assign, nonatomic) NSInteger maxCacheAge; 34 | 35 | /** 36 | * The maximum size of the cache, in bytes. 37 | */ 38 | @property (assign, nonatomic) NSUInteger maxCacheSize; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/Pods-QSImageProcessDemo/Pods-QSImageProcessDemo.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FBRetainCycleDetector" "$PODS_CONFIGURATION_BUILD_DIR/MLeaksFinder" "$PODS_CONFIGURATION_BUILD_DIR/QSDispatchQueue" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" -isystem "${PODS_ROOT}/Headers/Public/MLeaksFinder" -isystem "${PODS_ROOT}/Headers/Public/QSDispatchQueue" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"FBRetainCycleDetector" -l"MLeaksFinder" -l"QSDispatchQueue" -l"SDWebImage" -l"c++" -framework "CoreGraphics" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/Target Support Files/Pods-QSImageProcessDemo/Pods-QSImageProcessDemo.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" "${PODS_ROOT}/Headers/Public/MLeaksFinder" "${PODS_ROOT}/Headers/Public/QSDispatchQueue" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/FBRetainCycleDetector" "$PODS_CONFIGURATION_BUILD_DIR/MLeaksFinder" "$PODS_CONFIGURATION_BUILD_DIR/QSDispatchQueue" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/FBRetainCycleDetector" -isystem "${PODS_ROOT}/Headers/Public/MLeaksFinder" -isystem "${PODS_ROOT}/Headers/Public/QSDispatchQueue" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"FBRetainCycleDetector" -l"MLeaksFinder" -l"QSDispatchQueue" -l"SDWebImage" -l"c++" -framework "CoreGraphics" -framework "Foundation" -framework "ImageIO" -framework "UIKit" 6 | PODS_BUILD_DIR = $BUILD_DIR 7 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/UIColor+QSImageProcess.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+QSImageProcess.m 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "UIColor+QSImageProcess.h" 10 | 11 | @implementation UIColor (QSImageProcess) 12 | 13 | + (UIColor *) colorWithRGB:(NSUInteger)rgb{ 14 | 15 | return [UIColor colorWithRGB:rgb alpha:1.0f]; 16 | } 17 | 18 | + (UIColor *) colorWithRGB:(NSUInteger)rgb alpha:(CGFloat)alpha{ 19 | 20 | NSUInteger red = ( (rgb&0xff0000) >> 16 ); 21 | NSUInteger green = ( (rgb&0xff00) >> 8 ); 22 | NSUInteger blue = ( rgb & 0xFF ); 23 | CGFloat r = (CGFloat)red / 255.0f; 24 | CGFloat g = (CGFloat)green / 255.0f; 25 | CGFloat b = (CGFloat)blue / 255.0f; 26 | 27 | return [UIColor colorWithRed:r green:g blue:b alpha:alpha]; 28 | } 29 | 30 | 31 | - (NSString *)colorValue{ 32 | 33 | CGFloat redValue, greenValue, blueValue, alphaValue; 34 | NSString *value = @"novalue"; 35 | if ([self getRed:&redValue green:&greenValue blue:&blueValue alpha:&alphaValue]) { 36 | value = [NSString stringWithFormat:@"%.0lf_%.0lf_%.0lf_%.0lf",redValue,greenValue,blueValue,alphaValue]; 37 | } 38 | return value; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | @protocol FBObjectReference; 17 | /** 18 | @return An array of id objects that will have *all* references 19 | the object has (also not retained ivars, structs etc.) 20 | */ 21 | NSArray> *_Nonnull FBGetClassReferences(__unsafe_unretained Class _Nullable aCls); 22 | 23 | /** 24 | @return An array of id objects that will have only those references 25 | that are retained by the object. It also goes through parent classes. 26 | */ 27 | NSArray> *_Nonnull FBGetObjectStrongReferences(id _Nullable obj, 28 | NSMutableDictionary> *> *_Nullable layoutCache); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /QSImageProcess/QSImageProcessUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessUtil.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class QSImageProcessConfig; 12 | 13 | // 图片处理0 - 默认 14 | void QSImageProcessDefault(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 15 | 16 | /** 17 | 图片处理1 - 裁剪圆角 18 | 19 | @param context 图形上下文 20 | @param image 需要处理的图片 21 | @param config 图片处理的配置对象 22 | */ 23 | void QSImageProcessClipCorner(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 24 | 25 | 26 | /** 27 | 图片处理1 - 环形 28 | 29 | @param context 图形上下文 30 | @param image 需要处理的图片 31 | @param config 图片处理的配置对象 32 | */ 33 | void QSImageProcessRound(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 34 | 35 | 36 | /** 37 | 图片处理3 - 给图片添加渐变蒙版(默认色) 38 | 39 | @param context 图形上下文 40 | @param image 需要处理的图片 41 | @param config 图片处理的配置对象 42 | */ 43 | void QSImageProcessAddGradationMask(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 44 | 45 | 46 | /** 47 | 图片处理4 - 给图片添加整块蒙版 48 | 49 | @param context 图形上下文 50 | @param image 需要处理的图片 51 | @param config 图片处理的配置对象 52 | */ 53 | void QSImageProcessAddWholeMask(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 54 | 55 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/MLeaksMessenger.m: -------------------------------------------------------------------------------- 1 | // 2 | // MLeaksMessenger.m 3 | // MLeaksFinder 4 | // 5 | // Created by 佘泽坡 on 7/17/16. 6 | // Copyright © 2016 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "MLeaksMessenger.h" 10 | 11 | static __weak UIAlertView *alertView; 12 | 13 | @implementation MLeaksMessenger 14 | 15 | + (void)alertWithTitle:(NSString *)title message:(NSString *)message { 16 | [self alertWithTitle:title message:message delegate:nil additionalButtonTitle:nil]; 17 | } 18 | 19 | + (void)alertWithTitle:(NSString *)title 20 | message:(NSString *)message 21 | delegate:(id)delegate 22 | additionalButtonTitle:(NSString *)additionalButtonTitle { 23 | [alertView dismissWithClickedButtonIndex:0 animated:NO]; 24 | UIAlertView *alertViewTemp = [[UIAlertView alloc] initWithTitle:title 25 | message:message 26 | delegate:delegate 27 | cancelButtonTitle:@"OK" 28 | otherButtonTitles:additionalButtonTitle, nil]; 29 | [alertViewTemp show]; 30 | alertView = alertViewTemp; 31 | 32 | NSLog(@"%@: %@", title, message); 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockStrongRelationDetector.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #if __has_feature(objc_arc) 11 | #error This file must be compiled with MRR. Use -fno-objc-arc flag. 12 | #endif 13 | 14 | #import "FBBlockStrongRelationDetector.h" 15 | 16 | #import 17 | 18 | static void byref_keep_nop(struct _block_byref_block *dst, struct _block_byref_block *src) {} 19 | static void byref_dispose_nop(struct _block_byref_block *param) {} 20 | 21 | @implementation FBBlockStrongRelationDetector 22 | 23 | - (oneway void)release 24 | { 25 | _strong = YES; 26 | } 27 | 28 | - (id)retain 29 | { 30 | return self; 31 | } 32 | 33 | + (id)alloc 34 | { 35 | FBBlockStrongRelationDetector *obj = [super alloc]; 36 | 37 | // Setting up block fakery 38 | obj->forwarding = obj; 39 | obj->byref_keep = byref_keep_nop; 40 | obj->byref_dispose = byref_dispose_nop; 41 | 42 | return obj; 43 | } 44 | 45 | - (oneway void)trueRelease 46 | { 47 | [super release]; 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /QSImageProcess/QSDispatchQueue/QSDispatchQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSDispatchQueue.h 3 | // 4 | // Created by zhongpingjiang on 2017/7/21. 5 | // Copyright © 2017年 shaoqing. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface QSDispatchQueue : NSObject 12 | 13 | #pragma mark - main queue + global queue 14 | 15 | /** 16 | 全局并发队列的最大并发数,默认4 17 | */ 18 | + (QSDispatchQueue *)mainThreadQueue; 19 | 20 | + (QSDispatchQueue *)defaultGlobalQueue; 21 | 22 | + (QSDispatchQueue *)lowGlobalQueue; 23 | 24 | + (QSDispatchQueue *)highGlobalQueue; 25 | 26 | + (QSDispatchQueue *)backGroundGlobalQueue; 27 | 28 | 29 | #pragma mark - 30 | 31 | @property (nonatomic,assign,readonly)NSUInteger concurrentCount; 32 | 33 | - (instancetype)init; 34 | 35 | /** 36 | 默认最大并发数是1 37 | @param queue 创建的并发队列 38 | */ 39 | - (instancetype)initWithQueue:(dispatch_queue_t)queue; 40 | 41 | 42 | /** 43 | @param queue 创建的并发队列 44 | @param concurrentCount 最大并发数,应大于1 45 | */ 46 | - (instancetype)initWithQueue:(dispatch_queue_t)queue 47 | concurrentCount:(NSUInteger)concurrentCount; 48 | 49 | 50 | /** 51 | 同步,并行队列变成了串行队列,最大并发数只能是1,设置concurrentCount是无效的 52 | 53 | @param block 任务block 54 | */ 55 | - (void)sync:(dispatch_block_t)block; 56 | 57 | 58 | /** 59 | 异步 60 | 61 | @param block 任务block 62 | */ 63 | - (void)async:(dispatch_block_t)block; 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBObjectInStructReference.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBObjectInStructReference.h" 11 | 12 | #import "FBClassStrongLayoutHelpers.h" 13 | 14 | @implementation FBObjectInStructReference 15 | { 16 | NSUInteger _index; 17 | NSArray *_namePath; 18 | } 19 | 20 | - (instancetype)initWithIndex:(NSUInteger)index 21 | namePath:(NSArray *)namePath 22 | { 23 | if (self = [super init]) { 24 | _index = index; 25 | _namePath = namePath; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (NSString *)description 32 | { 33 | return [NSString stringWithFormat:@"[in_struct; index: %td]", _index]; 34 | } 35 | 36 | #pragma mark - FBObjectReference 37 | 38 | - (id)objectReferenceFromObject:(id)object 39 | { 40 | return FBExtractObjectByOffset(object, _index); 41 | } 42 | 43 | - (NSUInteger)indexInIvarLayout 44 | { 45 | return _index; 46 | } 47 | 48 | - (NSArray *)namePath 49 | { 50 | return _namePath; 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/QSImageProcessUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessUtil.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class QSImageProcessConfig; 12 | 13 | // 图片处理0 - 默认 14 | void QSImageProcessDefault(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 15 | 16 | /** 17 | 图片处理1 - 裁剪圆角 18 | 19 | @param context 图形上下文 20 | @param image 需要处理的图片 21 | @param config 图片处理的配置对象 22 | */ 23 | void QSImageProcessClipCorner(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 24 | 25 | 26 | /** 27 | 图片处理1 - 环形 28 | 29 | @param context 图形上下文 30 | @param image 需要处理的图片 31 | @param config 图片处理的配置对象 32 | */ 33 | void QSImageProcessRound(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 34 | 35 | 36 | /** 37 | 图片处理3 - 给图片添加渐变蒙版(默认色) 38 | 39 | @param context 图形上下文 40 | @param image 需要处理的图片 41 | @param config 图片处理的配置对象 42 | */ 43 | void QSImageProcessAddGradationMask(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 44 | 45 | 46 | /** 47 | 图片处理4 - 给图片添加整块蒙版 48 | 49 | @param context 图形上下文 50 | @param image 需要处理的图片 51 | @param config 图片处理的配置对象 52 | */ 53 | void QSImageProcessAddWholeMask(CGContextRef context, UIImage *image, QSImageProcessConfig *config); 54 | 55 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockStrongRelationDetector.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | We created a detector object that will fake *any* object that block can retain. 14 | 15 | Using clever trickery from Circle: 16 | https://github.com/mikeash/Circle/blob/master/Circle/CircleIVarLayout.m 17 | 18 | We are also faking that this object can be treated as a block. 19 | Otherwise if the block is retained by block, it will try to call byref_dispose and 20 | our object won't be able to respond. 21 | */ 22 | 23 | struct _block_byref_block; 24 | @interface FBBlockStrongRelationDetector : NSObject 25 | { 26 | // __block fakery 27 | void *forwarding; 28 | int flags; //refcount; 29 | int size; 30 | void (*byref_keep)(struct _block_byref_block *dst, struct _block_byref_block *src); 31 | void (*byref_dispose)(struct _block_byref_block *); 32 | void *captured[16]; 33 | } 34 | 35 | @property (nonatomic, assign, getter=isStrong) BOOL strong; 36 | 37 | - (oneway void)trueRelease; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/QSDispatchQueue/QSDispatchQueue/QSDispatchQueue.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSDispatchQueue.h 3 | // 4 | // Created by zhongpingjiang on 2017/7/21. 5 | // Copyright © 2017年 shaoqing. All rights reserved. 6 | // 7 | 8 | #import 9 | 10 | 11 | @interface QSDispatchQueue : NSObject 12 | 13 | #pragma mark - main queue + global queue 14 | 15 | /** 16 | 全局并发队列的最大并发数,默认4 17 | */ 18 | + (QSDispatchQueue *)mainThreadQueue; 19 | 20 | + (QSDispatchQueue *)defaultGlobalQueue; 21 | 22 | + (QSDispatchQueue *)lowGlobalQueue; 23 | 24 | + (QSDispatchQueue *)highGlobalQueue; 25 | 26 | + (QSDispatchQueue *)backGroundGlobalQueue; 27 | 28 | 29 | #pragma mark - 30 | 31 | @property (nonatomic,assign,readonly)NSUInteger concurrentCount; 32 | 33 | - (instancetype)init; 34 | 35 | /** 36 | 默认最大并发数是1 37 | @param queue 创建的并发队列 38 | */ 39 | - (instancetype)initWithQueue:(dispatch_queue_t)queue; 40 | 41 | 42 | /** 43 | @param queue 创建的并发队列 44 | @param concurrentCount 最大并发数,应大于1 45 | */ 46 | - (instancetype)initWithQueue:(dispatch_queue_t)queue 47 | concurrentCount:(NSUInteger)concurrentCount; 48 | 49 | 50 | /** 51 | 同步,并行队列变成了串行队列,最大并发数只能是1,设置concurrentCount是无效的 52 | 53 | @param block 任务block 54 | */ 55 | - (void)sync:(dispatch_block_t)block; 56 | 57 | 58 | /** 59 | 异步 60 | 61 | @param block 任务block 62 | */ 63 | - (void)async:(dispatch_block_t)block; 64 | 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCBlock.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBObjectiveCBlock.h" 11 | 12 | #import 13 | 14 | #import "FBBlockStrongLayout.h" 15 | #import "FBObjectiveCObject.h" 16 | #import "FBRetainCycleUtils.h" 17 | 18 | @implementation FBObjectiveCBlock 19 | 20 | - (NSSet *)allRetainedObjects 21 | { 22 | NSMutableArray *results = [[[super allRetainedObjects] allObjects] mutableCopy]; 23 | 24 | // Grab a strong reference to the object, otherwise it can crash while doing 25 | // nasty stuff on deallocation 26 | __attribute__((objc_precise_lifetime)) id anObject = self.object; 27 | 28 | void *blockObjectReference = (__bridge void *)anObject; 29 | NSArray *allRetainedReferences = FBGetBlockStrongReferences(blockObjectReference); 30 | 31 | for (id object in allRetainedReferences) { 32 | FBObjectiveCGraphElement *element = FBWrapObjectGraphElement(self, object, self.configuration); 33 | if (element) { 34 | [results addObject:element]; 35 | } 36 | } 37 | 38 | return [NSSet setWithArray:results]; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemoUITests/QSImageProcessDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessDemoUITests.m 3 | // QSImageProcessDemoUITests 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface QSImageProcessDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation QSImageProcessDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "NSData+ImageContentType.h" 11 | 12 | 13 | @implementation NSData (ImageContentType) 14 | 15 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { 16 | if (!data) { 17 | return SDImageFormatUndefined; 18 | } 19 | 20 | uint8_t c; 21 | [data getBytes:&c length:1]; 22 | switch (c) { 23 | case 0xFF: 24 | return SDImageFormatJPEG; 25 | case 0x89: 26 | return SDImageFormatPNG; 27 | case 0x47: 28 | return SDImageFormatGIF; 29 | case 0x49: 30 | case 0x4D: 31 | return SDImageFormatTIFF; 32 | case 0x52: 33 | // R as RIFF for WEBP 34 | if (data.length < 12) { 35 | return SDImageFormatUndefined; 36 | } 37 | 38 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 39 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 40 | return SDImageFormatWebP; 41 | } 42 | } 43 | return SDImageFormatUndefined; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBObjectReference.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | Defines an outgoing reference from Objective-C object. 14 | */ 15 | 16 | @protocol FBObjectReference 17 | 18 | /** 19 | What is the index of that reference in ivar layout? 20 | index * sizeof(void *) gives you offset from the 21 | beginning of the object. 22 | */ 23 | - (NSUInteger)indexInIvarLayout; 24 | 25 | /** 26 | For given object we need to be able to grab that object reference. 27 | */ 28 | - (nullable id)objectReferenceFromObject:(nullable id)object; 29 | 30 | 31 | /** 32 | For given reference in an object, there can be a path of names that leads to it. 33 | For example it can be an ivar, thus the path will consist of ivar name only: 34 | @[@"_myIvar"] 35 | 36 | But it also can be a reference in some nested struct like: 37 | struct SomeStruct { 38 | NSObject *myObject; 39 | }; 40 | 41 | If that struct will be used in class, then name path would look like this: 42 | @[@"_myIvar", @"SomeStruct", @"myObject"] 43 | */ 44 | - (nullable NSArray *)namePath; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/Struct.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "Type.h" 13 | 14 | #import 15 | #import 16 | #import 17 | 18 | namespace FB { namespace RetainCycleDetector { namespace Parser { 19 | class Struct: public Type { 20 | public: 21 | const std::string structTypeName; 22 | 23 | Struct(const std::string &name, 24 | const std::string &typeEncoding, 25 | const std::string &structTypeName, 26 | std::vector> &typesContainedInStruct) 27 | : Type(name, typeEncoding), 28 | structTypeName(structTypeName), 29 | typesContainedInStruct(std::move(typesContainedInStruct)) {}; 30 | Struct(Struct&&) = default; 31 | Struct &operator=(Struct&&) = default; 32 | 33 | Struct(const Struct&) = delete; 34 | Struct &operator=(const Struct&) = delete; 35 | 36 | std::vector> flattenTypes(); 37 | 38 | virtual void passTypePath(std::vector typePath); 39 | std::vector> typesContainedInStruct; 40 | }; 41 | } } } 42 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "NSData+ImageContentType.h" 11 | 12 | 13 | @implementation NSData (ImageContentType) 14 | 15 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { 16 | if (!data) { 17 | return SDImageFormatUndefined; 18 | } 19 | 20 | uint8_t c; 21 | [data getBytes:&c length:1]; 22 | switch (c) { 23 | case 0xFF: 24 | return SDImageFormatJPEG; 25 | case 0x89: 26 | return SDImageFormatPNG; 27 | case 0x47: 28 | return SDImageFormatGIF; 29 | case 0x49: 30 | case 0x4D: 31 | return SDImageFormatTIFF; 32 | case 0x52: 33 | // R as RIFF for WEBP 34 | if (data.length < 12) { 35 | return SDImageFormatUndefined; 36 | } 37 | 38 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 39 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 40 | return SDImageFormatWebP; 41 | } 42 | } 43 | return SDImageFormatUndefined; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Blocks/FBBlockInterface.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | /** 13 | We are mimicing Block structure based on Clang documentation: 14 | http://clang.llvm.org/docs/Block-ABI-Apple.html 15 | */ 16 | 17 | enum { // Flags from BlockLiteral 18 | BLOCK_HAS_COPY_DISPOSE = (1 << 25), 19 | BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code 20 | BLOCK_IS_GLOBAL = (1 << 28), 21 | BLOCK_HAS_STRET = (1 << 29), // IFF BLOCK_HAS_SIGNATURE 22 | BLOCK_HAS_SIGNATURE = (1 << 30), 23 | }; 24 | 25 | struct BlockDescriptor { 26 | unsigned long int reserved; // NULL 27 | unsigned long int size; 28 | // optional helper functions 29 | void (*copy_helper)(void *dst, void *src); // IFF (1<<25) 30 | void (*dispose_helper)(void *src); // IFF (1<<25) 31 | const char *signature; // IFF (1<<30) 32 | }; 33 | 34 | struct BlockLiteral { 35 | void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock 36 | int flags; 37 | int reserved; 38 | void (*invoke)(void *, ...); 39 | struct BlockDescriptor *descriptor; 40 | // imported variables 41 | }; 42 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QSImageProcess 2 | A high-performance and convenient tool for processing local image or web image 3 | 4 | 5 |

Installation

6 | 7 | pod 'QSImageProcess' 8 | 9 | or put all files in QSImageProcess directory into your project directly. 10 | 11 | Then 12 | 13 | #import "QSImageProcess.h" 14 | #import "UIImageView+QSImageProcess.h" 15 | 16 |

Usage-Demo1

17 | 18 | 19 | //load web image,default config,you don't need setup 20 | [self.imageView qs_setImageWithURL:url 21 | placeholderImage:placeholderImage]; 22 | 23 | //load web image,you should make a custom config 24 | QSImageProcessConfig *config = [QSImageProcessConfig configWithOutputSize:self.imageView.frame.size cornerRadius:cornerRadius corners:UIRectCornerAllCorners]; 25 | [self.imageView qs_setImageWithURL:url 26 | placeholderImage:placeholderImage 27 | config:configs]; 28 | 29 | 30 | 31 |

Usage-Demo2

32 | 33 | //a config of circle output image 34 | QSImageProcessConfig *config = [QSImageProcessConfig configWithOutputSize:self.imageView.frame.size cornerRadius:cornerRadius corners:UIRectCornerAllCorners]; 35 | 36 | //load local image asynchronously 37 | [[QSImageProcess sharedInstance]processImage:image config:config completed:^(UIImage *outputImage) { 38 | self.imageView1.image = outputImage; 39 | }]; 40 | 41 | //load local image synchronously 42 | self.imageView2.image = [[QSImageProcess sharedInstance]processImage:image config:config]; -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/FBRetainCycleUtils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBObjectGraphConfiguration; 13 | @class FBObjectiveCGraphElement; 14 | 15 | #ifdef __cplusplus 16 | extern "C" { 17 | #endif 18 | 19 | /** 20 | Wrapper functions, for given object they will categorize it and create proper Graph Element subclass instance 21 | for it. 22 | */ 23 | FBObjectiveCGraphElement *_Nullable FBWrapObjectGraphElementWithContext(FBObjectiveCGraphElement *_Nullable sourceElement, 24 | id _Nullable object, 25 | FBObjectGraphConfiguration *_Nullable configuration, 26 | NSArray *_Nullable namePath); 27 | FBObjectiveCGraphElement *_Nullable FBWrapObjectGraphElement(FBObjectiveCGraphElement *_Nullable sourceElement, 28 | id _Nullable object, 29 | FBObjectGraphConfiguration *_Nullable configuration); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/FBStructEncodingParser.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "Struct.h" 13 | #import "Type.h" 14 | 15 | namespace FB { namespace RetainCycleDetector { namespace Parser { 16 | 17 | /** 18 | This function will parse a struct encoding from an ivar, and return an FBParsedStruct instance. 19 | Check FBParsedStruct to learn more on how to interact with it. 20 | 21 | FBParseStructEncoding assumes the string passed to it will be a proper struct encoding. 22 | It will not work with encodings provided by @encode() because they do not add names. 23 | It will work with encodings provided by ivars (ivar_getTypeEncoding) 24 | */ 25 | Struct parseStructEncoding(const std::string &structEncodingString); 26 | 27 | 28 | /** 29 | You can provide name for root struct you are passing. The name will be then used 30 | in typePath (check out FBParsedType for details). 31 | The name here can be for example a name of an ivar with this struct. 32 | */ 33 | Struct parseStructEncodingWithName(const std::string &structEncodingString, 34 | const std::string &structName); 35 | 36 | 37 | } } } 38 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/QSDispatchQueue/README.md: -------------------------------------------------------------------------------- 1 | # QSDispatchQueue 2 | 3 | 4 | **A Way to control maxConcurrentCount of GCD concurrent queue by dispatch_semaphore**(利用GCD的信号量机制实现控制GCD并发队列最大并发数的方案) 5 | 6 |

Installation

7 | 8 | pod 'QSDispatchQueue' 9 | 10 | OR put QSDispatchQueue.h and QSDispatchQueue.m into your project directly. 11 | 12 | Then 13 | 14 | #import "QSDispatchQueue.h" 15 | 16 |

Usage-Demo1

17 | 18 | dispatch_queue_t workConcurrentQueue = dispatch_queue_create("com.jzp.async.queue", DISPATCH_QUEUE_CONCURRENT); 19 | QSDispatchQueue *queue = [[QSDispatchQueue alloc]initWithQueue:workConcurrentQueue concurrentCount:3]; 20 | for (NSInteger i = 0; i < 10; i++) { 21 | [queue async:^{ 22 | NSLog(@"thread-info:%@开始执行任务%d",[NSThread currentThread],(int)i); 23 | sleep(1); 24 | NSLog(@"thread-info:%@结束执行任务%d",[NSThread currentThread],(int)i); 25 | }]; 26 | } 27 | 28 |

Usage-Demo2

29 | 30 | dispatch_queue_t workConcurrentQueue = dispatch_queue_create("com.jzp.sync.queue", DISPATCH_QUEUE_CONCURRENT); 31 | QSDispatchQueue *queue = [[QSDispatchQueue alloc]initWithQueue:workConcurrentQueue concurrentCount:1]; 32 | for (NSInteger i = 0; i < 10; i++) { 33 | [queue sync:^{ 34 | NSLog(@"thread-info:%@开始执行任务%d",[NSThread currentThread],(int)i); 35 | sleep(1); 36 | NSLog(@"thread-info:%@结束执行任务%d",[NSThread currentThread],(int)i); 37 | }]; 38 | } 39 | 40 | 41 |

Relation

42 | 43 | http://www.jianshu.com/p/5d51a367ed62 44 | 45 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Filtering/FBStandardGraphEdgeFilters.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectGraphConfiguration.h" 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | /** 19 | Standard filters mostly filters excluding some UIKit references we have caught during testing on some apps. 20 | */ 21 | NSArray *_Nonnull FBGetStandardGraphEdgeFilters(); 22 | 23 | /** 24 | Helper functions for some typical patterns. 25 | */ 26 | FBGraphEdgeFilterBlock _Nonnull FBFilterBlockWithObjectIvarRelation(Class _Nonnull aCls, 27 | NSString *_Nonnull ivarName); 28 | FBGraphEdgeFilterBlock _Nonnull FBFilterBlockWithObjectToManyIvarsRelation(Class _Nonnull aCls, 29 | NSSet *_Nonnull ivarNames); 30 | FBGraphEdgeFilterBlock _Nonnull FBFilterBlockWithObjectIvarObjectRelation(Class _Nonnull fromClass, 31 | NSString *_Nonnull ivarName, 32 | Class _Nonnull toClass); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Detector/FBNodeEnumerator.mm: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBNodeEnumerator.h" 11 | 12 | #import "FBObjectiveCGraphElement.h" 13 | 14 | @implementation FBNodeEnumerator 15 | { 16 | NSSet *_retainedObjectsSnapshot; 17 | NSEnumerator *_enumerator; 18 | } 19 | 20 | - (instancetype)initWithObject:(FBObjectiveCGraphElement *)object 21 | { 22 | if (self = [super init]) { 23 | _object = object; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | - (FBNodeEnumerator *)nextObject 30 | { 31 | if (!_object) { 32 | return nil; 33 | } else if (!_retainedObjectsSnapshot) { 34 | _retainedObjectsSnapshot = [_object allRetainedObjects]; 35 | _enumerator = [_retainedObjectsSnapshot objectEnumerator]; 36 | } 37 | 38 | FBObjectiveCGraphElement *next = [_enumerator nextObject]; 39 | 40 | if (next) { 41 | return [[FBNodeEnumerator alloc] initWithObject:next]; 42 | } 43 | 44 | return nil; 45 | } 46 | 47 | - (BOOL)isEqual:(id)object 48 | { 49 | if ([object isKindOfClass:[FBNodeEnumerator class]]) { 50 | FBNodeEnumerator *enumerator = (FBNodeEnumerator *)object; 51 | return [self.object isEqual:enumerator.object]; 52 | } 53 | 54 | return NO; 55 | } 56 | 57 | - (NSUInteger)hash 58 | { 59 | return [self.object hash]; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /.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 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/LICENSE: -------------------------------------------------------------------------------- 1 | License 2 | 3 | For FBRetainCycleDetector software 4 | 5 | Copyright (c) 2016-present, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | $(PRODUCT_BUNDLE_IDENTIFIER) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleVersion 25 | 1 26 | LSRequiresIPhoneOS 27 | 28 | UILaunchStoryboardName 29 | LaunchScreen 30 | UIMainStoryboardFile 31 | Main 32 | UIRequiredDeviceCapabilities 33 | 34 | armv7 35 | 36 | UISupportedInterfaceOrientations 37 | 38 | UIInterfaceOrientationPortrait 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UISupportedInterfaceOrientations~ipad 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationPortraitUpsideDown 46 | UIInterfaceOrientationLandscapeLeft 47 | UIInterfaceOrientationLandscapeRight 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/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 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/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 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Reference/FBIvarReference.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBIvarReference.h" 11 | 12 | @implementation FBIvarReference 13 | 14 | - (instancetype)initWithIvar:(Ivar)ivar 15 | { 16 | if (self = [super init]) { 17 | _name = @(ivar_getName(ivar)); 18 | _type = [self _convertEncodingToType:ivar_getTypeEncoding(ivar)]; 19 | _offset = ivar_getOffset(ivar); 20 | _index = _offset / sizeof(void *); 21 | _ivar = ivar; 22 | } 23 | 24 | return self; 25 | } 26 | 27 | - (FBType)_convertEncodingToType:(const char *)typeEncoding 28 | { 29 | if (typeEncoding[0] == '{') { 30 | return FBStructType; 31 | } 32 | 33 | if (typeEncoding[0] == '@') { 34 | // It's an object or block 35 | 36 | // Let's try to determine if it's a block. Blocks tend to have 37 | // @? typeEncoding. Docs state that it's undefined type, so 38 | // we should still verify that ivar with that type is a block 39 | if (strncmp(typeEncoding, "@?", 2) == 0) { 40 | return FBBlockType; 41 | } 42 | 43 | return FBObjectType; 44 | } 45 | 46 | return FBUnknownType; 47 | } 48 | 49 | - (NSString *)description 50 | { 51 | return [NSString stringWithFormat:@"[%@, index: %lu]", _name, (unsigned long)_index]; 52 | } 53 | 54 | #pragma mark - FBObjectReference 55 | 56 | - (NSUInteger)indexInIvarLayout 57 | { 58 | return _index; 59 | } 60 | 61 | - (id)objectReferenceFromObject:(id)object 62 | { 63 | return object_getIvar(object, _ivar); 64 | } 65 | 66 | - (NSArray *)namePath 67 | { 68 | return @[@(ivar_getName(_ivar))]; 69 | } 70 | 71 | @end 72 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import 12 | #import "objc/runtime.h" 13 | #import "NSImage+WebCache.h" 14 | 15 | @implementation UIImage (GIF) 16 | 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 18 | if (!data) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return [[UIImage alloc] initWithData:data]; 24 | #endif 25 | 26 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 27 | 28 | size_t count = CGImageSourceGetCount(source); 29 | 30 | UIImage *staticImage; 31 | 32 | if (count <= 1) { 33 | staticImage = [[UIImage alloc] initWithData:data]; 34 | } else { 35 | // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category. 36 | // this here is only code to allow drawing animated images as static ones 37 | #if SD_WATCH 38 | CGFloat scale = 1; 39 | scale = [WKInterfaceDevice currentDevice].screenScale; 40 | #elif SD_UIKIT 41 | CGFloat scale = 1; 42 | scale = [UIScreen mainScreen].scale; 43 | #endif 44 | 45 | CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); 46 | #if SD_UIKIT || SD_WATCH 47 | UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp]; 48 | staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f]; 49 | #endif 50 | CGImageRelease(CGImage); 51 | } 52 | 53 | CFRelease(source); 54 | 55 | return staticImage; 56 | } 57 | 58 | - (BOOL)isGIF { 59 | return (self.images != nil); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/Parser/Struct.mm: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "Struct.h" 11 | 12 | #import 13 | 14 | namespace FB { namespace RetainCycleDetector { namespace Parser { 15 | void Struct::passTypePath(std::vector typePath) { 16 | this->typePath = typePath; 17 | 18 | if (name.length() > 0) { 19 | typePath.emplace_back(name); 20 | } 21 | if (structTypeName.length() > 0 && structTypeName != "?") { 22 | typePath.emplace_back(structTypeName); 23 | } 24 | 25 | for (auto &type: typesContainedInStruct) { 26 | type->passTypePath(typePath); 27 | } 28 | } 29 | 30 | std::vector> Struct::flattenTypes() { 31 | std::vector> flattenedTypes; 32 | 33 | for (const auto &type:typesContainedInStruct) { 34 | const auto maybeStruct = std::dynamic_pointer_cast(type); 35 | if (maybeStruct) { 36 | // Complex type, recursively grab all references 37 | flattenedTypes.reserve(flattenedTypes.size() + std::distance(maybeStruct->typesContainedInStruct.begin(), 38 | maybeStruct->typesContainedInStruct.end())); 39 | flattenedTypes.insert(flattenedTypes.end(), 40 | maybeStruct->typesContainedInStruct.begin(), 41 | maybeStruct->typesContainedInStruct.end()); 42 | } else { 43 | // Simple type 44 | flattenedTypes.emplace_back(type); 45 | } 46 | } 47 | 48 | return flattenedTypes; 49 | } 50 | 51 | } } } 52 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import 12 | #import "objc/runtime.h" 13 | #import "NSImage+WebCache.h" 14 | 15 | @implementation UIImage (GIF) 16 | 17 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 18 | if (!data) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return [[UIImage alloc] initWithData:data]; 24 | #endif 25 | 26 | CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL); 27 | 28 | size_t count = CGImageSourceGetCount(source); 29 | 30 | UIImage *staticImage; 31 | 32 | if (count <= 1) { 33 | staticImage = [[UIImage alloc] initWithData:data]; 34 | } else { 35 | // we will only retrieve the 1st frame. the full GIF support is available via the FLAnimatedImageView category. 36 | // this here is only code to allow drawing animated images as static ones 37 | #if SD_WATCH 38 | CGFloat scale = 1; 39 | scale = [WKInterfaceDevice currentDevice].screenScale; 40 | #elif SD_UIKIT 41 | CGFloat scale = 1; 42 | scale = [UIScreen mainScreen].scale; 43 | #endif 44 | 45 | CGImageRef CGImage = CGImageSourceCreateImageAtIndex(source, 0, NULL); 46 | #if SD_UIKIT || SD_WATCH 47 | UIImage *frameImage = [UIImage imageWithCGImage:CGImage scale:scale orientation:UIImageOrientationUp]; 48 | staticImage = [UIImage animatedImageWithImages:@[frameImage] duration:0.0f]; 49 | #endif 50 | CGImageRelease(CGImage); 51 | } 52 | 53 | CFRelease(source); 54 | 55 | return staticImage; 56 | } 57 | 58 | - (BOOL)isGIF { 59 | return (self.images != nil); 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /QSImageProcess/QSImageProcessConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessConfig.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIColor+QSImageProcess.h" 11 | 12 | typedef NS_ENUM(NSInteger,QSImageProcessOption) { 13 | QSImageProcessOptionDefault = 0, 14 | QSImageProcessOptionClipCorner = 1, 15 | QSImageProcessOptionCircle = 2, 16 | QSImageProcessOptionRound = 3, 17 | QSImageProcessOptionAddGradationMask = 4, 18 | QSImageProcessOptionAddWholeMask = 5 19 | }; 20 | 21 | @interface QSImageProcessConfig : NSObject 22 | 23 | /** 24 | 图片处理选项 25 | */ 26 | @property (nonatomic,assign)QSImageProcessOption option; 27 | 28 | /** 29 | 图片的输出大小 30 | */ 31 | @property (nonatomic, assign) CGSize outputSize; 32 | 33 | /** 34 | 裁剪图片需要的背景颜色 35 | */ 36 | @property (nonatomic, strong) UIColor *clipBgColor; 37 | 38 | /** 39 | 圆角半径,值为0不处理圆角 40 | */ 41 | @property (nonatomic, assign) CGFloat cornerRadius; 42 | 43 | /** 44 | 需要处理的圆角 45 | */ 46 | @property (nonatomic, assign) UIRectCorner corners; 47 | 48 | /** 49 | CG创建上下文,是否不透明 50 | */ 51 | @property (nonatomic, assign) BOOL opaque; 52 | 53 | /** 54 | 默认的图片(不透明)配置 55 | */ 56 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize; 57 | 58 | /** 59 | 默认的图片(不透明)配置,可配置背景色 60 | */ 61 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor; 62 | 63 | /** 64 | 不透明的圆形图片配置,需要设置clipBgColor 65 | */ 66 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor; 67 | 68 | /** 69 | 透明的圆形图片配置 70 | */ 71 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize; 72 | 73 | /** 74 | 圆角图片配置 75 | */ 76 | + (instancetype)configWithOutputSize:(CGSize)outputSize cornerRadius:(CGFloat)cornerRadius corners:(UIRectCorner)corners; 77 | 78 | 79 | /** 80 | init方法 81 | */ 82 | - (instancetype)initWithOutputSize:(CGSize)outputSize; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/QSImageProcessConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessConfig.h 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "UIColor+QSImageProcess.h" 11 | 12 | typedef NS_ENUM(NSInteger,QSImageProcessOption) { 13 | QSImageProcessOptionDefault = 0, 14 | QSImageProcessOptionClipCorner = 1, 15 | QSImageProcessOptionCircle = 2, 16 | QSImageProcessOptionRound = 3, 17 | QSImageProcessOptionAddGradationMask = 4, 18 | QSImageProcessOptionAddWholeMask = 5 19 | }; 20 | 21 | @interface QSImageProcessConfig : NSObject 22 | 23 | /** 24 | 图片处理选项 25 | */ 26 | @property (nonatomic,assign)QSImageProcessOption option; 27 | 28 | /** 29 | 图片的输出大小 30 | */ 31 | @property (nonatomic, assign) CGSize outputSize; 32 | 33 | /** 34 | 裁剪图片需要的背景颜色 35 | */ 36 | @property (nonatomic, strong) UIColor *clipBgColor; 37 | 38 | /** 39 | 圆角半径,值为0不处理圆角 40 | */ 41 | @property (nonatomic, assign) CGFloat cornerRadius; 42 | 43 | /** 44 | 需要处理的圆角 45 | */ 46 | @property (nonatomic, assign) UIRectCorner corners; 47 | 48 | /** 49 | CG创建上下文,是否不透明 50 | */ 51 | @property (nonatomic, assign) BOOL opaque; 52 | 53 | /** 54 | 默认的图片(不透明)配置 55 | */ 56 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize; 57 | 58 | /** 59 | 默认的图片(不透明)配置,可配置背景色 60 | */ 61 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor; 62 | 63 | /** 64 | 不透明的圆形图片配置,需要设置clipBgColor 65 | */ 66 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor; 67 | 68 | /** 69 | 透明的圆形图片配置 70 | */ 71 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize; 72 | 73 | /** 74 | 圆角图片配置 75 | */ 76 | + (instancetype)configWithOutputSize:(CGSize)outputSize cornerRadius:(CGFloat)cornerRadius corners:(UIRectCorner)corners; 77 | 78 | 79 | /** 80 | init方法 81 | */ 82 | - (instancetype)initWithOutputSize:(CGSize)outputSize; 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/Specialization/FBObjectiveCNSCFTimer.mm: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBObjectiveCNSCFTimer.h" 11 | 12 | #import 13 | 14 | #import "FBRetainCycleDetector.h" 15 | #import "FBRetainCycleUtils.h" 16 | 17 | @implementation FBObjectiveCNSCFTimer 18 | 19 | #if _INTERNAL_RCD_ENABLED 20 | 21 | typedef struct { 22 | long _unknown; // This is always 1 23 | id target; 24 | SEL selector; 25 | NSDictionary *userInfo; 26 | } _FBNSCFTimerInfoStruct; 27 | 28 | - (NSSet *)allRetainedObjects 29 | { 30 | // Let's retain our timer 31 | __attribute__((objc_precise_lifetime)) NSTimer *timer = self.object; 32 | 33 | if (!timer) { 34 | return nil; 35 | } 36 | 37 | NSMutableSet *retained = [[super allRetainedObjects] mutableCopy]; 38 | 39 | CFRunLoopTimerContext context; 40 | CFRunLoopTimerGetContext((CFRunLoopTimerRef)timer, &context); 41 | 42 | // If it has a retain function, let's assume it retains strongly 43 | if (context.info && context.retain) { 44 | _FBNSCFTimerInfoStruct infoStruct = *(_FBNSCFTimerInfoStruct *)(context.info); 45 | if (infoStruct.target) { 46 | FBObjectiveCGraphElement *element = FBWrapObjectGraphElementWithContext(self, infoStruct.target, self.configuration, @[@"target"]); 47 | if (element) { 48 | [retained addObject:element]; 49 | } 50 | } 51 | if (infoStruct.userInfo) { 52 | FBObjectiveCGraphElement *element = FBWrapObjectGraphElementWithContext(self, infoStruct.userInfo, self.configuration, @[@"userInfo"]); 53 | if (element) { 54 | [retained addObject:element]; 55 | } 56 | } 57 | } 58 | 59 | return retained; 60 | } 61 | 62 | #endif // _INTERNAL_RCD_ENABLED 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/MLeaksFinder/MLeaksFinder/UIViewController+MemoryLeak.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MemoryLeak.m 3 | // MLeaksFinder 4 | // 5 | // Created by zeposhe on 12/12/15. 6 | // Copyright © 2015 zeposhe. All rights reserved. 7 | // 8 | 9 | #import "UIViewController+MemoryLeak.h" 10 | #import "NSObject+MemoryLeak.h" 11 | #import 12 | 13 | #if _INTERNAL_MLF_ENABLED 14 | 15 | const void *const kHasBeenPoppedKey = &kHasBeenPoppedKey; 16 | 17 | @implementation UIViewController (MemoryLeak) 18 | 19 | + (void)load { 20 | static dispatch_once_t onceToken; 21 | dispatch_once(&onceToken, ^{ 22 | [self swizzleSEL:@selector(viewDidDisappear:) withSEL:@selector(swizzled_viewDidDisappear:)]; 23 | [self swizzleSEL:@selector(viewWillAppear:) withSEL:@selector(swizzled_viewWillAppear:)]; 24 | [self swizzleSEL:@selector(dismissViewControllerAnimated:completion:) withSEL:@selector(swizzled_dismissViewControllerAnimated:completion:)]; 25 | }); 26 | } 27 | 28 | - (void)swizzled_viewDidDisappear:(BOOL)animated { 29 | [self swizzled_viewDidDisappear:animated]; 30 | 31 | if ([objc_getAssociatedObject(self, kHasBeenPoppedKey) boolValue]) { 32 | [self willDealloc]; 33 | } 34 | } 35 | 36 | - (void)swizzled_viewWillAppear:(BOOL)animated { 37 | [self swizzled_viewWillAppear:animated]; 38 | 39 | objc_setAssociatedObject(self, kHasBeenPoppedKey, @(NO), OBJC_ASSOCIATION_RETAIN); 40 | } 41 | 42 | - (void)swizzled_dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion { 43 | [self swizzled_dismissViewControllerAnimated:flag completion:completion]; 44 | 45 | UIViewController *dismissedViewController = self.presentedViewController; 46 | if (!dismissedViewController && self.presentingViewController) { 47 | dismissedViewController = self; 48 | } 49 | 50 | if (!dismissedViewController) return; 51 | 52 | [dismissedViewController willDealloc]; 53 | } 54 | 55 | - (BOOL)willDealloc { 56 | if (![super willDealloc]) { 57 | return NO; 58 | } 59 | 60 | [self willReleaseChildren:self.childViewControllers]; 61 | [self willReleaseChild:self.presentedViewController]; 62 | 63 | if (self.isViewLoaded) { 64 | [self willReleaseChild:self.view]; 65 | } 66 | 67 | return YES; 68 | } 69 | 70 | @end 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | 15 | static char loadOperationKey; 16 | 17 | typedef NSMutableDictionary SDOperationsDictionary; 18 | 19 | @implementation UIView (WebCacheOperation) 20 | 21 | - (SDOperationsDictionary *)operationDictionary { 22 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 23 | if (operations) { 24 | return operations; 25 | } 26 | operations = [NSMutableDictionary dictionary]; 27 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return operations; 29 | } 30 | 31 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 32 | if (key) { 33 | [self sd_cancelImageLoadOperationWithKey:key]; 34 | if (operation) { 35 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 36 | operationDictionary[key] = operation; 37 | } 38 | } 39 | } 40 | 41 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 42 | // Cancel in progress downloader from queue 43 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 44 | id operations = operationDictionary[key]; 45 | if (operations) { 46 | if ([operations isKindOfClass:[NSArray class]]) { 47 | for (id operation in operations) { 48 | if (operation) { 49 | [operation cancel]; 50 | } 51 | } 52 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 53 | [(id) operations cancel]; 54 | } 55 | [operationDictionary removeObjectForKey:key]; 56 | } 57 | } 58 | 59 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 60 | if (key) { 61 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 62 | [operationDictionary removeObjectForKey:key]; 63 | } 64 | } 65 | 66 | @end 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | 15 | static char loadOperationKey; 16 | 17 | typedef NSMutableDictionary SDOperationsDictionary; 18 | 19 | @implementation UIView (WebCacheOperation) 20 | 21 | - (SDOperationsDictionary *)operationDictionary { 22 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 23 | if (operations) { 24 | return operations; 25 | } 26 | operations = [NSMutableDictionary dictionary]; 27 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 28 | return operations; 29 | } 30 | 31 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 32 | if (key) { 33 | [self sd_cancelImageLoadOperationWithKey:key]; 34 | if (operation) { 35 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 36 | operationDictionary[key] = operation; 37 | } 38 | } 39 | } 40 | 41 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 42 | // Cancel in progress downloader from queue 43 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 44 | id operations = operationDictionary[key]; 45 | if (operations) { 46 | if ([operations isKindOfClass:[NSArray class]]) { 47 | for (id operation in operations) { 48 | if (operation) { 49 | [operation cancel]; 50 | } 51 | } 52 | } else if ([operations conformsToProtocol:@protocol(SDWebImageOperation)]){ 53 | [(id) operations cancel]; 54 | } 55 | [operationDictionary removeObjectForKey:key]; 56 | } 57 | } 58 | 59 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 60 | if (key) { 61 | SDOperationsDictionary *operationDictionary = [self operationDictionary]; 62 | [operationDictionary removeObjectForKey:key]; 63 | } 64 | } 65 | 66 | @end 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectiveCGraphElement.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | @class FBObjectGraphConfiguration; 13 | 14 | /** 15 | Base Graph Element representation. It carries some data about the object and should be overridden in subclass 16 | to provide references that subclass holds strongly (different for blocks, objects, other specializations). 17 | The Graph Element itself can only provide references from FBAssociationManager. 18 | */ 19 | @interface FBObjectiveCGraphElement : NSObject 20 | 21 | /** 22 | Designated initializer. 23 | @param object Object this Graph Element will represent. 24 | @param configuration Provides detector's configuration that contains filters and options 25 | @param filterProvider Filter Provider that Graph Element will use to determine which references need to be dropped 26 | @param namePath Description of how the object was retrieved from it's parent. Check namePath property. 27 | */ 28 | - (nonnull instancetype)initWithObject:(nullable id)object 29 | configuration:(nonnull FBObjectGraphConfiguration *)configuration 30 | namePath:(nullable NSArray *)namePath; 31 | 32 | - (nonnull instancetype)initWithObject:(nullable id)object 33 | configuration:(nonnull FBObjectGraphConfiguration *)configuration; 34 | 35 | 36 | /** 37 | Name path that describes how this object was retrieved from its parent object by names 38 | (for example ivar names, struct references). For more check FBObjectReference protocol. 39 | */ 40 | @property (nonatomic, copy, readonly, nullable) NSArray *namePath; 41 | @property (nonatomic, weak, nullable) id object; 42 | @property (nonatomic, readonly, nonnull) FBObjectGraphConfiguration *configuration; 43 | 44 | /** 45 | Main accessor to all objects that the given object is retaining. Thread unsafe. 46 | 47 | @return NSSet of all objects this object is retaining. 48 | */ 49 | - (nullable NSSet *)allRetainedObjects; 50 | 51 | /** 52 | @return address of the object represented by this element 53 | */ 54 | - (size_t)objectAddress; 55 | 56 | - (nullable Class)objectClass; 57 | - (nonnull NSString *)classNameOrNull; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #import "objc/runtime.h" 12 | 13 | #if !__has_feature(objc_arc) 14 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 15 | #endif 16 | 17 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 18 | if (!image) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return image; 24 | #elif SD_UIKIT || SD_WATCH 25 | if ((image.images).count > 0) { 26 | NSMutableArray *scaledImages = [NSMutableArray array]; 27 | 28 | for (UIImage *tempImage in image.images) { 29 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 30 | } 31 | 32 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 33 | #ifdef SD_WEBP 34 | if (animatedImage) { 35 | SEL sd_webpLoopCount = NSSelectorFromString(@"sd_webpLoopCount"); 36 | NSNumber *value = objc_getAssociatedObject(image, sd_webpLoopCount); 37 | NSInteger loopCount = value.integerValue; 38 | if (loopCount) { 39 | objc_setAssociatedObject(animatedImage, sd_webpLoopCount, @(loopCount), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | } 41 | } 42 | #endif 43 | return animatedImage; 44 | } else { 45 | #if SD_WATCH 46 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 47 | #elif SD_UIKIT 48 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 49 | #endif 50 | CGFloat scale = 1; 51 | if (key.length >= 8) { 52 | NSRange range = [key rangeOfString:@"@2x."]; 53 | if (range.location != NSNotFound) { 54 | scale = 2.0; 55 | } 56 | 57 | range = [key rangeOfString:@"@3x."]; 58 | if (range.location != NSNotFound) { 59 | scale = 3.0; 60 | } 61 | } 62 | 63 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 64 | image = scaledImage; 65 | } 66 | return image; 67 | } 68 | #endif 69 | } 70 | 71 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 72 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #import "objc/runtime.h" 12 | 13 | #if !__has_feature(objc_arc) 14 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 15 | #endif 16 | 17 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 18 | if (!image) { 19 | return nil; 20 | } 21 | 22 | #if SD_MAC 23 | return image; 24 | #elif SD_UIKIT || SD_WATCH 25 | if ((image.images).count > 0) { 26 | NSMutableArray *scaledImages = [NSMutableArray array]; 27 | 28 | for (UIImage *tempImage in image.images) { 29 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 30 | } 31 | 32 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 33 | #ifdef SD_WEBP 34 | if (animatedImage) { 35 | SEL sd_webpLoopCount = NSSelectorFromString(@"sd_webpLoopCount"); 36 | NSNumber *value = objc_getAssociatedObject(image, sd_webpLoopCount); 37 | NSInteger loopCount = value.integerValue; 38 | if (loopCount) { 39 | objc_setAssociatedObject(animatedImage, sd_webpLoopCount, @(loopCount), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 40 | } 41 | } 42 | #endif 43 | return animatedImage; 44 | } else { 45 | #if SD_WATCH 46 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 47 | #elif SD_UIKIT 48 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 49 | #endif 50 | CGFloat scale = 1; 51 | if (key.length >= 8) { 52 | NSRange range = [key rangeOfString:@"@2x."]; 53 | if (range.location != NSNotFound) { 54 | scale = 2.0; 55 | } 56 | 57 | range = [key rangeOfString:@"@3x."]; 58 | if (range.location != NSNotFound) { 59 | scale = 3.0; 60 | } 61 | } 62 | 63 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 64 | image = scaledImage; 65 | } 66 | return image; 67 | } 68 | #endif 69 | } 70 | 71 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 72 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // QSImageProcessDemo 4 | // 5 | // Created by shaoqing on 2017/8/12. 6 | // Copyright © 2017年 Jiang. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "QSMainViewController.h" 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 22 | self.window.backgroundColor = [UIColor whiteColor]; 23 | QSMainViewController *vc = [[QSMainViewController alloc]init]; 24 | UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc]; 25 | self.window.rootViewController = nav; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application { 32 | // 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. 33 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 34 | } 35 | 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application { 38 | // 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. 39 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 40 | } 41 | 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application { 44 | // 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. 45 | } 46 | 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application { 49 | // 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. 50 | } 51 | 52 | 53 | - (void)applicationWillTerminate:(UIApplication *)application { 54 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Graph/FBObjectGraphConfiguration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import 11 | 12 | #import "FBObjectiveCGraphElement.h" 13 | 14 | typedef NS_ENUM(NSUInteger, FBGraphEdgeType) { 15 | FBGraphEdgeValid, 16 | FBGraphEdgeInvalid, 17 | }; 18 | 19 | @protocol FBObjectReference; 20 | 21 | /** 22 | Every filter has to be of type FBGraphEdgeFilterBlock. Filter, given two object graph elements, it should decide, 23 | whether a reference between them should be filtered out or not. 24 | @see FBGetStandardGraphEdgeFilters() 25 | */ 26 | typedef FBGraphEdgeType (^FBGraphEdgeFilterBlock)(FBObjectiveCGraphElement *_Nullable fromObject, 27 | NSString *_Nullable byIvar, 28 | Class _Nullable toObjectOfClass); 29 | 30 | /** 31 | FBObjectGraphConfiguration represents a configuration for object graph walking. 32 | It can hold filters and detector specific options. 33 | */ 34 | @interface FBObjectGraphConfiguration : NSObject 35 | 36 | /** 37 | Every block represents a filter that every reference must pass in order to be inspected. 38 | Reference will be described as relation from one object to another object. See definition of 39 | FBGraphEdgeFilterBlock above. 40 | 41 | Invalid relations would be the relations that we are guaranteed are going to be broken at some point. 42 | Be careful though, it's not so straightforward to tell if the relation will be broken *with 100% 43 | certainty*, and if you'll filter out something that could otherwise show retain cycle that leaks - 44 | it would never be caught by detector. 45 | 46 | For examples of what are the relations that will be broken at some point check FBStandardGraphEdgeFilters.mm 47 | */ 48 | @property (nonatomic, readonly, copy, nullable) NSArray *filterBlocks; 49 | 50 | /** 51 | Decides if object graph walker should look for retain cycles inside NSTimers. 52 | */ 53 | @property (nonatomic, readonly) BOOL shouldInspectTimers; 54 | 55 | /** 56 | Will cache layout 57 | */ 58 | @property (nonatomic, readonly, nullable) NSMutableDictionary> *> *layoutCache; 59 | @property (nonatomic, readonly) BOOL shouldCacheLayouts; 60 | 61 | - (nonnull instancetype)initWithFilterBlocks:(nonnull NSArray *)filterBlocks 62 | shouldInspectTimers:(BOOL)shouldInspectTimers NS_DESIGNATED_INITIALIZER; 63 | 64 | @end 65 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImageExtension/UIImageView+QSImageProcess.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+QSImageProcess.m 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+QSImageProcess.h" 10 | #import "SDWebImageManager.h" 11 | #import "QSImageProcess.h" 12 | 13 | @implementation UIImageView (QSImageProcess) 14 | 15 | - (void)qs_setImageWithURL:(nullable NSURL *)url 16 | placeholderImage:(nullable UIImage *)placeholder{ 17 | 18 | QSImageProcessConfig *config = [QSImageProcessConfig defaultConfigWithOutputSize:self.bounds.size]; 19 | [self qs_setImageWithURL:url placeholderImage:placeholder config:config]; 20 | } 21 | 22 | - (void)qs_setImageWithURL:(nullable NSURL *)url 23 | placeholderImage:(nullable UIImage *)placeholder 24 | config:(QSImageProcessConfig *)config{ 25 | 26 | if (placeholder && self.image != placeholder) { 27 | self.image = placeholder; 28 | } 29 | 30 | NSString *urlString = [url absoluteString]; 31 | if (!urlString || [urlString length] <= 0) { 32 | return; 33 | } 34 | 35 | NSString *configDesc = [config description]; 36 | NSString *cacheUrlString = [NSString stringWithFormat:@"%@_%@",urlString,configDesc]; 37 | NSLog(@"cacheUrlString = %@",cacheUrlString); 38 | SDWebImageManager *sdImageManager = [SDWebImageManager sharedManager]; 39 | 40 | NSString *cacheKey = [sdImageManager cacheKeyForURL:[[NSURL alloc] initWithString:cacheUrlString]]; 41 | [sdImageManager.imageCache queryCacheOperationForKey:cacheKey done:^(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType) { 42 | 43 | if (image) { 44 | self.image = image; 45 | NSLog(@"find it...."); 46 | }else{ 47 | NSLog(@"start download...."); 48 | [sdImageManager.imageDownloader downloadImageWithURL:url options:SDWebImageRetryFailed | SDWebImageHighPriority | SDWebImageAvoidAutoSetImage progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { 49 | 50 | if (image) { 51 | [[QSImageProcess sharedInstance]processImage:image config:config completed:^(UIImage *outputImage) { 52 | 53 | if (outputImage) { 54 | self.image = outputImage; 55 | [sdImageManager.imageCache storeImage:outputImage forKey:cacheKey completion:nil]; 56 | } 57 | }]; 58 | }else{ 59 | NSLog(@"download error..."); 60 | } 61 | NSLog(@"end download...."); 62 | }]; 63 | } 64 | }]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/SDWebImageExtension/UIImageView+QSImageProcess.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+QSImageProcess.m 3 | // QSUseImageDemo 4 | // 5 | // Created by zhongpingjiang on 2017/8/11. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "UIImageView+QSImageProcess.h" 10 | #import "SDWebImageManager.h" 11 | #import "QSImageProcess.h" 12 | 13 | @implementation UIImageView (QSImageProcess) 14 | 15 | - (void)qs_setImageWithURL:(nullable NSURL *)url 16 | placeholderImage:(nullable UIImage *)placeholder{ 17 | 18 | QSImageProcessConfig *config = [QSImageProcessConfig defaultConfigWithOutputSize:self.bounds.size]; 19 | [self qs_setImageWithURL:url placeholderImage:placeholder config:config]; 20 | } 21 | 22 | - (void)qs_setImageWithURL:(nullable NSURL *)url 23 | placeholderImage:(nullable UIImage *)placeholder 24 | config:(QSImageProcessConfig *)config{ 25 | 26 | if (placeholder && self.image != placeholder) { 27 | self.image = placeholder; 28 | } 29 | 30 | NSString *urlString = [url absoluteString]; 31 | if (!urlString || [urlString length] <= 0) { 32 | return; 33 | } 34 | 35 | NSString *configDesc = [config description]; 36 | NSString *cacheUrlString = [NSString stringWithFormat:@"%@_%@",urlString,configDesc]; 37 | NSLog(@"cacheUrlString = %@",cacheUrlString); 38 | SDWebImageManager *sdImageManager = [SDWebImageManager sharedManager]; 39 | 40 | NSString *cacheKey = [sdImageManager cacheKeyForURL:[[NSURL alloc] initWithString:cacheUrlString]]; 41 | [sdImageManager.imageCache queryCacheOperationForKey:cacheKey done:^(UIImage * _Nullable image, NSData * _Nullable data, SDImageCacheType cacheType) { 42 | 43 | if (image) { 44 | self.image = image; 45 | NSLog(@"find it...."); 46 | }else{ 47 | NSLog(@"start download...."); 48 | [sdImageManager.imageDownloader downloadImageWithURL:url options:SDWebImageRetryFailed | SDWebImageHighPriority | SDWebImageAvoidAutoSetImage progress:nil completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { 49 | 50 | if (image) { 51 | [[QSImageProcess sharedInstance]processImage:image config:config completed:^(UIImage *outputImage) { 52 | 53 | if (outputImage) { 54 | self.image = outputImage; 55 | [sdImageManager.imageCache storeImage:outputImage forKey:cacheKey completion:nil]; 56 | } 57 | }]; 58 | }else{ 59 | NSLog(@"download error..."); 60 | } 61 | NSLog(@"end download...."); 62 | }]; 63 | } 64 | }]; 65 | } 66 | 67 | @end 68 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/FBRetainCycleUtils.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBRetainCycleUtils.h" 11 | 12 | #import 13 | 14 | #import "FBBlockStrongLayout.h" 15 | #import "FBClassStrongLayout.h" 16 | #import "FBObjectiveCBlock.h" 17 | #import "FBObjectiveCGraphElement.h" 18 | #import "FBObjectiveCNSCFTimer.h" 19 | #import "FBObjectiveCObject.h" 20 | #import "FBObjectGraphConfiguration.h" 21 | 22 | static BOOL _ShouldBreakGraphEdge(FBObjectGraphConfiguration *configuration, 23 | FBObjectiveCGraphElement *fromObject, 24 | NSString *byIvar, 25 | Class toObjectOfClass) { 26 | for (FBGraphEdgeFilterBlock filterBlock in configuration.filterBlocks) { 27 | if (filterBlock(fromObject, byIvar, toObjectOfClass) == FBGraphEdgeInvalid) { 28 | return YES; 29 | } 30 | } 31 | 32 | return NO; 33 | } 34 | 35 | FBObjectiveCGraphElement *FBWrapObjectGraphElementWithContext(FBObjectiveCGraphElement *sourceElement, 36 | id object, 37 | FBObjectGraphConfiguration *configuration, 38 | NSArray *namePath) { 39 | if (_ShouldBreakGraphEdge(configuration, sourceElement, [namePath firstObject], object_getClass(object))) { 40 | return nil; 41 | } 42 | 43 | if (FBObjectIsBlock((__bridge void *)object)) { 44 | return [[FBObjectiveCBlock alloc] initWithObject:object 45 | configuration:configuration 46 | namePath:namePath]; 47 | } else { 48 | if ([object_getClass(object) isSubclassOfClass:[NSTimer class]] && 49 | configuration.shouldInspectTimers) { 50 | return [[FBObjectiveCNSCFTimer alloc] initWithObject:object 51 | configuration:configuration 52 | namePath:namePath]; 53 | } else { 54 | return [[FBObjectiveCObject alloc] initWithObject:object 55 | configuration:configuration 56 | namePath:namePath]; 57 | } 58 | } 59 | } 60 | 61 | FBObjectiveCGraphElement *FBWrapObjectGraphElement(FBObjectiveCGraphElement *sourceElement, 62 | id object, 63 | FBObjectGraphConfiguration *configuration) { 64 | return FBWrapObjectGraphElementWithContext(sourceElement, object, configuration, nil); 65 | } 66 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/fishhook/fishhook.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2013, Facebook, Inc. 2 | // All rights reserved. 3 | // Redistribution and use in source and binary forms, with or without 4 | // modification, are permitted provided that the following conditions are met: 5 | // * Redistributions of source code must retain the above copyright notice, 6 | // this list of conditions and the following disclaimer. 7 | // * Redistributions in binary form must reproduce the above copyright notice, 8 | // this list of conditions and the following disclaimer in the documentation 9 | // and/or other materials provided with the distribution. 10 | // * Neither the name Facebook nor the names of its contributors may be used to 11 | // endorse or promote products derived from this software without specific 12 | // prior written permission. 13 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 17 | // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 18 | // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 19 | // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 20 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 21 | // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | #ifndef fishhook_h 25 | #define fishhook_h 26 | 27 | #include 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif //__cplusplus 33 | 34 | /* 35 | * A structure representing a particular intended rebinding from a symbol 36 | * name to its replacement 37 | */ 38 | struct rcd_rebinding { 39 | const char *name; 40 | void *replacement; 41 | void **replaced; 42 | }; 43 | 44 | /* 45 | * For each rebinding in rebindings, rebinds references to external, indirect 46 | * symbols with the specified name to instead point at replacement for each 47 | * image in the calling process as well as for all future images that are loaded 48 | * by the process. If rebind_functions is called more than once, the symbols to 49 | * rebind are added to the existing list of rebindings, and if a given symbol 50 | * is rebound more than once, the later rebinding will take precedence. 51 | */ 52 | int rcd_rebind_symbols(struct rcd_rebinding rebindings[], size_t rebindings_nel); 53 | 54 | /* 55 | * Rebinds as above, but only in the specified image. The header should point 56 | * to the mach-o header, the slide should be the slide offset. Others as above. 57 | */ 58 | int rcd_rebind_symbols_image(void *header, 59 | intptr_t slide, 60 | struct rcd_rebinding rebindings[], 61 | size_t rebindings_nel); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif //__cplusplus 66 | 67 | #endif //fishhook_h 68 | 69 | -------------------------------------------------------------------------------- /QSImageProcess/QSImageProcessConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessConfig.m 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "QSImageProcessConfig.h" 10 | 11 | @implementation QSImageProcessConfig 12 | 13 | /** 14 | 默认的图片(不透明)配置 15 | */ 16 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize{ 17 | 18 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 19 | config.option = QSImageProcessOptionDefault; 20 | config.clipBgColor = [UIColor whiteColor]; 21 | return config; 22 | } 23 | 24 | 25 | /** 26 | 默认的图片(不透明)配置,可配置背景色 27 | */ 28 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor{ 29 | 30 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 31 | config.option = QSImageProcessOptionDefault; 32 | config.clipBgColor = [UIColor whiteColor]; 33 | return config; 34 | } 35 | 36 | /** 37 | 默认圆形(不透明)图片配置 38 | */ 39 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor{ 40 | 41 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 42 | config.clipBgColor = clipBgColor; 43 | config.option = QSImageProcessOptionCircle; 44 | config.cornerRadius = (MIN(config.outputSize.width, config.outputSize.height)) /2.0f; 45 | config.corners = UIRectCornerAllCorners; 46 | return config; 47 | } 48 | 49 | /** 50 | 透明的圆形图片配置 51 | */ 52 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize { 53 | 54 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 55 | config.opaque = NO; 56 | config.option = QSImageProcessOptionCircle; 57 | config.cornerRadius = (MIN(config.outputSize.width, config.outputSize.height)) /2.0f; 58 | config.corners = UIRectCornerAllCorners; 59 | return config; 60 | } 61 | 62 | 63 | /** 64 | 圆角图片(不透明)配置 65 | */ 66 | + (instancetype)configWithOutputSize:(CGSize)outputSize cornerRadius:(CGFloat)cornerRadius corners:(UIRectCorner)corners{ 67 | 68 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 69 | config.cornerRadius = cornerRadius; 70 | config.corners = corners; 71 | config.option = QSImageProcessOptionClipCorner; 72 | config.clipBgColor = [UIColor whiteColor]; 73 | return config; 74 | } 75 | 76 | - (instancetype)initWithOutputSize:(CGSize)outputSize{ 77 | 78 | self = [super init]; 79 | if (self) { 80 | _option = QSImageProcessOptionDefault; 81 | _outputSize = outputSize; 82 | _clipBgColor = [UIColor whiteColor]; 83 | _cornerRadius = 0.0f; 84 | _corners = 0; 85 | _opaque = YES; //不透明 86 | } 87 | return self; 88 | } 89 | 90 | - (NSString *)description{ 91 | 92 | return [NSString stringWithFormat:@"option=%d&width=%.0lf_height=%.0lf_corners=%lu_cornerradius=%.1lf_opaque=%d_color=%@",(int)self.option,self.outputSize.width,self.outputSize.height,(unsigned long)self.corners,round(self.cornerRadius),self.opaque,[self.clipBgColor colorValue]]; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /QSImageProcess/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); 16 | 17 | @interface UIView (WebCache) 18 | 19 | /** 20 | * Get the current image URL. 21 | * 22 | * Note that because of the limitations of categories this property can get out of sync 23 | * if you use setImage: directly. 24 | */ 25 | - (nullable NSURL *)sd_imageURL; 26 | 27 | /** 28 | * Set the imageView `image` with an `url` and optionally a placeholder image. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param placeholder The image to be set initially, until the image request finishes. 34 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 35 | * @param operationKey A string to be used as the operation key. If nil, will use the class name 36 | * @param setImageBlock Block used for custom set image code 37 | * @param progressBlock A block called while image is downloading 38 | * @note the progress block is executed on a background queue 39 | * @param completedBlock A block called when operation has been completed. This block has no return value 40 | * and takes the requested UIImage as first parameter. In case of error the image parameter 41 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 42 | * indicating if the image was retrieved from the local cache or from the network. 43 | * The fourth parameter is the original image url. 44 | */ 45 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 46 | placeholderImage:(nullable UIImage *)placeholder 47 | options:(SDWebImageOptions)options 48 | operationKey:(nullable NSString *)operationKey 49 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 50 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 51 | completed:(nullable SDExternalCompletionBlock)completedBlock; 52 | 53 | /** 54 | * Cancel the current download 55 | */ 56 | - (void)sd_cancelCurrentImageLoad; 57 | 58 | #if SD_UIKIT 59 | 60 | #pragma mark - Activity indicator 61 | 62 | /** 63 | * Show activity UIActivityIndicatorView 64 | */ 65 | - (void)sd_setShowActivityIndicatorView:(BOOL)show; 66 | 67 | /** 68 | * set desired UIActivityIndicatorViewStyle 69 | * 70 | * @param style The style of the UIActivityIndicatorView 71 | */ 72 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; 73 | 74 | - (BOOL)sd_showActivityIndicatorView; 75 | - (void)sd_addActivityIndicator; 76 | - (void)sd_removeActivityIndicator; 77 | 78 | #endif 79 | 80 | @end 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/SDWebImage/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | typedef void(^SDSetImageBlock)(UIImage * _Nullable image, NSData * _Nullable imageData); 16 | 17 | @interface UIView (WebCache) 18 | 19 | /** 20 | * Get the current image URL. 21 | * 22 | * Note that because of the limitations of categories this property can get out of sync 23 | * if you use setImage: directly. 24 | */ 25 | - (nullable NSURL *)sd_imageURL; 26 | 27 | /** 28 | * Set the imageView `image` with an `url` and optionally a placeholder image. 29 | * 30 | * The download is asynchronous and cached. 31 | * 32 | * @param url The url for the image. 33 | * @param placeholder The image to be set initially, until the image request finishes. 34 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 35 | * @param operationKey A string to be used as the operation key. If nil, will use the class name 36 | * @param setImageBlock Block used for custom set image code 37 | * @param progressBlock A block called while image is downloading 38 | * @note the progress block is executed on a background queue 39 | * @param completedBlock A block called when operation has been completed. This block has no return value 40 | * and takes the requested UIImage as first parameter. In case of error the image parameter 41 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 42 | * indicating if the image was retrieved from the local cache or from the network. 43 | * The fourth parameter is the original image url. 44 | */ 45 | - (void)sd_internalSetImageWithURL:(nullable NSURL *)url 46 | placeholderImage:(nullable UIImage *)placeholder 47 | options:(SDWebImageOptions)options 48 | operationKey:(nullable NSString *)operationKey 49 | setImageBlock:(nullable SDSetImageBlock)setImageBlock 50 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 51 | completed:(nullable SDExternalCompletionBlock)completedBlock; 52 | 53 | /** 54 | * Cancel the current download 55 | */ 56 | - (void)sd_cancelCurrentImageLoad; 57 | 58 | #if SD_UIKIT 59 | 60 | #pragma mark - Activity indicator 61 | 62 | /** 63 | * Show activity UIActivityIndicatorView 64 | */ 65 | - (void)sd_setShowActivityIndicatorView:(BOOL)show; 66 | 67 | /** 68 | * set desired UIActivityIndicatorViewStyle 69 | * 70 | * @param style The style of the UIActivityIndicatorView 71 | */ 72 | - (void)sd_setIndicatorStyle:(UIActivityIndicatorViewStyle)style; 73 | 74 | - (BOOL)sd_showActivityIndicatorView; 75 | - (void)sd_addActivityIndicator; 76 | - (void)sd_removeActivityIndicator; 77 | 78 | #endif 79 | 80 | @end 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /QSImageProcessDemo/QSImageProcessDemo/QSImageProcess/QSImageProcessConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // QSImageProcessConfig.m 3 | // QSUseImageDemo 4 | // 5 | // Created by shaoqing on 2017/8/10. 6 | // Copyright © 2017年 shaoqing. All rights reserved. 7 | // 8 | 9 | #import "QSImageProcessConfig.h" 10 | 11 | @implementation QSImageProcessConfig 12 | 13 | /** 14 | 默认的图片(不透明)配置 15 | */ 16 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize{ 17 | 18 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 19 | config.option = QSImageProcessOptionDefault; 20 | config.clipBgColor = [UIColor whiteColor]; 21 | return config; 22 | } 23 | 24 | 25 | /** 26 | 默认的图片(不透明)配置,可配置背景色 27 | */ 28 | + (instancetype)defaultConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor{ 29 | 30 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 31 | config.option = QSImageProcessOptionDefault; 32 | config.clipBgColor = [UIColor whiteColor]; 33 | return config; 34 | } 35 | 36 | /** 37 | 默认圆形(不透明)图片配置 38 | */ 39 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize clipBgColor:(UIColor *)clipBgColor{ 40 | 41 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 42 | config.clipBgColor = clipBgColor; 43 | config.option = QSImageProcessOptionCircle; 44 | config.cornerRadius = (MIN(config.outputSize.width, config.outputSize.height)) /2.0f; 45 | config.corners = UIRectCornerAllCorners; 46 | return config; 47 | } 48 | 49 | /** 50 | 透明的圆形图片配置 51 | */ 52 | + (instancetype)circleConfigWithOutputSize:(CGSize)outputSize { 53 | 54 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 55 | config.opaque = NO; 56 | config.option = QSImageProcessOptionCircle; 57 | config.cornerRadius = (MIN(config.outputSize.width, config.outputSize.height)) /2.0f; 58 | config.corners = UIRectCornerAllCorners; 59 | return config; 60 | } 61 | 62 | 63 | /** 64 | 圆角图片(不透明)配置 65 | */ 66 | + (instancetype)configWithOutputSize:(CGSize)outputSize cornerRadius:(CGFloat)cornerRadius corners:(UIRectCorner)corners{ 67 | 68 | QSImageProcessConfig *config = [[QSImageProcessConfig alloc]initWithOutputSize:outputSize]; 69 | config.cornerRadius = cornerRadius; 70 | config.corners = corners; 71 | config.option = QSImageProcessOptionClipCorner; 72 | config.clipBgColor = [UIColor whiteColor]; 73 | return config; 74 | } 75 | 76 | - (instancetype)initWithOutputSize:(CGSize)outputSize{ 77 | 78 | self = [super init]; 79 | if (self) { 80 | _option = QSImageProcessOptionDefault; 81 | _outputSize = outputSize; 82 | _clipBgColor = [UIColor whiteColor]; 83 | _cornerRadius = 0.0f; 84 | _corners = 0; 85 | _opaque = YES; //不透明 86 | } 87 | return self; 88 | } 89 | 90 | - (NSString *)description{ 91 | 92 | return [NSString stringWithFormat:@"option=%d&width=%.0lf_height=%.0lf_corners=%lu_cornerradius=%.1lf_opaque=%d_color=%@",(int)self.option,self.outputSize.width,self.outputSize.height,(unsigned long)self.corners,round(self.cornerRadius),self.opaque,[self.clipBgColor colorValue]]; 93 | } 94 | 95 | @end 96 | -------------------------------------------------------------------------------- /QSImageProcessDemo/Pods/FBRetainCycleDetector/FBRetainCycleDetector/Filtering/FBStandardGraphEdgeFilters.mm: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2016-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "FBStandardGraphEdgeFilters.h" 11 | 12 | #import 13 | 14 | #import 15 | 16 | #import "FBObjectiveCGraphElement.h" 17 | #import "FBRetainCycleDetector.h" 18 | 19 | FBGraphEdgeFilterBlock FBFilterBlockWithObjectIvarRelation(Class aCls, NSString *ivarName) { 20 | return FBFilterBlockWithObjectToManyIvarsRelation(aCls, [NSSet setWithObject:ivarName]); 21 | } 22 | 23 | FBGraphEdgeFilterBlock FBFilterBlockWithObjectToManyIvarsRelation(Class aCls, 24 | NSSet *ivarNames) { 25 | return ^(FBObjectiveCGraphElement *fromObject, 26 | NSString *byIvar, 27 | Class toObjectOfClass){ 28 | if (aCls && 29 | [[fromObject objectClass] isSubclassOfClass:aCls]) { 30 | // If graph element holds metadata about an ivar, it will be held in the name path, as early as possible 31 | if ([ivarNames containsObject:byIvar]) { 32 | return FBGraphEdgeInvalid; 33 | } 34 | } 35 | return FBGraphEdgeValid; 36 | }; 37 | } 38 | 39 | FBGraphEdgeFilterBlock FBFilterBlockWithObjectIvarObjectRelation(Class fromClass, NSString *ivarName, Class toClass) { 40 | return ^(FBObjectiveCGraphElement *fromObject, 41 | NSString *byIvar, 42 | Class toObjectOfClass) { 43 | if (toClass && 44 | [toObjectOfClass isSubclassOfClass:toClass]) { 45 | return FBFilterBlockWithObjectIvarRelation(fromClass, ivarName)(fromObject, byIvar, toObjectOfClass); 46 | } 47 | return FBGraphEdgeValid; 48 | }; 49 | } 50 | 51 | NSArray *FBGetStandardGraphEdgeFilters() { 52 | #if _INTERNAL_RCD_ENABLED 53 | static Class heldActionClass; 54 | static Class transitionContextClass; 55 | static dispatch_once_t onceToken; 56 | dispatch_once(&onceToken, ^{ 57 | heldActionClass = NSClassFromString(@"UIHeldAction"); 58 | transitionContextClass = NSClassFromString(@"_UIViewControllerOneToOneTransitionContext"); 59 | }); 60 | 61 | return @[FBFilterBlockWithObjectIvarRelation([UIView class], @"_subviewCache"), 62 | FBFilterBlockWithObjectIvarRelation(heldActionClass, @"m_target"), 63 | FBFilterBlockWithObjectToManyIvarsRelation([UITouch class], 64 | [NSSet setWithArray:@[@"_view", 65 | @"_gestureRecognizers", 66 | @"_window", 67 | @"_warpedIntoView"]]), 68 | FBFilterBlockWithObjectToManyIvarsRelation(transitionContextClass, 69 | [NSSet setWithArray:@[@"_toViewController", 70 | @"_fromViewController"]])]; 71 | #else 72 | return nil; 73 | #endif // _INTERNAL_RCD_ENABLED 74 | } 75 | --------------------------------------------------------------------------------