标签:color 使用 ar for sp c ad ef size
- (void)viewDidLoad
{
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
UIImage *image = [UIImage imageNamed:@"2"];
//原图片
UIImageView *imageOri = [[UIImageView alloc]initWithFrame:CGRectMake(5, 20, 150, 90)];
imageOri.image = image;
[self.view addSubview:imageOri];
//创建一个亮度滤镜
GPUImageBrightnessFilter *passthroughFilter = [[GPUImageBrightnessFilter alloc]init];
passthroughFilter.brightness = - 0.5;
//设置要渲染的滤镜
[passthroughFilter forceProcessingAtSize:image.size];
//获取要渲染的图片
GPUImagePicture *stillImageSource = [[GPUImagePicture alloc]initWithImage:image];
//添加上滤镜
[stillImageSource addTarget:passthroughFilter];
//开始渲染
[stillImageSource processImage];
//获取渲染后的图片
UIImage *nearestNeighborImage = [passthroughFilter imageFromCurrentlyProcessedOutput];
//加载出来
UIImageView *imageView = [[UIImageView alloc]initWithImage:nearestNeighborImage];
imageView.frame = CGRectMake(160, 20, 150, 90);
[self.view addSubview:imageView];
}
标签:color 使用 ar for sp c ad ef size
原文地址:http://www.cnblogs.com/qianyindichang/p/3977574.html