Add support for chaining of post processors
It would be a nice addition to be able to chain post processing operations to get for example a bloom effect but with ACES tone mapping.
As I see things, there is 3 types of post processing operations:
- Operations that take an image with linear colors and output an image with linear colors, for example a bloom effect, a operation to change saturation/exposure, etc... Those operation are HDR -> HDR.
- Operations that take an image with linear color and output an image with non-linear colors, aka tone mapping operations, for example gamma correction ACES tone mapping etc... Those operations are HDR -> HDR but the output is implicitly non-linear.
- Clipping operation that take a non-linear HDR image and output a SDR image, for example RGB clamping or the operations described here https://bottosson.github.io/posts/gamutclipping/
A normal post processing pipeline should contain 0 to n type 1 operations, 1 type 2 operation and 1 type 3 operation in this order. But for simplicity we could choose to not enforce that.
All 3 types of operations could be represented by the same interface whose main method takes an image where components are stored as float and outputs an image where components are stored as float as well. What would change is how the various implementations of this interface interpret the input data based on their operation type. Type 1 and type 2 would interpret their input as linear HDR, type 3 would interpret its input as non-linear HDR. Type 1 would output linear HDR, type 2 would output non-linear HDR and type 3 would output non-linear SDR (values limited between 0 and 1). The final conversion to 8-bits will be done after all the processing operations and is not considered a processing operation itself as it has a different interface.