IOS滤镜

IOS 自带coreImage CIFilter 共有100多种滤镜效果,官方只介绍了一种,找不到中文介绍,下面是其中一部分中文介绍

 CIAdditionCompositing     //影像合成

    CIAffineTransform           //仿射变换

    CICheckerboardGenerator       //棋盘发生器

    CIColorBlendMode              //CIColor混合模式

    CIColorBurnBlendMode          //CIColor燃烧混合模式

    CIColorControls 

    CIColorCube                   //立方体

    CIColorDodgeBlendMode         //CIColor避免混合模式

    CIColorInvert                 //CIColor反相

    CIColorMatrix                 //CIColor矩阵

    CIColorMonochrome             //黑白照

    CIConstantColorGenerator      //恒定颜色发生器

    CICrop                        //裁剪

    CIDarkenBlendMode             //亮度混合模式

    CIDifferenceBlendMode         //差分混合模式

    CIExclusionBlendMode          //互斥混合模式

    CIExposureAdjust              //曝光调节

    CIFalseColor                  //伪造颜色

    CIGammaAdjust                 //灰度系数调节

    CIGaussianGradient            //高斯梯度

    CIHardLightBlendMode          //强光混合模式

    CIHighlightShadowAdjust       //高亮阴影调节

    CIHueAdjust                   //饱和度调节

    CIHueBlendMode                //饱和度混合模式

    CILightenBlendMode            

    CILinearGradient              //线性梯度

    CILuminosityBlendMode         //亮度混合模式

    CIMaximumCompositing          //最大合成

    CIMinimumCompositing          //最小合成

    CIMultiplyBlendMode           //多层混合模式

    CIMultiplyCompositing         //多层合成

    CIOverlayBlendMode            //覆盖叠加混合模式

    CIRadialGradient              //半径梯度

    CISaturationBlendMode         //饱和度混合模式

    CIScreenBlendMode             //全屏混合模式

    CISepiaTone                   //棕黑色调

    CISoftLightBlendMode          //弱光混合模式

    CISourceAtopCompositing       

    CISourceInCompositing 

    CISourceOutCompositing 

    CISourceOverCompositing 

    CIStraightenFilter            //拉直过滤器

    CIStripesGenerator            //条纹发生器

    CITemperatureAndTint          //色温

    CIToneCurve                   //色调曲线

    CIVibrance                    //振动

    CIVignette                    //印花

    CIWhitePointAdjust            //白平衡调节

 

下面是一个图片做旧 灰白滤镜效果

 NSString *filePath =
        [[NSBundle mainBundle] pathForResource:@"tp02" ofType:@"png"];
        NSURL *fileNameAndPath = [NSURL fileURLWithPath:filePath];
        
        // 2
        CIImage *beginImage =
        [CIImage imageWithContentsOfURL:fileNameAndPath];
        
        CIFilter *filter = [CIFilter filterWithName:@"CIColorMonochrome"
                            
                                      keysAndValues:kCIInputImageKey,beginImage,kCIInputColorKey,[CIColor colorWithCGColor:[UIColor lightGrayColor].CGColor],nil];
        
        NSLog(@"%@",filter.attributes);
        // 3 CIColor
//        CIFilter *filter = [CIFilter filterWithName:@"CISepiaTone"
//                                      keysAndValues: kCIInputImageKey, beginImage,
//                            @"inputIntensity", @0.99999, nil];
        CIImage *outputImage = [filter outputImage];
//
//        // 4
        UIImage *newImage = [UIImage imageWithCIImage:outputImage];
        cell.photo.image =newImage;

 还有一种使用RGBA通道的位图上下文重画像素点的方法 给个链接

http://blog.sina.com.cn/s/blog_6f29e81f010176lr.html

IOS滤镜,布布扣,bubuko.com

IOS滤镜

上一篇:Android中的实时(real-time)调度


下一篇:Android Zip文件解压缩代码