ARC
ARC

Reputation: 1804

Difference between grouping image filters and chaining image filters

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

Answers (1)

Brad Larson
Brad Larson

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

Related Questions