repo: rxvt-unicode-sixel
action: commit
revision: 
path_from: 
revision_from: 53d5733d3787a0ac82b014253a9515f9be33b1f9:
path_to: 
revision_to: 
git.thebackupbox.net
rxvt-unicode-sixel
git clone git://git.thebackupbox.net/rxvt-unicode-sixel
commit 53d5733d3787a0ac82b014253a9515f9be33b1f9
Author: Marc Lehmann 
Date:   Mon Jun 4 18:17:25 2012 +0000

    *** empty log message ***

diff --git a/src/rxvtimg.C b/src/rxvtimg.C
index c9474ddbfbe706e09361f5b0c1ecc232463db733..
index ..487781e2de5a48a0c5a027376b4b70f2a3553239 100644
--- 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
index 41cf79c53799ec0c0437ff4ebc2f85d001d7386b..
index ..4307d07e23c3e9b5955d6873e3ea0325f9951861 100644
--- 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
index 64953b825375c410c0ded556d5a9abc8dd244031..
index ..f8668f7b03cdaf9b4fd05d1517854aecc088306d 100644
--- 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-----