GPU|多重滤镜
UIImage *faceImage = [UIImage imageNamed:@"469453586_640.jpg"];
UIImageView *face = [[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, faceImage.size.width/2.0, faceImage.size.height/2.0)];
[face setImage:faceImage];
[self.view addSubview:face];
GPUImagePicture *stillImageSource = [[GPUImagePicture alloc] initWithImage:faceImage];
GPUImageBrightnessFilter *brightnessFilter = [[GPUImageBrightnessFilter alloc] init];
[brightnessFilter setBrightness:.15];
GPUImageGrayscaleFilter *grayscaleFilter = [[GPUImageGrayscaleFilter alloc] init];
GPUImagePosterizeFilter *posterizeFilter = [[GPUImagePosterizeFilter alloc] init];
[posterizeFilter setColorLevels:1];
[stillImageSource addTarget:brightnessFilter];
[brightnessFilter addTarget:grayscaleFilter];
[grayscaleFilter addTarget:posterizeFilter];
// these need to be changed if you change the order of your filters
// [brightnessFilter useNextFrameForImageCapture];
// [grayscaleFilter useNextFrameForImageCapture];
[posterizeFilter useNextFrameForImageCapture];
[stillImageSource processImage];
【GPU|多重滤镜】 [face setImage: [posterizeFilter imageFromCurrentFramebuffer]];
推荐阅读
- [源码解析]|[源码解析] NVIDIA HugeCTR,GPU版本参数服务器---(3)
- 在职场打拼,拥有话语权有多重要()
- 一些非常有用的snippets
- 《24个比利》多重人格真的存在吗()
- OpenGL|OpenGL ES之LUT(滤镜基准图)
- 好好说话|好好说话 要多重要就有多重要
- iOS(GPUImage本地视频叠加)
- 根本不需要滤镜,身边处处是惊喜
- 拟合多重线性回归模型
- 2018-11-30买家秀里,看到的是真实世界,还是笑话滤镜