… | |
… | |
11 | |
11 | |
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 x, y, w, h, repeat; |
17 | XRenderPictFormat *format; |
17 | XRenderPictFormat *format; |
18 | bool shared; // true if we don't own it |
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, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
21 | rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap); |
… | |
… | |
29 | shared = true; |
29 | shared = true; |
30 | return pm; |
30 | return pm; |
31 | } |
31 | } |
32 | |
32 | |
33 | // inplace |
33 | // inplace |
|
|
34 | void move (int dx, int dy) |
|
|
35 | { |
|
|
36 | x += dx; |
|
|
37 | y += dy; |
|
|
38 | } |
|
|
39 | |
|
|
40 | void repeat_mode (int repeat) |
|
|
41 | { |
|
|
42 | this->repeat = repeat; |
|
|
43 | } |
|
|
44 | |
34 | void unshare (); // create a copy of the pixmap if !shared |
45 | void unshare (); // create a copy of the pixmap if !shared |
35 | void fill (const rxvt_color &c); |
46 | void fill (const rxvt_color &c); |
36 | void brightness (double r, double g, double b, double a = 1.); |
47 | void brightness (double r, double g, double b, double a = 1.); |
37 | void contrast (double r, double g, double b, double a = 1.); |
48 | void contrast (double r, double g, double b, double a = 1.); |
38 | bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
49 | bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
39 | |
50 | |
40 | // copy |
51 | // copy |
41 | rxvt_img *blur (int rh, int rv); |
52 | rxvt_img *blur (int rh, int rv); |
42 | rxvt_img *clone (); |
53 | rxvt_img *clone (); |
43 | rxvt_img *sub_rect (int x, int y, int width, int height, int repeat = RepeatNormal); |
54 | rxvt_img *sub_rect (int x, int y, int width, int height); |
44 | rxvt_img *transform (int new_width, int new_height, double matrix[9], int repeat = RepeatNormal); |
55 | rxvt_img *transform (int new_width, int new_height, double matrix[9]); |
45 | rxvt_img *scale (int new_width, int new_height); |
56 | rxvt_img *scale (int new_width, int new_height); |
46 | rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi, int repeat = RepeatNormal); |
57 | rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi); |
47 | rxvt_img *convert_to (XRenderPictFormat *format, const rxvt_color &bg); |
58 | rxvt_img *convert_to (XRenderPictFormat *format, const rxvt_color &bg); |
48 | rxvt_img *blend (rxvt_img *img, double factor); |
59 | rxvt_img *blend (rxvt_img *img, double factor); |
49 | }; |
60 | }; |
50 | |
61 | |
51 | #endif |
62 | #endif |