ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/rxvtimg.h
Revision: 1.6
Committed: Sun Jun 3 18:14:13 2012 UTC (11 years, 11 months ago) by root
Content type: text/plain
Branch: MAIN
Changes since 1.5: +4 -4 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #ifndef IMG_H
2     #define IMG_H
3    
4     #if defined HAVE_BG_PIXMAP && defined BG_IMAGE_FROM_FILE && defined ENABLE_TRANSPARENCY && defined HAVE_PIXBUF
5     #define HAVE_IMG 1
6     #endif
7    
8     #if HAVE_IMG
9    
10     #include <X11/extensions/Xrender.h>
11    
12     struct rxvt_img
13     {
14     rxvt_screen *s;
15     Pixmap pm;
16     int w, h;
17     XRenderPictFormat *format;
18 root 1.6 bool shared; // true if we don't own it
19 root 1.1
20     rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height);
21 root 1.3 rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap);
22 root 1.5 static rxvt_img *new_from_root (rxvt_screen *s); // get root pixmap
23 root 1.6 static rxvt_img *new_from_file (rxvt_screen *s, const char *filename); // from pixbuf
24 root 1.4
25 root 1.1 ~rxvt_img ();
26    
27     Pixmap steal ()
28     {
29 root 1.6 shared = true;
30     return pm;
31 root 1.1 }
32    
33     // inplace
34     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.);
37     void contrast (double r, double g, double b, double a = 1.);
38 root 1.3 void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y);
39 root 1.1
40     // copy
41     rxvt_img *copy ();
42     rxvt_img *scale (int new_width, int new_height);
43     rxvt_img *transform (int new_width, int new_height, double matrix[16]);
44     };
45    
46     #endif
47    
48     #endif
49