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

Comparing rxvt-unicode/src/rxvtimg.h (file contents):
Revision 1.1 by root, Sun Jun 3 09:59:58 2012 UTC vs.
Revision 1.15 by root, Wed Jun 6 22:01:44 2012 UTC

1#ifndef IMG_H 1#ifndef IMG_H
2#define IMG_H 2#define IMG_H
3 3
4#if defined HAVE_BG_PIXMAP && defined BG_IMAGE_FROM_FILE && defined ENABLE_TRANSPARENCY && defined HAVE_PIXBUF 4#if HAVE_BG_PIXMAP && BG_IMAGE_FROM_FILE && ENABLE_TRANSPARENCY && HAVE_PIXBUF
5 #define HAVE_IMG 1 5 #define HAVE_IMG 1
6#endif 6#endif
7 7
8#if HAVE_IMG 8#if HAVE_IMG
9 9
11 11
12struct rxvt_img 12struct 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 int depth;
18 XRenderPictFormat *format; 17 XRenderPictFormat *format;
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, Pixmap *pixmap, XRenderPictFormat *format, int width, int height); 21 rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap);
22 static rxvt_img *new_from_root (rxvt_screen *s); // get root pixmap
23 static rxvt_img *new_from_file (rxvt_screen *s, const char *filename); // from pixbuf
24
22 ~rxvt_img (); 25 ~rxvt_img ();
23
24 void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y);
25 26
26 Pixmap steal () 27 Pixmap steal ()
27 { 28 {
28 Pixmap res = pm; 29 shared = true;
29 pm = 0;
30 return res; 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
45 void unshare (); // create a copy of the pixmap if !shared
34 void fill (const rxvt_color &c); 46 void fill (const rxvt_color &c);
35 void blur (int rh, int rv);
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.);
49 bool render_pixbuf (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y);
38 50
39 // copy 51 // copy
52 rxvt_img *blur (int rh, int rv);
40 rxvt_img *copy (); 53 rxvt_img *clone ();
54 rxvt_img *sub_rect (int x, int y, int width, int height);
55 rxvt_img *transform (int new_width, int new_height, double matrix[9]);
41 rxvt_img *scale (int new_width, int new_height); 56 rxvt_img *scale (int new_width, int new_height);
42 rxvt_img *transform (int new_width, int new_height, double matrix[16]); 57 rxvt_img *rotate (int new_width, int new_height, int x, int y, double phi);
58 rxvt_img *convert_to (XRenderPictFormat *format, const rxvt_color &bg);
59 rxvt_img *blend (rxvt_img *img, double factor);
43}; 60};
44 61
45#endif 62#endif
46 63
47#endif 64#endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines