我在我的应用中添加了一个混合过滤器列表。为了调整混合图像的alpha值,我使用了GPUImageOpacityFilter
和混合滤镜。
self.originalPicture = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"IMG_0009.JPG"]];
self.opacityFilter = [[GPUImageOpacityFilter alloc] init];
[self.opacityFilter forceProcessingAtSizeRespectingAspectRatio:CGSizeMake(768, 768)];
GPUImageView *filterView = [[GPUImageView alloc] init];
self.view = filterView;
self.picture = [[GPUImagePicture alloc] initWithImage:[UIImage imageNamed:@"Monkey.JPG"]];
[self.picture processImage];
[self.picture addTarget:self.opacityFilter];
GPUImageDivideBlendFilter *blendFilter = [[GPUImageDivideBlendFilter alloc] init];
[blendFilter forceProcessingAtSizeRespectingAspectRatio:CGSizeMake(768, 768)];
[self.opacityFilter addTarget:blendFilter];
[self.originalPicture addTarget:blendFilter];
[blendFilter addTarget:filterView];
[self.picture processImage];
[self.originalPicture processImage];
它适用于以下混合过滤器:
GPUImageAddBlendFilter
GPUImageDivideBlendFilter
GPUImageMultiplyBlendFilter
GPUImageOverlayBlendFilter
GPUImageDarkenBlendFilter
GPUImageColorDodgeBlendFilter
GPUImageHardLightBlendFilter
GPUImageSoftLightBlendFilter
而不是在下面工作:
GPUImageLightenBlendFilter
GPUImageColorBurnBlendFilter
GPUImageLinearBurnBlendFilter
GPUImageScreenBlendFilter
GPUImageSubtractBlendFilter
GPUImageDifferenceBlendFilter
GPUImageExclusionBlendFilter
GPUImageColorBlendFilter
GPUImageHueBlendFilter
GPUImageSaturationBlendFilter
GPUImageLuminosityBlendFilter
我知道每个过滤器的过程背后的概念(不透明度+混合过滤器)都不同。有人可以解释一下这个过程吗?