… | |
… | |
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 | |
10 | #define float_to_component(d) ((d) * 65535.99) |
10 | #define float_to_component(d) (uint16_t)((d) * 65535.99) |
11 | |
11 | |
12 | #include <X11/extensions/Xrender.h> |
12 | #include <X11/extensions/Xrender.h> |
13 | |
13 | |
14 | class rxvt_img |
14 | class rxvt_img |
15 | { |
15 | { |
… | |
… | |
64 | this->repeat = repeat; |
64 | this->repeat = repeat; |
65 | } |
65 | } |
66 | |
66 | |
67 | void unshare (); // prepare for write |
67 | void unshare (); // prepare for write |
68 | void fill (const rxvt_color &c); |
68 | void fill (const rxvt_color &c); |
69 | void brightness (unsigned short r, unsigned short g, unsigned short b, unsigned short a); |
69 | //void linear_gradient (const XLinearGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); |
70 | void contrast (unsigned short r, unsigned short g, unsigned short b, unsigned short a); |
70 | //void radial_gradient (const XRadialGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); |
|
|
71 | //void conical_gradient (const XConicalGradient *gradient, const XFixed *stops, const XRenderColor *colors, int nstops); |
|
|
72 | void brightness (uint16_t r, uint16_t g, uint16_t b, uint16_t a); |
|
|
73 | void contrast (uint16_t r, uint16_t g, uint16_t b, uint16_t a); |
71 | |
74 | |
72 | void brightness (double r, double g, double b, double a = 1.) |
75 | void brightness (double r, double g, double b, double a = 1.) |
73 | { |
76 | { |
74 | brightness (float_to_component (r), |
77 | brightness (float_to_component (r), |
75 | float_to_component (g), |
78 | float_to_component (g), |