mercredi 10 novembre 2021

Design Pattern(s) or best approach for Image Processing Filters

I'm trying to build an application (like Lightroom/CameraRaw/Gimp..) which allow me to import an image and apply to it a few filters (contrast, luminance, smoothing, laplacian...), acting on a few sliders that pass the intensity of the specified filter. In order to be usable, I thought that each filters should be avalanche-applied: Let's imagine I set the contrast at 23, and the sharpness at 4, so in order to be concrete, the original image goes under the contrast Algorithm, and what came out of that undergoes the Laplacian Algorithm, and so on for other filters... So if at any time I change the contrast from 23, to 12, the original image undergoes again the same process (otherwise the total contrast will be 35!).

At the moment, I've implemented an Interface, which is realized by multiple classes, each of which implements a specified filter, and in order to render the 'output' image, I apply all those filter to the image as mentioned above.

Is there a better way/a Design Pattern that would better handle that situation?

Aucun commentaire:

Enregistrer un commentaire