X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=dither_effect.h;h=cad6488921b67c5f60a3a1ac17fb97dec440b474;hp=d0f2423c26831c1705475f49052db0eeb7d496d0;hb=fc55857d9ccf1edcc141fa0853a8bf2d6b40b4dc;hpb=ff9e68a3f5abb179bd7bf9fb84df48327f148583 diff --git a/dither_effect.h b/dither_effect.h index d0f2423..cad6488 100644 --- a/dither_effect.h +++ b/dither_effect.h @@ -46,12 +46,22 @@ #include "effect.h" class DitherEffect : public Effect { -public: +private: + // Should not be instantiated by end users; + // call EffectChain::set_dither_bits() instead. DitherEffect(); + friend class EffectChain; + +public: ~DitherEffect(); virtual std::string effect_type_id() const { return "DitherEffect"; } std::string output_fragment_shader(); + // Note that if we did error diffusion, we'd actually want to diffuse the + // premultiplied error. However, we need to do dithering in the same + // space as quantization, whether that be pre- or postmultiply. + virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; } + void set_gl_state(GLuint glsl_program_num, const std::string &prefix, unsigned *sampler_num); private: @@ -59,6 +69,7 @@ private: int width, height, num_bits; int last_width, last_height, last_num_bits; + int texture_width, texture_height; GLuint texnum; bool need_texture_update;