--- rxvt-unicode/src/rxvtimg.C 2012/06/03 18:49:55 1.6 +++ rxvt-unicode/src/rxvtimg.C 2012/06/04 06:59:50 1.10 @@ -215,6 +215,22 @@ //TODO } +rxvt_img * +rxvt_img::convert_to (XRenderPictFormat *new_format) +{ + rxvt_img *img = new rxvt_img (s, new_format, w, h); + + Display *dpy = s->display->dpy; + Picture src = XRenderCreatePicture (dpy, pm, format, 0, 0); + Picture dst = XRenderCreatePicture (dpy, img->pm, new_format, 0, 0); + + XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, w, h); + + XRenderFreePicture (dpy, src); + XRenderFreePicture (dpy, dst); + + return img; +} #endif