-- Leo's gemini proxy

-- Connecting to git.thebackupbox.net:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini

repo: rxvt-unicode-sixel
action: commit
revision:
path_from:
revision_from: ba65d26c58a4fc56d4c227157a4d01c99bd3a026:
path_to:
revision_to:

git.thebackupbox.net

rxvt-unicode-sixel

git://git.thebackupbox.net/rxvt-unicode-sixel

commit ba65d26c58a4fc56d4c227157a4d01c99bd3a026
Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com>
Date:   Sun Dec 25 17:05:53 2011 +0000

    Rename shade_ximage to tint_ximage and change it to a method.

diff --git a/src/background.C b/src/background.C

index 17c75ba49e0da78234270c9ae4fdec9033ef044e..

index ..5696913bc101a27c8ce42c083ba48d74b55db1ea 100644

--- a/src/background.C
+++ b/src/background.C
@@ -1329,10 +1329,6 @@ rxvt_term::bg_set_root_pixmap ()
 }
 # endif /* ENABLE_TRANSPARENCY */

-#if defined(ENABLE_TRANSPARENCY) && !defined(HAVE_AFTERIMAGE)
-static void shade_ximage (Visual *visual, XImage *ximage, int shade, const rgba &c);
-# endif
-
 bool
 rxvt_term::bg_render ()
 {
@@ -1372,12 +1368,7 @@ rxvt_term::bg_render ()
       /* our own client-side tinting */
       //if (tr_flags & BG_NEEDS_TINT)
       if (1)
-        {
-          rgba c (rgba::MAX_CC,rgba::MAX_CC,rgba::MAX_CC);
-          if (bg_flags & BG_TINT_SET)
-            tint.get (c);
-          shade_ximage (DefaultVisual (dpy, display->screen), result, shade, c);
-        }
+        tint_ximage (DefaultVisual (dpy, display->screen), result);

       GC gc = XCreateGC (dpy, vt, 0UL, NULL);

@@ -1450,8 +1441,8 @@ fill_lut (uint32_t *lookup, uint32_t mask, int sh, unsigned short low, unsigned
     }
 }

-static void
-shade_ximage (Visual *visual, XImage *ximage, int shade, const rgba &c)
+void
+rxvt_term::tint_ximage (Visual *visual, XImage *ximage)
 {
   int sh_r, sh_g, sh_b;
   uint32_t mask_r, mask_g, mask_b;
@@ -1526,16 +1517,19 @@ shade_ximage (Visual *visual, XImage *ximage, int shade, const rgba &c)
         return; /* we do not support this color depth */
     }

+  rgba c (rgba::MAX_CC, rgba::MAX_CC, rgba::MAX_CC);
+
+  if (bg_flags & BG_TINT_SET)
+    tint.get (c);
+
   /* prepare limits for color transformation (each channel is handled separately) */
   if (shade > 100)
     {
-      shade = 200 - shade;
-
-      high.r = c.r * shade / 100;
-      high.g = c.g * shade / 100;
-      high.b = c.b * shade / 100;
+      high.r = c.r * (200 - shade) / 100;
+      high.g = c.g * (200 - shade) / 100;
+      high.b = c.b * (200 - shade) / 100;

-      low = 0xffff * (100 - shade) / 100;
+      low = 0xffff * (shade - 100) / 100;
     }
   else
     {
diff --git a/src/rxvt.h b/src/rxvt.h

index b89120c61496d2e013bd94187ca1111081ea8a08..

index ..49b9a3f120bdde1ab0e2ff002a274b713fbbdbd5 100644

--- a/src/rxvt.h
+++ b/src/rxvt.h
@@ -1163,6 +1163,7 @@ struct rxvt_term : zero_initialized, rxvt_vars, rxvt_screen

   bool blur_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
   bool tint_pixmap (Pixmap pixmap, Visual *visual, int width, int height);
+  void tint_ximage (Visual *visual, XImage *ximage);
   unsigned long make_transparency_pixmap ();
 # endif

-----END OF PAGE-----

-- Response ended

-- Page fetched on Sun Jun 2 10:58:35 2024