--- rxvt-unicode/src/rxvtimg.C 2012/06/04 15:53:12 1.14 +++ rxvt-unicode/src/rxvtimg.C 2012/06/04 18:17:25 1.17 @@ -103,7 +103,7 @@ XRenderPictureAttributes pa; pa.repeat = RepeatPad; - Picture src = XRenderCreatePicture (dpy, pm, format, CPRepeat, &pa); + Picture src = XRenderCreatePicture (dpy, pm , format, CPRepeat, &pa); Pixmap tmp = XCreatePixmap (dpy, pm, w, h, format->depth); Picture dst = XRenderCreatePicture (dpy, tmp, format, CPRepeat, &pa); XFreePixmap (dpy, tmp); @@ -270,6 +270,7 @@ { //pix_colors[Color_bg].get (c); //TODO + c.r = 0xffff; c.g = 0xc0c0; c.b = 0xcbcb;//D c.r >>= 8; c.g >>= 8; c.b >>= 8; @@ -347,6 +348,7 @@ for (int j = 0; j < 3; ++j) xfrm.matrix [i][j] = XDoubleToFixed (matrix [i * 3 + j]); + XRenderSetPictureFilter (dpy, src, "good", 0, 0); XRenderSetPictureTransform (dpy, src, &xfrm); XRenderComposite (dpy, PictOpSrc, src, None, dst, 0, 0, 0, 0, 0, 0, new_width, new_height); @@ -360,8 +362,8 @@ rxvt_img::scale (int new_width, int new_height) { double matrix[9] = { - new_width / (double)w, 0, 0, - 0, new_height / (double)h, 0, + w / (double)new_width, 0, 0, + 0, h / (double)new_height, 0, 0, 0, 1 }; @@ -369,6 +371,21 @@ } rxvt_img * +rxvt_img::rotate (int new_width, int new_height, int repeat, int x, int y, double phi) +{ + double s = sin (phi); + double c = cos (phi); + + double matrix[9] = { + c, -s, -c * x + s * y + x, + s, c, -s * x - c * y + y, + 0, 0, 1 + }; + + return transform (new_width, new_height, repeat, matrix); +} + +rxvt_img * rxvt_img::convert_to (XRenderPictFormat *new_format) { rxvt_img *img = new rxvt_img (s, new_format, w, h);