… | |
… | |
476 | pm = pm2; |
476 | pm = pm2; |
477 | ref = new pixref (ref->w, ref->h); |
477 | ref = new pixref (ref->w, ref->h); |
478 | } |
478 | } |
479 | |
479 | |
480 | void |
480 | void |
481 | rxvt_img::fill (const rgba &c) |
481 | rxvt_img::fill (const rgba &c, int x, int y, int w, int h) |
482 | { |
482 | { |
483 | XRenderColor rc = { c.r, c.g, c.b, c.a }; |
483 | XRenderColor rc = { c.r, c.g, c.b, c.a }; |
484 | |
484 | |
485 | Display *dpy = s->dpy; |
485 | Display *dpy = s->dpy; |
486 | Picture src = picture (); |
486 | Picture src = picture (); |
487 | XRenderFillRectangle (dpy, PictOpSrc, src, &rc, 0, 0, w, h); |
487 | XRenderFillRectangle (dpy, PictOpSrc, src, &rc, x, y, w, h); |
488 | XRenderFreePicture (dpy, src); |
488 | XRenderFreePicture (dpy, src); |
|
|
489 | } |
|
|
490 | |
|
|
491 | void |
|
|
492 | rxvt_img::fill (const rgba &c) |
|
|
493 | { |
|
|
494 | fill (c, 0, 0, w, h); |
489 | } |
495 | } |
490 | |
496 | |
491 | void |
497 | void |
492 | rxvt_img::add_alpha () |
498 | rxvt_img::add_alpha () |
493 | { |
499 | { |
… | |
… | |
815 | } |
821 | } |
816 | |
822 | |
817 | rxvt_img * |
823 | rxvt_img * |
818 | rxvt_img::rotate (int cx, int cy, nv phi) |
824 | rxvt_img::rotate (int cx, int cy, nv phi) |
819 | { |
825 | { |
820 | #if 0 |
|
|
821 | { c, -s, cx - c * cx + s * cy }, |
|
|
822 | { s, c, cy - s * cx - c * cy }, |
|
|
823 | { 0, 0, 1 } |
|
|
824 | #endif |
|
|
825 | |
|
|
826 | move (-cx, -cy); |
826 | move (-cx, -cy); |
827 | rxvt_img *img = transform (mat3x3::rotate (phi)); |
827 | rxvt_img *img = transform (mat3x3::rotate (phi)); |
828 | move ( cx, cy); |
828 | move ( cx, cy); |
829 | img->move (cx, cy); |
829 | img->move (cx, cy); |
830 | |
830 | |
… | |
… | |
868 | } |
868 | } |
869 | |
869 | |
870 | rxvt_img * |
870 | rxvt_img * |
871 | rxvt_img::filter (const char *name, int nparams, nv *params) |
871 | rxvt_img::filter (const char *name, int nparams, nv *params) |
872 | { |
872 | { |
873 | rxvt_img *img = new_empty (); |
|
|
874 | |
|
|
875 | composer cc (img); |
873 | composer cc (this); |
876 | |
874 | |
877 | XFixed *xparams = rxvt_temp_buf<XFixed> (nparams); |
875 | XFixed *xparams = rxvt_temp_buf<XFixed> (nparams); |
878 | |
876 | |
879 | for (int i = 0; i < nparams; ++i) |
877 | for (int i = 0; i < nparams; ++i) |
880 | xparams [i] = XDoubleToFixed (params [i]); |
878 | xparams [i] = XDoubleToFixed (params [i]); |