| 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 |
|
|
|
| 19 |
|
|
rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height); |
| 20 |
|
|
rxvt_img (rxvt_screen *screen, Pixmap *pixmap, XRenderPictFormat *format, int width, int height); |
| 21 |
|
|
~rxvt_img (); |
| 22 |
|
|
|
| 23 |
|
|
void render (GdkPixbuf *pixbuf, int src_x, int src_y, int width, int height, int dst_x, int dst_y); |
| 24 |
|
|
|
| 25 |
|
|
Pixmap steal () |
| 26 |
|
|
{ |
| 27 |
|
|
Pixmap res = pm; |
| 28 |
|
|
pm = 0; |
| 29 |
|
|
return res; |
| 30 |
|
|
} |
| 31 |
|
|
|
| 32 |
|
|
// inplace |
| 33 |
|
|
void fill (const rxvt_color &c); |
| 34 |
|
|
void blur (int rh, int rv); |
| 35 |
|
|
void brightness (double r, double g, double b, double a = 1.); |
| 36 |
|
|
void contrast (double r, double g, double b, double a = 1.); |
| 37 |
|
|
|
| 38 |
|
|
// copy |
| 39 |
|
|
rxvt_img *copy (); |
| 40 |
|
|
rxvt_img *scale (int new_width, int new_height); |
| 41 |
|
|
rxvt_img *transform (int new_width, int new_height, double matrix[16]); |
| 42 |
|
|
}; |
| 43 |
|
|
|
| 44 |
|
|
#endif |
| 45 |
|
|
|
| 46 |
|
|
#endif |
| 47 |
|
|
|