[翻译] CoreImage-with-EAGLContext
CoreImage-with-EAGLContext

https://github.com/anaglik/CoreImage-with-EAGLContext
Simple example of drawing manipulated image to CIContext based on EAGLContext. This setup is recomended when applicaion needs Real-Time performance.(image is never copied to CPU memory).
一个简单的例子,在EAGLContext上下文中将被操作的图片绘制进CIContext。当你的应用需要实时变换图片的时候,建议你这么使用(图片永远不会被拷贝进内存当中)。
In this example I am using "CIMaskToAlpha" filter to replace background color of image below with color of main view.
这个例子中,我使用了CIMaskToAlpah滤镜,将下面图片的背景颜色替换成主view上背景颜色。

Result Image looks like this :
结果如下所示:

附录:
“UIImage+Blur.h” + “UIImage+Blur.m”
//
// UIImage+Blur.h
//
// Created by Luke on 13-9-3.
// Copyright (c) 2013年 LukeCheng. All rights reserved.
// #import <UIKit/UIKit.h> @interface UIImage (Blur) - (UIImage *)blur:(CGFloat)radius; - (UIImage *)blur; @end
//
// UIImage+Blur.m
//
// Created by Luke on 13-9-3.
// Copyright (c) 2013年 LukeCheng. All rights reserved.
// #import "UIImage+Blur.h" @implementation UIImage (Blur) - (UIImage *)blur:(CGFloat)radius
{
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage = [[CIImage alloc] initWithImage:self];
// create gaussian blur filter
CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
[filter setValue:inputImage forKey:kCIInputImageKey];
[filter setValue:[NSNumber numberWithFloat:radius] forKey:@"inputRadius"];
// blur image
CIImage *result = [filter valueForKey:kCIOutputImageKey];
CGImageRef cgImage = [context createCGImage:result fromRect:[result extent]];
UIImage *image = [UIImage imageWithCGImage:cgImage];
CGImageRelease(cgImage); return image;
} - (UIImage *)blur
{
return [self blur:10.0f];
} @end
- Core Image Filters:http://developer.apple.com/library/mac/#documentation/graphicsimaging/reference/CoreImageFilterReference/Reference/reference.html
- Simple Image Processing: http://code.google.com/p/simple-iphone-image-processing/
- GLImageProcessing:http://developer.apple.com/library/ios/#samplecode/GLImageProcessing/Introduction/Intro.html
- CImg: http://cimg.sourceforge.net/reference/group__cimg__tutorial.html
[翻译] CoreImage-with-EAGLContext的更多相关文章
- [翻译] NSImage+HHTint - Tints grayscale images using CoreImage
NSImage+HHTint - Tints grayscale images using CoreImage https://github.com/gloubibou/NSImage-HHTint ...
- CoreImage 处理图片
1.CoreImage 滤镜的使用(马赛克模糊) CoreImage是苹果公司为了简化图片处理的难度而开发出来的类库. 随着iOS版本号升级以及硬件性能的不断提升,CoreImage将支持越来越多的滤 ...
- iOS-图像之CoreImage框架
1.coreImage的介绍 coreImage是IOS5中新加入的一个Objective-C的框架,提供了强大高效的图像处理功能,用来对基于像素的图像进行操作与分析.iOS提供了很多强大的滤镜( ...
- iOS CoreImage之滤镜简单使用
代码地址如下:http://www.demodashi.com/demo/11605.html 老骥伏枥,志在千里 前记 最近一直在研究图像处理方面,既上一篇iOS Quart2D绘图之UIImage ...
- [Swift通天遁地]八、媒体与动画-(4)给相机添加CoreImage滤镜效果
★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号:山青咏芝(shanqingyongzhi)➤博客园地址:山青咏芝(https://www.cnblogs. ...
- iOS CoreImage图片处理动态渲染(滤镜)
// // ViewController.m // CoreImageOfDong // // Created by Dong on 15/6/30. // Copyright (c) 201 ...
- 《Django By Example》第五章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者@ucag注:大家好,我是新来的翻译, ...
- 《Django By Example》第四章 中文 翻译 (个人学习,渣翻)
书籍出处:https://www.packtpub.com/web-development/django-example 原作者:Antonio Melé (译者注:祝大家新年快乐,这次带来<D ...
- [翻译]开发文档:android Bitmap的高效使用
内容概述 本文内容来自开发文档"Traning > Displaying Bitmaps Efficiently",包括大尺寸Bitmap的高效加载,图片的异步加载和数据缓存 ...
- 【探索】机器指令翻译成 JavaScript
前言 前些时候研究脚本混淆时,打算先学一些「程序流程」相关的概念.为了不因太枯燥而放弃,决定想一个有趣的案例,可以边探索边学. 于是想了一个话题:尝试将机器指令 1:1 翻译 成 JavaScript ...
随机推荐
- Redis笔记(一):Redis安装教程
Redis是一个开源的使用ANSI C语言编写.支持网络.可基于内存亦可持久化的日志型.Key-Value数据库,并提供多种语言的API. Redis是目前应用最广泛的内存数据存储技术,相比之前的Me ...
- Linux 搭建Hadoop集群错误锦集
一.Hadoop集群配置好后,执行start-dfs.sh后报错,一堆permission denied zf sbin $ ./start-dfs.sh Starting namenodes on ...
- MVC与MVVM设计模式理解
MVC设计模式(View和Model之间不能直接通信) MVC是一种架构模式,M表示Model,V表示视图View,C表示控制器Controller: Model负责存储.定义.操作数据.从网络中获取 ...
- docker 微镜像-alpine
刚想找maven自动发布项目到tomcat, 突然看到个好玩的, docker微镜像 -- alpine 直接粘一段: Alpine Linux Docker镜像基于Alpine Linux操作系统, ...
- CentOS探索之路2---使用rpm安装JDK
使用rpm安装jdk 在前一Linux探索文章中http://www.cnblogs.com/Kidezyq/p/8782728.html,有关于通过yum指令安装原生OpenJDK的命令.当时有 ...
- Deep Q-Network 学习笔记(四)—— 改进②:double dqn
这篇没搞懂...这里只对实现做记录. 修改的地方也只是在上一篇的基础上,在“记忆回放”函数里,计算 target Q 时取值做下调整即可. def experience_replay(self): & ...
- MVC初级教程(二)
演示产品源码下载地址:http://www.jinhusns.com/Products/Download
- win10 系统下MyEclipse用SVN之后想切换用户的解决方法
1.在svn 创建了两类账户,分别是管理员 和 开发人员. 2.代码同步到Myecclipse .使用的是 admin 管理员账户checkout. 3.提交代码的时候想用开发者账户user提交,发现 ...
- ssh基础配置大全
firstweb firstweb-pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi= ...
- future3.2 Tomcat启动时错误:Cannot rename original file to ...
其日志中第一个警告如下: 警告: Unexpected exception resolving reference java.io.IOException: Cannot rename origina ...