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

Comparing rxvt-unicode/src/perl/background (file contents):
Revision 1.52 by root, Tue Jun 12 10:45:53 2012 UTC vs.
Revision 1.53 by root, Tue Jun 12 18:25:57 2012 UTC

432C<$seconds> seconds. 432C<$seconds> seconds.
433 433
434Example: load some image and rotate it according to the time of day (as if it were 434Example: load some image and rotate it according to the time of day (as if it were
435the hour pointer of a clock). Update this image every minute. 435the hour pointer of a clock). Update this image every minute.
436 436
437 again 60; rotate TW, TH, 50, 50, (now % 86400) * -720 / 86400, scale load "myclock.png" 437 again 60; rotate 50, 50, (now % 86400) * -720 / 86400, scale load "myclock.png"
438 438
439=item counter $seconds 439=item counter $seconds
440 440
441Like C<again>, but also returns an increasing counter value, starting at 441Like C<again>, but also returns an increasing counter value, starting at
4420, which might be useful for some simple animation effects. 4420, which might be useful for some simple animation effects.
629 629
630 sub rootalign($) { 630 sub rootalign($) {
631 move -TX, -TY, $_[0] 631 move -TX, -TY, $_[0]
632 } 632 }
633 633
634=item rotate $center_x, $center_y, $degrees, $new_width, $new_height 634=item rotate $center_x, $center_y, $degrees
635 635
636Rotates the image by C<$degrees> degrees, counter-clockwise, around the 636Rotates the image by C<$degrees> degrees, counter-clockwise, around the
637pointer at C<$center_x> and C<$center_y> (specified as factor of image 637pointer at C<$center_x> and C<$center_y> (specified as factor of image
638width/height), generating a new image with width C<$new_width> and height 638width/height).
639C<$new_height>.
640 639
641#TODO# new width, height, maybe more operators? 640#TODO# new width, height, maybe more operators?
642 641
643Example: rotate the image by 90 degrees 642Example: rotate the image by 90 degrees
644 643
645=cut 644=cut
646 645
647 sub rotate($$$$$$) { 646 sub rotate($$$$) {
648 my $img = pop; 647 my $img = pop;
649 $img->rotate ( 648 $img->rotate (
650 $_[0] * $img->w, 649 $_[0] * $img->w,
651 $_[1] * $img->h, 650 $_[1] * $img->h,
652 $_[2] * (3.14159265 / 180), 651 $_[2] * (3.14159265 / 180),
653 $_[3],
654 $_[4],
655 ) 652 )
656 } 653 }
657 654
658=back 655=back
659 656

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines