… | |
… | |
4 | #if HAVE_BG_PIXMAP && BG_IMAGE_FROM_FILE && ENABLE_TRANSPARENCY && HAVE_PIXBUF |
4 | #if HAVE_BG_PIXMAP && BG_IMAGE_FROM_FILE && ENABLE_TRANSPARENCY && HAVE_PIXBUF |
5 | #define HAVE_IMG 1 |
5 | #define HAVE_IMG 1 |
6 | #endif |
6 | #endif |
7 | |
7 | |
8 | #if HAVE_IMG |
8 | #if HAVE_IMG |
|
|
9 | |
|
|
10 | #define float_to_component(d) ((d) * 65535.99) |
9 | |
11 | |
10 | #include <X11/extensions/Xrender.h> |
12 | #include <X11/extensions/Xrender.h> |
11 | |
13 | |
12 | struct rxvt_img |
14 | struct rxvt_img |
13 | { |
15 | { |
… | |
… | |
42 | this->repeat = repeat; |
44 | this->repeat = repeat; |
43 | } |
45 | } |
44 | |
46 | |
45 | void unshare (); // create a copy of the pixmap if !shared |
47 | void unshare (); // create a copy of the pixmap if !shared |
46 | void fill (const rxvt_color &c); |
48 | void fill (const rxvt_color &c); |
|
|
49 | void brightness (unsigned short r, unsigned short g, unsigned short b, unsigned short a); |
|
|
50 | void contrast (unsigned short r, unsigned short g, unsigned short b, unsigned short a); |
|
|
51 | |
47 | void brightness (double r, double g, double b, double a = 1.); |
52 | void brightness (double r, double g, double b, double a = 1.) |
|
|
53 | { |
|
|
54 | brightness (float_to_component (r), |
|
|
55 | float_to_component (g), |
|
|
56 | float_to_component (b), |
|
|
57 | float_to_component (a)); |
|
|
58 | } |
|
|
59 | |
48 | void contrast (double r, double g, double b, double a = 1.); |
60 | void contrast (double r, double g, double b, double a = 1.) |
|
|
61 | { |
|
|
62 | contrast (float_to_component (r), |
|
|
63 | float_to_component (g), |
|
|
64 | float_to_component (b), |
|
|
65 | float_to_component (a)); |
|
|
66 | } |
|
|
67 | |
49 | bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
68 | bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
50 | |
69 | |
51 | // copy |
70 | // copy |
52 | rxvt_img *blur (int rh, int rv); |
71 | rxvt_img *blur (int rh, int rv); |
53 | rxvt_img *clone (); |
72 | rxvt_img *clone (); |