-- 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: 3752861d51de1eb81e7da5e93dab23975139385f: path_to: revision_to:
commit 3752861d51de1eb81e7da5e93dab23975139385f Author: Emanuele Giaquinta <emanuele.giaquinta@gmail.com> Date: Tue Jun 5 18:52:48 2012 +0000 Add rxvt_img::blend method. diff --git a/src/rxvtimg.C b/src/rxvtimg.C
--- a/src/rxvtimg.C +++ b/src/rxvtimg.C @@ -453,5 +453,31 @@ rxvt_img::convert_to (XRenderPictFormat *new_format) return img; } +rxvt_img * +rxvt_img::blend (rxvt_img *img, double factor) +{ + rxvt_img *img2 = clone (); + Display *dpy = s->display->dpy; + Picture src = XRenderCreatePicture (dpy, img->pm, img->format, 0, 0); + Picture dst = XRenderCreatePicture (dpy, img2->pm, img2->format, 0, 0); + Picture mask = create_xrender_mask (dpy, img->pm, False); + + XRenderColor mask_c; + + mask_c.alpha = float_to_component (factor); + mask_c.red = + mask_c.green = + mask_c.blue = 0; + XRenderFillRectangle (dpy, PictOpSrc, mask, &mask_c, 0, 0, 1, 1); + + XRenderComposite (dpy, PictOpOver, src, mask, dst, 0, 0, 0, 0, 0, 0, w, h); + + XRenderFreePicture (dpy, src); + XRenderFreePicture (dpy, dst); + XRenderFreePicture (dpy, mask); + + return img2; +} + #endif diff --git a/src/rxvtimg.h b/src/rxvtimg.h
--- a/src/rxvtimg.h +++ b/src/rxvtimg.h @@ -45,6 +45,7 @@ struct rxvt_img rxvt_img *scale (int new_width, int new_height); rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi, int repeat = RepeatNormal); rxvt_img *convert_to (XRenderPictFormat *format); + rxvt_img *blend (rxvt_img *img, double factor); }; #endif
-----END OF PAGE-----
-- Response ended
-- Page fetched on Sun Jun 2 10:02:41 2024