1 #ifndef _EFFECT_CHAIN_H
2 #define _EFFECT_CHAIN_H 1
9 enum PixelFormat { FORMAT_RGB, FORMAT_RGBA, FORMAT_BGR, FORMAT_BGRA };
13 COLORSPACE_REC_709 = 0, // Same as sRGB.
14 COLORSPACE_REC_601_525 = 1,
15 COLORSPACE_REC_601_625 = 2,
22 GAMMA_REC_709 = 2, // Same as Rec. 601.
26 PixelFormat pixel_format;
27 ColorSpace color_space;
28 GammaCurve gamma_curve;
33 EffectChain(unsigned width, unsigned height);
35 // input, effects, output, finalize need to come in that specific order.
37 void add_input(const ImageFormat &format);
39 // The returned pointer is owned by EffectChain.
40 Effect *add_effect(EffectId effect);
42 void add_output(const ImageFormat &format);
45 //void render(unsigned char *src, unsigned char *dst);
46 void render_to_screen(unsigned char *src);
49 void normalize_to_linear_gamma();
50 void normalize_to_srgb();
52 unsigned width, height;
53 ImageFormat input_format, output_format;
54 std::vector<Effect *> effects;
56 GLuint source_image_num;
57 bool use_srgb_texture_format;
59 GLint glsl_program_num;
60 GLenum format, bytes_per_pixel;
63 // Used during the building of the effect chain.
64 ColorSpace current_color_space;
65 GammaCurve current_gamma_curve;
69 #endif // !defined(_EFFECT_CHAIN_H)