ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtimg.C
Revision: 1.3
Committed: Sun Jun 3 10:14:44 2012 UTC (11 years, 11 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.2: +51 -9 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #include "../config.h"
2 #include "rxvt.h"
3
4 #if HAVE_IMG
5
6 rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height)
7 : s(screen), w(width), h(height), format(format)
8 {
9 pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth);
10 }
11
12 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 {
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 XFreeGC (s->display->dpy, gc);
31 }
32
33 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 {
48 //TODO
49 }
50
51 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 #endif
82