{GPUImageFilterGroup`的用途是什么?

时间:2019-01-18 01:48:07

标签: ios objective-c gpuimage imagefilter

GPUImageFilterGroup的用途是什么?

为什么我们需要完成所有addFiltersetInitialFilterssetTerminalFilter步骤?我们甚至需要addTarget来使用组中的过滤器? filters中的initialFiltersGPUImageFilterGroup.m有什么区别?

GPUImageFilterGroup是否可能仅收到一个filters数组,并设置setInitialFilterssetTerminalFilter,甚至为要添加的过滤器一一添加目标?

        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;

0 个答案:

没有答案