Latest 0.1
Homepage https://github.com/vitoziv/VIImageWorker
License MIT
Platforms ios , requires ARC
Authors

VIImageWorker 是处理图片行为的封装,比较适合用在为图片添加多种处理时使用

CocoaPods

使用 Pod 引入:pod 'VIImageWorker'

如何使用

VIIWImageEffect *resizeEffect = [VIIWImageEffect resizeEffectWithUISize:self.workerImageView.bounds.size contentMode:self.workerImageView.contentMode];
VIIWImageEffect *blurEffect = [VIIWImageEffect blurEffectWithType:MPIBlurImageEffectTypeLightEffect];
VIIWImageEffect *cornorEffect = [VIIWImageEffect cornerEffectWithRadius:20];
NSArray *effects = @[resizeEffect, blurEffect, cornorEffect];
VIIWImageWorker *imageWorker = [[VIIWImageWorker alloc] initWithEffects:effects];

dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void) {
    UIImage *effectImage = [imageWorker appleyEffectsToImage:image];

    dispatch_async(dispatch_get_main_queue(), ^(void) {
        self.workerImageView.image = effectImage;
    });
});

扩展 Effect

如果已有的 Effect 不能满足需求,可以自己写 Effect 类。
继承 VIImageEffect 类,实现 applyEffect: 方法就可以。

Latest podspec

{
    "name": "VIImageWorker",
    "version": "0.1",
    "license": "MIT",
    "summary": "VIImageWorker u662fu5904u7406u56feu7247u884cu4e3au7684u5c01u88c5uff0cu6bd4u8f83u9002u5408u7528u5728u4e3au56feu7247u6dfbu52a0u591au79cdu5904u7406u65f6u4f7fu7528",
    "homepage": "https://github.com/vitoziv/VIImageWorker",
    "authors": {
        "Vito": "[email protected]"
    },
    "source": {
        "git": "https://github.com/vitoziv/VIImageWorker.git",
        "tag": "0.1"
    },
    "platforms": {
        "ios": null
    },
    "source_files": [
        "VIImageWorker/*.{h,m}",
        "VIImageWorker/**/*.{h,m}"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This