… | |
… | |
12 | struct rxvt_img |
12 | struct rxvt_img |
13 | { |
13 | { |
14 | rxvt_screen *s; |
14 | rxvt_screen *s; |
15 | Pixmap pm; |
15 | Pixmap pm; |
16 | int w, h; |
16 | int w, h; |
17 | int depth; |
|
|
18 | XRenderPictFormat *format; |
17 | XRenderPictFormat *format; |
|
|
18 | bool shared; // true if we don't own it |
19 | |
19 | |
20 | rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height); |
20 | rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height); |
21 | rxvt_img (rxvt_screen *screen, Pixmap *pixmap, XRenderPictFormat *format, int width, int height); |
21 | rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
|
|
22 | static rxvt_img *new_from_root (rxvt_screen *s); // get root pixmap |
|
|
23 | static rxvt_img *new_from_file (rxvt_screen *s, const char *filename); // from pixbuf |
|
|
24 | |
22 | ~rxvt_img (); |
25 | ~rxvt_img (); |
23 | |
|
|
24 | void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
|
|
25 | |
26 | |
26 | Pixmap steal () |
27 | Pixmap steal () |
27 | { |
28 | { |
28 | Pixmap res = pm; |
29 | shared = true; |
29 | pm = 0; |
|
|
30 | return res; |
30 | return pm; |
31 | } |
31 | } |
32 | |
32 | |
33 | // inplace |
33 | // inplace |
34 | void fill (const rxvt_color &c); |
34 | void fill (const rxvt_color &c); |
35 | void blur (int rh, int rv); |
35 | void blur (int rh, int rv); |
36 | void brightness (double r, double g, double b, double a = 1.); |
36 | void brightness (double r, double g, double b, double a = 1.); |
37 | void contrast (double r, double g, double b, double a = 1.); |
37 | void contrast (double r, double g, double b, double a = 1.); |
|
|
38 | void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
38 | |
39 | |
39 | // copy |
40 | // copy |
40 | rxvt_img *copy (); |
41 | rxvt_img *copy (); |
41 | rxvt_img *scale (int new_width, int new_height); |
42 | rxvt_img *scale (int new_width, int new_height); |
42 | rxvt_img *transform (int new_width, int new_height, double matrix[16]); |
43 | rxvt_img *transform (int new_width, int new_height, double matrix[16]); |
|
|
44 | rxvt_img *convert_to (XRenderPictFormat *format); |
43 | }; |
45 | }; |
44 | |
46 | |
45 | #endif |
47 | #endif |
46 | |
48 | |
47 | #endif |
49 | #endif |