-
- unsigned char *src_overlay1 = load_image("overlay1.png", &img_w, &img_h);
-#if 0
- float *src_bleh = new float[img_w * img_h * 4];
- for (int i = 0; i < img_w * img_h; ++i) {
- float r = src_overlay1[i * 4 + 0] / 255.0f;
- float g = src_overlay1[i * 4 + 1] / 255.0f;
- float b = src_overlay1[i * 4 + 2] / 255.0f;
- float a = src_overlay1[i * 4 + 3] / 255.0f;
- // src_bleh[i * 4 + 0] = r * a;
- // src_bleh[i * 4 + 1] = g * a;
- // src_bleh[i * 4 + 2] = b * a;
- src_bleh[i * 4 + 0] = r;
- src_bleh[i * 4 + 1] = g;
- src_bleh[i * 4 + 2] = b;
- src_bleh[i * 4 + 3] = a;
- }
- FlatInput *overlay1 = new FlatInput(inout_format, FORMAT_BGRA_POSTMULTIPLIED_ALPHA, GL_FLOAT, img_w, img_h);
-#endif
- FlatInput *overlay1 = new FlatInput(inout_format, FORMAT_BGRA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, img_w, img_h);
- chain.add_input(overlay1);
-
- unsigned char *src_overlay2 = load_image("overlay2.png", &img_w, &img_h);
- FlatInput *overlay2 = new FlatInput(inout_format, FORMAT_BGRA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, img_w, img_h);
- chain.add_input(overlay2);
-
- Effect *mix1 = chain.add_effect(new OverlayEffect(), overlay2, overlay1);
- //Effect *mix1_resized = chain.add_effect(new ResampleEffect(), mix1);
- Effect *mix1_resized = chain.add_effect(new ResizeEffect(), mix1);
- CHECK(mix1_resized->set_int("width", 1280));
- CHECK(mix1_resized->set_int("height", 720));
- Effect *mix2 = chain.add_effect(new OverlayEffect(), input, mix1_resized);
-// Effect *mix2 = chain.add_effect(new OverlayEffect(), input, overlay1);
-
- //Effect *lift_gamma_gain_effect = chain.add_effect(new LiftGammaGainEffect());
- //Effect *saturation_effect = chain.add_effect(new SaturationEffect());
- //Effect *diffusion_effect = chain.add_effect(new DiffusionEffect());