Reputation: 1804
Recently came across Brad Larson's GPUImage project. Confused about what to use for chaining filters.
What is the difference between using GPUImageFilterGroup and GPUImageFilterPipeline (chain of filters), vs doing addTarget: for each filter ?
Thanks.
Upvotes: 3
Views: 537
Reputation: 170317
It's a matter of convenience.
When creating a GPUImageFilterGroup from a series of sub-filters, you can treat it as if it was a single filter. That means that you can remove a group from a filter chain as a unit, change targets, etc. Filter group subclasses can package commonly used filter chains into reusable units, with relevant exposed properties for tweaking.
For example, the GPUImageCannyEdgeDetectionFilter is a GPUImageFilterGroup composed of several filter steps that carry out the Canny edge detection process. You don't need to know about any of that to use this as a distinct filter, because that's abstracted away within the group.
Upvotes: 4