0
Vote

Accumulative and Non-accumulative processing

description

Currently, processing is done accumulatively - each filter in the pipeline takes the output from the last filter, processes the image and passes the results on. The image at the end is the result of having been passed through many filters.
 
I would like to add the ability to process images non-accumulatively in one pass, which basically means that each filter in the pipeline processes the image as if it was the only filter there. Therefore, each filter would produce a separate image.
 
The scenario I want to enable is this: if, for example, I have a full-size product image and I want to produce 5 thumbnails of varying sizes, I would currently have to run through a loop 5 times, creating a new instance of ImageProcessor, adding in a resize filter, process the image and then save the output.
 
Or, using this proposal, I can add 5 resize filters to the processor, each with the appropriate thumbnail size, set the process mode to "non-accumulative" and then call Process() once, and retrieve 5 different images.
 
The big design question I can't answer at the moment is: how do we determine the output filename/stream for each step?

comments