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.29 by root, Wed Jun 6 20:55:36 2012 UTC vs.
Revision 1.30 by root, Wed Jun 6 22:01:44 2012 UTC

5#if HAVE_IMG 5#if HAVE_IMG
6 6
7#define float_to_component(d) ((d) * 65535.99) 7#define float_to_component(d) ((d) * 65535.99)
8 8
9rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height) 9rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height)
10: s(screen), w(width), h(height), format(format), shared(false) 10: s(screen), x(0), y(0), w(width), h(height), format(format), repeat(RepeatNormal), shared(false)
11{ 11{
12 pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth); 12 pm = XCreatePixmap (s->display->dpy, s->display->root, w, h, format->depth);
13} 13}
14 14
15rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap) 15rxvt_img::rxvt_img (rxvt_screen *screen, XRenderPictFormat *format, int width, int height, Pixmap pixmap)
16: s(screen), pm(pixmap), w(width), h(height), format(format), shared(false) 16: s(screen), x(0), y(0), w(width), h(height), format(format), repeat(RepeatNormal), shared(false), pm(pixmap)
17{ 17{
18} 18}
19 19
20rxvt_img * 20rxvt_img *
21rxvt_img::new_from_root (rxvt_screen *s) 21rxvt_img::new_from_root (rxvt_screen *s)
352 352
353 return img; 353 return img;
354} 354}
355 355
356rxvt_img * 356rxvt_img *
357rxvt_img::sub_rect (int x, int y, int width, int height, int repeat) 357rxvt_img::sub_rect (int x, int y, int width, int height)
358{ 358{
359 rxvt_img *img = new rxvt_img (s, format, width, height); 359 rxvt_img *img = new rxvt_img (s, format, width, height);
360 360
361 Display *dpy = s->display->dpy; 361 Display *dpy = s->display->dpy;
362 XRenderPictureAttributes pa; 362 XRenderPictureAttributes pa;
371 371
372 return img; 372 return img;
373} 373}
374 374
375rxvt_img * 375rxvt_img *
376rxvt_img::transform (int new_width, int new_height, double matrix[9], int repeat) 376rxvt_img::transform (int new_width, int new_height, double matrix[9])
377{ 377{
378 rxvt_img *img = new rxvt_img (s, format, new_width, new_height); 378 rxvt_img *img = new rxvt_img (s, format, new_width, new_height);
379 379
380 Display *dpy = s->display->dpy; 380 Display *dpy = s->display->dpy;
381 XRenderPictureAttributes pa; 381 XRenderPictureAttributes pa;
410 410
411 return transform (new_width, new_height, matrix); 411 return transform (new_width, new_height, matrix);
412} 412}
413 413
414rxvt_img * 414rxvt_img *
415rxvt_img::rotate (int new_width, int new_height, int x, int y, double phi, int repeat) 415rxvt_img::rotate (int new_width, int new_height, int x, int y, double phi)
416{ 416{
417 double s = sin (phi); 417 double s = sin (phi);
418 double c = cos (phi); 418 double c = cos (phi);
419 419
420 double matrix[9] = { 420 double matrix[9] = {
421 c, -s, -c * x + s * y + x, 421 c, -s, -c * x + s * y + x,
422 s, c, -s * x - c * y + y, 422 s, c, -s * x - c * y + y,
423 0, 0, 1 423 0, 0, 1
424 }; 424 };
425 425
426 return transform (new_width, new_height, matrix, repeat); 426 return transform (new_width, new_height, matrix);
427} 427}
428 428
429rxvt_img * 429rxvt_img *
430rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg) 430rxvt_img::convert_to (XRenderPictFormat *new_format, const rxvt_color &bg)
431{ 431{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines