]> git.decadent.org.uk Git - videolink.git/blob - pixbufs.hpp
Imported version 0.1
[videolink.git] / pixbufs.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_PIXBUFS_HPP
5 #define INC_PIXBUFS_HPP
6
7 #include <glibmm/refptr.h>
8
9 namespace Gdk
10 {
11     class Pixbuf;
12 }
13
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 old and new Pixbufs must be equal
19 // and match the specified dimensions.  The width and height of
20 // the 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);
27
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);
31
32 #endif // !INC_PIXBUFS_HPP