X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=gamma_expansion_effect.cpp;h=9391a91f55bd9be3c171a9ad911d71d1e4ca6a9c;hp=dcd0cde6ded15b73209e3c42d8df16514920a6d4;hb=db1fbb73b18b68850f61d1c8b89f2e4d3f7aadc1;hpb=a88f299483ffe5068cd2828513078b9103325da8 diff --git a/gamma_expansion_effect.cpp b/gamma_expansion_effect.cpp index dcd0cde..9391a91 100644 --- a/gamma_expansion_effect.cpp +++ b/gamma_expansion_effect.cpp @@ -1,7 +1,24 @@ -#include "gamma_expansion_effect.h"j +#include + +#include "gamma_expansion_effect.h" +#include "util.h" GammaExpansionEffect::GammaExpansionEffect() : source_curve(GAMMA_LINEAR) { register_int("source_curve", (int *)&source_curve); } + +std::string GammaExpansionEffect::output_fragment_shader() +{ + switch (source_curve) { + case GAMMA_LINEAR: + return read_file("identity-fs.glsl"); + case GAMMA_sRGB: + return read_file("gamma_expansion_effect_srgb.glsl"); + case GAMMA_REC_709: // and GAMMA_REC_601 + return read_file("gamma_expansion_effect_rec709.glsl"); + default: + assert(false); + } +}