--- rxvt-unicode/src/rxvtimg.h 2012/06/03 09:59:58 1.1 +++ rxvt-unicode/src/rxvtimg.h 2012/06/03 20:34:25 1.7 @@ -14,20 +14,20 @@ rxvt_screen *s; Pixmap pm; int w, h; - int depth; 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, Pixmap *pixmap, XRenderPictFormat *format, int width, int height); - ~rxvt_img (); + 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 (rxvt_screen *s, const char *filename); // from pixbuf - void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); + ~rxvt_img (); Pixmap steal () { - Pixmap res = pm; - pm = 0; - return res; + shared = true; + return pm; } // inplace @@ -35,11 +35,13 @@ 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); // copy rxvt_img *copy (); rxvt_img *scale (int new_width, int new_height); rxvt_img *transform (int new_width, int new_height, double matrix[16]); + rxvt_img *convert_to (XRenderPictFormat *format); }; #endif