repo: rxvt-unicode-sixel action: commit revision: path_from: revision_from: 53d5733d3787a0ac82b014253a9515f9be33b1f9: path_to: revision_to:
commit 53d5733d3787a0ac82b014253a9515f9be33b1f9 Author: Marc LehmannDate: Mon Jun 4 18:17:25 2012 +0000 *** empty log message *** diff --git a/src/rxvtimg.C b/src/rxvtimg.C
--- a/src/rxvtimg.C
+++ b/src/rxvtimg.C
@@ -103,7 +103,7 @@ rxvt_img::blur (int rh, int rv)
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);
@@ -348,6 +348,7 @@ rxvt_img::transform (int new_width, int new_height, int repeat, double matrix[9]
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);
@@ -369,6 +370,21 @@ rxvt_img::scale (int new_width, int new_height)
return transform (new_width, new_height, RepeatNormal, matrix);
}
+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)
{
diff --git a/src/rxvtimg.h b/src/rxvtimg.h
--- a/src/rxvtimg.h +++ b/src/rxvtimg.h @@ -40,8 +40,9 @@ struct rxvt_img // copy rxvt_img *clone (); - rxvt_img *scale (int new_width, int new_height); rxvt_img *transform (int new_width, int new_height, int repeat, double matrix[9]); + rxvt_img *scale (int new_width, int new_height); + rxvt_img *rotate (int new_width, int new_height, int repeat, int x, int y, double phi); rxvt_img *convert_to (XRenderPictFormat *format); }; diff --git a/src/rxvtperl.xs b/src/rxvtperl.xs
--- a/src/rxvtperl.xs
+++ b/src/rxvtperl.xs
@@ -2098,9 +2098,6 @@ rxvt_img::unshare ()
rxvt_img *
rxvt_img::clone ()
-rxvt_img *
-rxvt_img::scale (int new_width, int new_height)
-
rxvt_img *
rxvt_img::transform (int new_width, int new_height, int repeat, NV p11, NV p12, NV p13, NV p21, NV p22, NV p23, NV p31, NV p32, NV p33)
INIT:
@@ -2111,5 +2108,11 @@ rxvt_img::transform (int new_width, int new_height, int repeat, NV p11, NV p12,
};
C_ARGS: new_width, new_height, repeat, matrix
+rxvt_img *
+rxvt_img::scale (int new_width, int new_height)
+
+rxvt_img *
+rxvt_img::rotate (int new_width, int new_height, int repeat, int x, int y, NV phi)
+
#endif
-----END OF PAGE-----