//1.原始图片
UIImage * image = [UIImage imageNamed:@"1.jpg"]; /****************core image******************/
//a.图片
CIImage * ciImage = [[CIImage alloc] initWithImage:image];
//b.滤镜
CIFilter * ciFilter = [CIFilter filterWithName:@"CIGaussianBlur"];
NSLog(@"%@",[ciFilter attributes]);
//设置滤镜的模糊程度,默认是10
[ciFilter setValue:@() forKey:@"inputRadius"];
//将图片放到滤镜中
[ciFilter setValue:ciImage forKey:kCIInputImageKey];
//输出图片
CIImage * outImage = [ciFilter valueForKey:kCIOutputImageKey];
//c.获取CGImage的句柄
CIContext * context = [CIContext contextWithOptions:nil];
CGImageRef outCGImage = [context createCGImage:outImage fromRect:[outImage extent]];
UIImage * blurImage = [UIImage imageWithCGImage:outCGImage];
CGImageRelease(outCGImage); /********************************************/
//2.初始化imageView
UIImageView * imageView = [[UIImageView alloc] initWithFrame:CGRectMake(, , , )];
imageView.image = blurImage;
[self.view addSubview:imageView];

最新文章

  1. Linux查看可执行程序所在路径
  2. 学习mongo系列(五) AND,$or,$type
  3. sql server还原数据库文件(.bak)常见问题解决办法笔记
  4. C# 通过线程来控制进度条(转)--讲解多线程对界面的操作
  5. web测试用例表(自用)
  6. 坑爹CF April Fools Day Contest题解
  7. raspberry pi 3 截图及查看
  8. Window的匿名Closing 事件
  9. springMVC+ freemark多视图配置
  10. escape、encodeURI和encodeURIComponent的区别及使用
  11. Android异常分析(转)
  12. vscode 停用插件自动更新
  13. Nginx是什么?Nginx介绍及Nginx的优点
  14. js-循环中判断两次点击是否是同一元素
  15. MySQL字符集不一致的解决办法总结
  16. servlet injection analysis
  17. MySQL中的存储过程和函数使用详解
  18. 【刷题】BZOJ 2730 [HNOI2012]矿场搭建
  19. Nginx Configuration 免费HTTPS加密证书
  20. Spring+Dubbo集成Redis的两种解决方案

热门文章

  1. JavaWeb响应下载(包含工具类)
  2. Font Awesome 字体使用方法, 兼容ie7+
  3. Python的网络编程[0] -> socket[1] -> socket 模块
  4. jsp登陆
  5. MySQL EXPLAIN 命令详解学习
  6. Winform打砖块游戏制作step by step第4节---小球移动
  7. 利用jquery.form.js实现将form提交转为ajax方式提交的方法(带上传的表单提交)
  8. [置顶] kubernetes资源对象--ResourceQuotas
  9. 设计模式之原型模式(php实现)
  10. python 常用系统参数