/* * pixbuf.h - operations on GdkPixbuf objects * * This file declares functions in our project that manipulate GdkPixbuf * objects. GdkPixbuf is provided by the gdk-pixbuf library. */ #ifndef PIXBUF_H #define PIXBUF_H #include #include /* * Create a new GdkPixbuf by rotating an existing one 90 degrees clockwise * or counter clockwise. */ GdkPixbuf *pixbuf_copy_rotate_90(GdkPixbuf *src, gint counter_clockwise); /* * Create a new GdkPixbuf by mirroring (left/right) and/or flipping * (up/down) an existing one. To rotate 180 degrees, do both. If you do * neither, the new GdkPixbuf is a simple copy of the original. */ GdkPixbuf *pixbuf_copy_mirror(GdkPixbuf *src, gint mirror, gint flip); /* * Create a new GdkPixbuf by scaling an existing one to be the largest one * that will fit within given bounds, while keeping the aspect ratio. */ GdkPixbuf *pixbuf_scale(GdkPixbuf *src, gint width, gint height); /* * Start loading a new image in the background. Any previous background * loading is aborted. `done' is called with the new GdkPixbuf as its * argument once the loading is finished. If the loading is aborted, * `done' is not called. */ void pixbuf_load_start(const gchar *filename, void (*done)(void), void (*set_progress_bar)(gfloat)); /* * Abort a background loading of an image. */ void pixbuf_load_stop(void); /* * Get a suitably rotated and scaled version of the desired image file. * Return NULL if the files is not currently loaded into memory. */ GdkPixbuf *pixbuf_get(const gchar *fn, gint angle, gint width, gint height); /* * Like pixbuf_get, but get filename and rotation angle from the image * attributes. */ GdkPixbuf *pixbuf_get_from_image(Image *image, gint width, gint height); /* * Unit testing function for this module. */ gint pixbuf_unit_test(void); #endif