ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtimg.C
(Generate patch)

Comparing rxvt-unicode/src/rxvtimg.C (file contents):
Revision 1.2 by root, Sun Jun 3 10:01:32 2012 UTC vs.
Revision 1.3 by root, Sun Jun 3 10:14:44 2012 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines