X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=lift_gamma_gain_effect.h;h=b57a89964204fa5622635ac852d8678721a090ce;hp=6364eeb00b6c41b79f894b1da231cb44cdfac240;hb=e8650c7b7814c5beef59059b8acac3e5e7b8ddc6;hpb=b77dca09201f3373c5466d695338e1e29406072b diff --git a/lift_gamma_gain_effect.h b/lift_gamma_gain_effect.h index 6364eeb..b57a899 100644 --- a/lift_gamma_gain_effect.h +++ b/lift_gamma_gain_effect.h @@ -1,6 +1,22 @@ #ifndef _LIFT_GAMMA_GAIN_EFFECT_H #define _LIFT_GAMMA_GAIN_EFFECT_H 1 +// A simple lift/gamma/gain effect, used for color grading. +// +// Very roughly speaking, lift=shadows, gamma=midtones and gain=highlights, +// although all parameters affect the entire curve. Mathematically speaking, +// it is a bit unusual to look at gamma as a color, but it works pretty well +// in practice. +// +// The classic formula is: output = (gain * (x + lift * (1-x)))^(1/gamma). +// +// The lift is actually a case where we actually would _not_ want linear light; +// since black by definition becomes equal to the lift color, we want lift to +// be pretty close to black, but in linear light that means lift affects the +// rest of the curve relatively little. Thus, we actually convert to gamma 2.2 +// before lift, and then back again afterwards. (Gain and gamma are, +// up to constants, commutative with the de-gamma operation.) + #include "effect.h" class LiftGammaGainEffect : public Effect {