X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Feffects%2Fcolorcurve.h;h=5cebcb00835e818fe2b44a303928b2b502c149f4;hb=38712d8ecc57d043a2419ffbaeeb57f7a6586f14;hp=3f65b04916897c6d85bde7ec4f33fece160a3cd1;hpb=7aaec9a70b8d7733429bec043f8e33e02956f266;p=libs%2Fgl.git diff --git a/source/effects/colorcurve.h b/source/effects/colorcurve.h index 3f65b049..5cebcb00 100644 --- a/source/effects/colorcurve.h +++ b/source/effects/colorcurve.h @@ -2,14 +2,14 @@ #define MSP_GL_COLORCURVE_H_ #include "postprocessor.h" -#include "program.h" #include "programdata.h" #include "texture1d.h" -#include "texturing.h" namespace Msp { namespace GL { +class Program; + /** Processes oversaturated colors to preserve hues. When one color component exceeds 1.0, the overflow is distributed to the other components, scaling the @@ -34,24 +34,21 @@ public: void srgb(); }; - float exposure_adjust; - float brightness_response; - float gamma; - bool srgb; - - Template(); + float exposure_adjust = 0.0f; + float brightness_response = 0.4f; + float gamma = 1.0f; + bool srgb = false; virtual ColorCurve *create(unsigned, unsigned) const; }; private: - Program shprog; + const Program &shprog; ProgramData shdata; Texture1D curve; - Texturing texturing; - RefPtr quad; - RefPtr linear_sampler; - RefPtr nearest_sampler; + const Mesh &quad; + const Sampler &linear_sampler; + const Sampler &nearest_sampler; public: ColorCurve(); @@ -60,7 +57,9 @@ public: image, negative values darken it. Zero is neutral. */ void set_exposure_adjust(float); - /** Sets the exponent of the */ + /** Sets the exponent of the brightness response curve. It must be greater + than zero and at most one. A value of one gives a linear response; closer + to zero results in a more gentle curve. */ void set_brightness_response(float); /** Sets the gamma value used for mapping output colors. Allowed range is @@ -75,6 +74,8 @@ public: void set_linear(); virtual void render(Renderer &, const Texture2D &, const Texture2D &); + + virtual void set_debug_name(const std::string &); }; } // namespace GL