1 // Copyright 2005-6 Ben Hutchings <ben@decadent.org.uk>.
2 // See the file "COPYING" for licence details.
4 #ifndef INC_PIXBUFS_HPP
5 #define INC_PIXBUFS_HPP
7 #include <glibmm/refptr.h>
14 // Find pixel differences between an "old" and "new" RGB Pixbuf
15 // (or RGBA, but the alpha component will be ignored) and copy the
16 // differing pixels from the new one to a third RGBA Pixbuf at the
17 // specified offset with full opacity.
18 // The width and height of the new Pixbufs must be equal and match
19 // the specified dimensions. The width and height of the old and
20 // third Pixbuf must be large enough to store a rectangle of
21 // those dimensions at the specified offset.
22 void diff_rgb_pixbufs(Glib::RefPtr<Gdk::Pixbuf> old_buf,
23 Glib::RefPtr<Gdk::Pixbuf> new_buf,
24 Glib::RefPtr<Gdk::Pixbuf> diff_buf,
25 int offset_x, int offset_y,
26 int width, int height);
28 // Quantise an RGBA Pixbuf to the specified number of colours, including
29 // one transparent colour. Currently uses Floyd-Steinberg dithering.
30 void quantise_rgba_pixbuf(Glib::RefPtr<Gdk::Pixbuf> buf, int n_colours);
32 #endif // !INC_PIXBUFS_HPP