]> git.sesse.net Git - movit/blobdiff - dither_effect.h
Write PNGs instead of PPMs, so that we get destination alpha. Also, ask SDL for a...
[movit] / dither_effect.h
index d0f2423c26831c1705475f49052db0eeb7d496d0..535b783959a4a3355d16873ddbfe27f734baede6 100644 (file)
@@ -52,6 +52,11 @@ public:
        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 +64,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;