1 |
root |
1.1 |
#include "../config.h" |
2 |
|
|
#include "rxvt.h" |
3 |
|
|
|
4 |
|
|
#if HAVE_IMG |
5 |
|
|
|
6 |
root |
1.3 |
rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height) |
7 |
|
|
: s(screen), w(width), h(height), format(format) |
8 |
root |
1.1 |
{ |
9 |
root |
1.3 |
pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth); |
10 |
root |
1.1 |
} |
11 |
|
|
|
12 |
root |
1.3 |
rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap) |
13 |
|
|
: s(screen), pm(pixmap), w(width), h(height), format(format) |
14 |
root |
1.1 |
{ |
15 |
|
|
} |
16 |
|
|
|
17 |
|
|
rxvt_img::~rxvt_img () |
18 |
|
|
{ |
19 |
|
|
if (pm) |
20 |
|
|
XFreePixmap (s->display->dpy, pm); |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
void |
24 |
|
|
rxvt_img::fill (const rxvt_color &c) |
25 |
|
|
{ |
26 |
|
|
XGCValues gcv; |
27 |
|
|
gcv.foreground = c; |
28 |
|
|
GC gc = XCreateGC (s->display->dpy, pm, GCForeground, &gcv); |
29 |
|
|
XFillRectangle (s->display->dpy, pm, gc, 0, 0, w, h); |
30 |
root |
1.3 |
XFreeGC (s->display->dpy, gc); |
31 |
root |
1.1 |
} |
32 |
|
|
|
33 |
root |
1.3 |
void |
34 |
|
|
rxvt_img::blur (int rh, int rv) |
35 |
|
|
{ |
36 |
|
|
//TODO |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
void |
40 |
|
|
rxvt_img::brightness (double r, double g, double b, double a) |
41 |
|
|
{ |
42 |
|
|
//TODO |
43 |
|
|
} |
44 |
|
|
|
45 |
|
|
void |
46 |
|
|
rxvt_img::contrast (double r, double g, double b, double a) |
47 |
root |
1.1 |
{ |
48 |
root |
1.3 |
//TODO |
49 |
root |
1.1 |
} |
50 |
|
|
|
51 |
root |
1.3 |
void |
52 |
|
|
rxvt_img::render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y) |
53 |
|
|
{ |
54 |
|
|
//TODO |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
rxvt_img * |
58 |
|
|
rxvt_img::copy () |
59 |
|
|
{ |
60 |
|
|
GC gc = XCreateGC (s->display->dpy, pm, 0, 0); |
61 |
|
|
Pixmap pm2 = XCreatePixmap (s->display->dpy, pm, w, h, format->depth); |
62 |
|
|
XCopyArea (s->display->dpy, pm, pm2, gc, 0, 0, w, h, 0, 0); |
63 |
|
|
XFreeGC (s->display->dpy, gc); |
64 |
|
|
return new rxvt_img (s, format, w, h, pm2); |
65 |
|
|
} |
66 |
|
|
|
67 |
|
|
rxvt_img * |
68 |
|
|
rxvt_img::transform (int new_width, int new_height, double matrix[16]) |
69 |
|
|
{ |
70 |
|
|
//TODO |
71 |
|
|
} |
72 |
|
|
|
73 |
|
|
rxvt_img * |
74 |
|
|
rxvt_img::scale (int new_width, int new_height) |
75 |
|
|
{ |
76 |
|
|
// use transform |
77 |
|
|
//TODO |
78 |
|
|
} |
79 |
|
|
|
80 |
|
|
|
81 |
root |
1.1 |
#endif |
82 |
|
|
|