]> git.tdb.fi Git - libs/gl.git/blob - source/colorcurve.h
Some fixes to assignment management in UnusedVariableLocator
[libs/gl.git] / source / colorcurve.h
1 #ifndef MSP_GL_COLORCURVE_H_
2 #define MSP_GL_COLORCURVE_H_
3
4 #include "postprocessor.h"
5 #include "program.h"
6 #include "programdata.h"
7 #include "texture1d.h"
8 #include "texturing.h"
9
10 namespace Msp {
11 namespace GL {
12
13 /**
14 Processes oversaturated colors to preserve hues.  When one color component
15 exceeds 1.0, the overflow is distributed to the other components, scaling the
16 color towards white.
17
18 Gamma or sRGB correction can also be applied to the output.  It can be used to
19 improve color reproduction by performing lighting calculations in linear color
20 space and converting to sRGB for display.
21 */
22 class ColorCurve: public PostProcessor
23 {
24 private:
25         Program shprog;
26         ProgramData shdata;
27         Texture1D curve;
28         Texturing texturing;
29         const Mesh &quad;
30
31 public:
32         ColorCurve();
33
34         /** Set exposure adjustment in EV units.  Positive values brighten the
35         image, negative values darken it.  Zero is neutral. */
36         void set_exposure_adjust(float);
37
38         /** Sets the exponent of the */
39         void set_brightness_response(float);
40
41         // Deprecated functions
42         void set_peak(float);
43         void set_brightness(float);
44
45         /** Sets the gamma value used for mapping output colors.  Allowed range is
46         from 0.1 to 10. */
47         void set_gamma(float);
48
49         /** Sets output mapping to sRGB.  This is almost, but not exactly equivalent
50         to set_gamma(2.2). */
51         void set_srgb();
52
53         /// Sets output mapping to linear.  This is equivalent to set_gamma(1).
54         void set_linear();
55
56         virtual void render(Renderer &, const Texture2D &, const Texture2D &);
57 };
58
59 } // namespace GL
60 } // namespace Msp
61
62 #endif