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

Comparing rxvt-unicode/src/rxvtimg.C (file contents):
Revision 1.24 by sf-exg, Tue Jun 5 18:52:48 2012 UTC vs.
Revision 1.25 by sf-exg, Tue Jun 5 22:00:15 2012 UTC

292 int rowstride = gdk_pixbuf_get_rowstride (pixbuf); 292 int rowstride = gdk_pixbuf_get_rowstride (pixbuf);
293 int channels = gdk_pixbuf_get_n_channels (pixbuf); 293 int channels = gdk_pixbuf_get_n_channels (pixbuf);
294 unsigned char *row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels; 294 unsigned char *row = gdk_pixbuf_get_pixels (pixbuf) + src_y * rowstride + src_x * channels;
295 char *line = ximage->data; 295 char *line = ximage->data;
296 296
297 rgba c (0, 0, 0);
298
299 if (channels == 4 && alpha_mask == 0)
300 {
301 //pix_colors[Color_bg].get (c);
302 //TODO
303 c.r = 0xffff; c.g = 0xc0c0; c.b = 0xcbcb;//D
304 c.r >>= 8;
305 c.g >>= 8;
306 c.b >>= 8;
307 }
308
309 for (int y = 0; y < height; y++) 297 for (int y = 0; y < height; y++)
310 { 298 {
311 for (int x = 0; x < width; x++) 299 for (int x = 0; x < width; x++)
312 { 300 {
313 unsigned char *pixel = row + x * channels; 301 unsigned char *pixel = row + x * channels;
315 unsigned char r, g, b, a; 303 unsigned char r, g, b, a;
316 304
317 if (channels == 4) 305 if (channels == 4)
318 { 306 {
319 a = pixel[3]; 307 a = pixel[3];
320 r = (pixel[0] * a + c.r * (0xff - a)) / 0xff; 308 r = pixel[0] * a / 0xff;
321 g = (pixel[1] * a + c.g * (0xff - a)) / 0xff; 309 g = pixel[1] * a / 0xff;
322 b = (pixel[2] * a + c.b * (0xff - a)) / 0xff; 310 b = pixel[2] * a / 0xff;
323 } 311 }
324 else 312 else
325 { 313 {
326 a = 0xff; 314 a = 0xff;
327 r = pixel[0]; 315 r = pixel[0];

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines