TapCommon-Unity/Plugins/iOS/TapCommonSDK.framework/Headers/TDSImageManager.h

46 lines
1.4 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

//
// ImageManager.h
// NativeApp
//
// Created by JiangJiahao on 2018/10/16.
// Copyright © 2018 JiangJiahao. All rights reserved.
// 图片辅助类有些方法可以用catogary实现
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void(^resultBlockWithName)(UIImage *_Nullable resultImage,NSString * _Nonnull imageName);
typedef void(^resultBlock)(UIImage *_Nullable resultImage);
NS_ASSUME_NONNULL_BEGIN
@interface TDSImageManager : NSObject
/// 图片缩放
/// @param img 图片
/// @param size 尺寸
+ (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
/// 滤镜,高斯模糊
/// @param image 图片
/// @param blur 模糊程度
+ (UIImage *)blurryImage:(UIImage *)image withBlurLevel:(CGFloat)blur;
/// URL获取图片名称
/// @param url 图片URL
+ (NSString *)imageNameWithUrl:(NSString *)url;
+ (void)loadImage:(NSString *)imageName needDecode:(BOOL)needDecode resultBlock:(resultBlockWithName)block;
+ (void)loadImage:(NSString *)imageName resultBlock:(resultBlockWithName)block;
+ (void)loadImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block;
// 只需要传入"xxx.png"
+ (UIImage *)getBundleImage:(NSString *)imageName resultBlock:(resultBlockWithName)block;
+ (UIImage *)getBundleImage:(NSString *)imageName size:(CGSize)size resultBlock:(resultBlockWithName)block;
//UIColor 转UIImage
+ (UIImage*)createImageWithColor: (UIColor *)color;
@end
NS_ASSUME_NONNULL_END