… | |
… | |
9 | |
9 | |
10 | #define float_to_component(d) (int32_t)((d) * 65535.99) |
10 | #define float_to_component(d) (int32_t)((d) * 65535.99) |
11 | |
11 | |
12 | #include <X11/extensions/Xrender.h> |
12 | #include <X11/extensions/Xrender.h> |
13 | |
13 | |
14 | class rxvt_img |
14 | struct rxvt_img |
15 | { |
15 | { |
16 | void destroy (); |
|
|
17 | Picture picture (); |
|
|
18 | |
|
|
19 | public: |
|
|
20 | typedef double nv; |
16 | typedef double nv; |
21 | |
17 | |
22 | // *could* also hold the Pixmap itself |
18 | // *could* also hold the Pixmap itself |
23 | struct pixref |
19 | struct pixref |
24 | { |
20 | { |
… | |
… | |
92 | float_to_component (b), |
88 | float_to_component (b), |
93 | float_to_component (a)); |
89 | float_to_component (a)); |
94 | } |
90 | } |
95 | |
91 | |
96 | void draw (rxvt_img *img, int op = PictOpOver, nv mask = 1.); |
92 | void draw (rxvt_img *img, int op = PictOpOver, nv mask = 1.); |
|
|
93 | #if 0 |
|
|
94 | void draw (rxvt_img *img, int op = PictOpOver, nv mask = 1., |
|
|
95 | nv px, nv py, nv qx, nv qy, nv rx, nv ry, nv sx, nv sy); |
|
|
96 | #endif |
97 | |
97 | |
98 | // copy |
98 | // copy |
99 | rxvt_img *reify (); // make x, y 0, make real width/height |
99 | rxvt_img *reify (); // make x, y 0, make real width/height |
100 | rxvt_img *blur (int rh, int rv); |
100 | rxvt_img *blur (int rh, int rv); |
101 | rxvt_img *clone (); |
101 | rxvt_img *clone (); |
102 | rxvt_img *sub_rect (int x, int y, int width, int height); |
102 | rxvt_img *sub_rect (int x, int y, int width, int height); |
103 | rxvt_img *transform (nv matrix[3][3]); |
103 | rxvt_img *transform (const nv matrix[3][3]); |
104 | rxvt_img *scale (int new_width, int new_height); |
104 | rxvt_img *scale (int new_width, int new_height); |
105 | rxvt_img *rotate (int cx, int cy, nv phi); |
105 | rxvt_img *rotate (int cx, int cy, nv phi); |
106 | rxvt_img *convert_format (XRenderPictFormat *format, const rgba &bg); |
106 | rxvt_img *convert_format (XRenderPictFormat *format, const rgba &bg); |
107 | rxvt_img *blend (rxvt_img *img, nv factor = 1.); |
107 | rxvt_img *blend (rxvt_img *img, nv factor = 1.); |
108 | |
108 | |
… | |
… | |
111 | { |
111 | { |
112 | delete p; |
112 | delete p; |
113 | p = this; |
113 | p = this; |
114 | return this; |
114 | return this; |
115 | } |
115 | } |
|
|
116 | |
|
|
117 | private: |
|
|
118 | |
|
|
119 | void destroy (); |
|
|
120 | Picture picture (); |
|
|
121 | rxvt_img *transform (const nv *matrix); |
116 | }; |
122 | }; |
117 | |
123 | |
118 | #endif |
124 | #endif |
119 | |
125 | |
120 | #endif |
126 | #endif |