--- rxvt-unicode/src/rxvtimg.h 2012/06/03 16:55:31 1.5 +++ rxvt-unicode/src/rxvtimg.h 2012/06/06 22:01:44 1.15 @@ -1,7 +1,7 @@ #ifndef IMG_H #define IMG_H -#if defined HAVE_BG_PIXMAP && defined BG_IMAGE_FROM_FILE && defined ENABLE_TRANSPARENCY && defined HAVE_PIXBUF +#if HAVE_BG_PIXMAP && BG_IMAGE_FROM_FILE && ENABLE_TRANSPARENCY && HAVE_PIXBUF #define HAVE_IMG 1 #endif @@ -13,34 +13,50 @@ { rxvt_screen *s; Pixmap pm; - int w, h; + int x, y, w, h, repeat; XRenderPictFormat *format; + bool shared; // true if we don't own it rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height); rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); static rxvt_img *new_from_root (rxvt_screen *s); // get root pixmap - static rxvt_img *new_from_file (const char *filename); // from pixbuf + static rxvt_img *new_from_file (rxvt_screen *s, const char *filename); // from pixbuf ~rxvt_img (); Pixmap steal () { - Pixmap res = pm; - pm = 0; - return res; + shared = true; + return pm; } // inplace + void move (int dx, int dy) + { + x += dx; + y += dy; + } + + void repeat_mode (int repeat) + { + this->repeat = repeat; + } + + void unshare (); // create a copy of the pixmap if !shared void fill (const rxvt_color &c); - void blur (int rh, int rv); void brightness (double r, double g, double b, double a = 1.); void contrast (double r, double g, double b, double a = 1.); - void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); + bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); // copy - rxvt_img *copy (); + rxvt_img *blur (int rh, int rv); + rxvt_img *clone (); + rxvt_img *sub_rect (int x, int y, int width, int height); + rxvt_img *transform (int new_width, int new_height, double matrix[9]); rxvt_img *scale (int new_width, int new_height); - rxvt_img *transform (int new_width, int new_height, double matrix[16]); + rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi); + rxvt_img *convert_to (XRenderPictFormat *format, const rxvt_color &bg); + rxvt_img *blend (rxvt_img *img, double factor); }; #endif