added support for separate radii for vertical and horizontal blur in a form HxV
authorsasha <sasha>
Tue, 31 Jul 2007 22:24:36 +0000 (22:24 +0000)
committersasha <sasha>
Tue, 31 Jul 2007 22:24:36 +0000 (22:24 +0000)
src/xdefaults.C
src/xpm.C

index 6c1e61653ea5a900d8e42e766dc729f12e0415c4..e3c614345f3e1619eee1ee80a7104e25eddbabbc 100644 (file)
@@ -267,7 +267,7 @@ optList[] = {
 #endif
 #ifdef HAVE_AFTERIMAGE
               STRG (Rs_blendtype, "blendType", "blt", "string", "background image blending type - alpha, tint, etc..."),
-              STRG (Rs_blurradius, "blurRadius", "blr", "number", "Gaussian Blur radius to apply to the root background"),
+              STRG (Rs_blurradius, "blurRadius", "blr", "HxV", "Gaussian Blur radii to apply to the root background"),
 #endif
 #ifndef NO_RESOURCES
               INFO ("xrm", "string", "X resource"),
index 4b8bf5484c7963a8f166af5fee2c329bf1d30908..298c107a82b2ba6b20cedb1a3d6e88012c5b7446 100644 (file)
--- a/src/xpm.C
+++ b/src/xpm.C
@@ -954,10 +954,17 @@ rxvt_term::check_our_parents_cb (time_watcher &w)
 
               if (rs[Rs_blurradius] && back_im)
                 {
-                  double r = atof(rs[Rs_blurradius]);
-                  ASImage* tmp = blur_asimage_gauss (asv, back_im, r, r, 0xFFFFFFFF,
-                                                     (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
-                                                     100, ASIMAGE_QUALITY_DEFAULT);
+                  ASImage* tmp;
+                  int junk;
+                  unsigned int hr = 1, vr = 1;
+                  int flags = XParseGeometry (rs[Rs_blurradius], &junk, &junk, &hr, &vr);
+                  if (!(flags&WidthValue))
+                    hr = 1;
+                  if (!(flags&HeightValue))
+                    vr = hr;
+                  tmp = blur_asimage_gauss (asv, back_im, hr, vr, 0xFFFFFFFF,
+                                            (original_asim == NULL || tint == TINT_LEAVE_SAME)?ASA_XImage:ASA_ASImage,
+                                            100, ASIMAGE_QUALITY_DEFAULT);
                   if (tmp)
                     {
                       destroy_asimage (&back_im);