GPUImageFilterGroup
的用途是什么?
为什么我们需要完成所有addFilter
,setInitialFilters
,setTerminalFilter
步骤?我们甚至需要addTarget
来使用组中的过滤器?
filters
中的initialFilters
和GPUImageFilterGroup.m
有什么区别?
GPUImageFilterGroup
是否可能仅收到一个filters
数组,并设置setInitialFilters
,setTerminalFilter
,甚至为要添加的过滤器一一添加目标?
case GPUIMAGE_FILTERGROUP:
{
self.title = @"Filter Group";
self.filterSettingsSlider.hidden = NO;
[self.filterSettingsSlider setValue:0.05];
[self.filterSettingsSlider setMinimumValue:0.0];
[self.filterSettingsSlider setMaximumValue:0.3];
filter = [[GPUImageFilterGroup alloc] init];
GPUImageSepiaFilter *sepiaFilter = [[GPUImageSepiaFilter alloc] init];
[(GPUImageFilterGroup *)filter addFilter:sepiaFilter];
GPUImagePixellateFilter *pixellateFilter = [[GPUImagePixellateFilter alloc] init];
[(GPUImageFilterGroup *)filter addFilter:pixellateFilter];
[sepiaFilter addTarget:pixellateFilter];
[(GPUImageFilterGroup *)filter setInitialFilters:[NSArray arrayWithObject:sepiaFilter]];
[(GPUImageFilterGroup *)filter setTerminalFilter:pixellateFilter];
}; break;