… | |
… | |
4 | #:META:X_RESOURCE:%.border:boolean:respect the terminal border |
4 | #:META:X_RESOURCE:%.border:boolean:respect the terminal border |
5 | #:META:X_RESOURCE:%.interval:seconds:minimum time between updates |
5 | #:META:X_RESOURCE:%.interval:seconds:minimum time between updates |
6 | |
6 | |
7 | =head1 NAME |
7 | =head1 NAME |
8 | |
8 | |
9 | background - manage terminal background |
9 | background - manage terminal background |
10 | |
10 | |
11 | =head1 SYNOPSIS |
11 | =head1 SYNOPSIS |
12 | |
12 | |
13 | urxvt --background-expr 'background expression' |
13 | urxvt --background-expr 'background expression' |
14 | --background-border |
14 | --background-border |
… | |
… | |
308 | |
308 | |
309 | Loads the image at the given C<$path>. The image is set to plane tiling |
309 | Loads the image at the given C<$path>. The image is set to plane tiling |
310 | mode. |
310 | mode. |
311 | |
311 | |
312 | If the image is already in memory (e.g. because another terminal instance |
312 | If the image is already in memory (e.g. because another terminal instance |
313 | uses it), then the in-memory copy us returned instead. |
313 | uses it), then the in-memory copy is returned instead. |
314 | |
314 | |
315 | =item load_uc $path |
315 | =item load_uc $path |
316 | |
316 | |
317 | Load uncached - same as load, but does not cache the image, which means it |
317 | Load uncached - same as load, but does not cache the image, which means it |
318 | is I<always> loaded from the filesystem again, even if another copy of it |
318 | is I<always> loaded from the filesystem again, even if another copy of it |
… | |
… | |
422 | for @_; |
422 | for @_; |
423 | |
423 | |
424 | $base |
424 | $base |
425 | } |
425 | } |
426 | |
426 | |
|
|
427 | =back |
|
|
428 | |
427 | =head2 TILING MODES |
429 | =head2 TILING MODES |
428 | |
430 | |
429 | The following operators modify the tiling mode of an image, that is, the |
431 | The following operators modify the tiling mode of an image, that is, the |
430 | way that pixels outside the image area are painted when the image is used. |
432 | way that pixels outside the image area are painted when the image is used. |
431 | |
433 | |
… | |
… | |
533 | |
535 | |
534 | move -TX, -TY, keep { load "mybg.png" } |
536 | move -TX, -TY, keep { load "mybg.png" } |
535 | |
537 | |
536 | =item TW |
538 | =item TW |
537 | |
539 | |
|
|
540 | =item TH |
|
|
541 | |
538 | Return the width (C<TW>) and height (C<TH>) of the terminal window (the |
542 | Return the width (C<TW>) and height (C<TH>) of the terminal window (the |
539 | terminal window is the full window by default, and the character area only |
543 | terminal window is the full window by default, and the character area only |
540 | when in border-respect mode). |
544 | when in border-respect mode). |
541 | |
545 | |
542 | Using these functions make your expression sensitive to window resizes. |
546 | Using these functions make your expression sensitive to window resizes. |
… | |
… | |
609 | Clips an image to the given rectangle. If the rectangle is outside the |
613 | Clips an image to the given rectangle. If the rectangle is outside the |
610 | image area (e.g. when C<$x> or C<$y> are negative) or the rectangle is |
614 | image area (e.g. when C<$x> or C<$y> are negative) or the rectangle is |
611 | larger than the image, then the tiling mode defines how the extra pixels |
615 | larger than the image, then the tiling mode defines how the extra pixels |
612 | will be filled. |
616 | will be filled. |
613 | |
617 | |
614 | If C<$x> an C<$y> are missing, then C<0> is assumed for both. |
618 | If C<$x> and C<$y> are missing, then C<0> is assumed for both. |
615 | |
619 | |
616 | If C<$width> and C<$height> are missing, then the window size will be |
620 | If C<$width> and C<$height> are missing, then the window size will be |
617 | assumed. |
621 | assumed. |
618 | |
622 | |
619 | Example: load an image, blur it, and clip it to the window size to save |
623 | Example: load an image, blur it, and clip it to the window size to save |
… | |
… | |
637 | =item scale $width_factor, $height_factor, $img |
641 | =item scale $width_factor, $height_factor, $img |
638 | |
642 | |
639 | Scales the image by the given factors in horizontal |
643 | Scales the image by the given factors in horizontal |
640 | (C<$width>) and vertical (C<$height>) direction. |
644 | (C<$width>) and vertical (C<$height>) direction. |
641 | |
645 | |
642 | If only one factor is give, it is used for both directions. |
646 | If only one factor is given, it is used for both directions. |
643 | |
647 | |
644 | If no factors are given, scales the image to the window size without |
648 | If no factors are given, scales the image to the window size without |
645 | keeping aspect. |
649 | keeping aspect. |
646 | |
650 | |
647 | =item resize $width, $height, $img |
651 | =item resize $width, $height, $img |
… | |
… | |
772 | =item rotate $center_x, $center_y, $degrees, $img |
776 | =item rotate $center_x, $center_y, $degrees, $img |
773 | |
777 | |
774 | Rotates the image clockwise by C<$degrees> degrees, around the point at |
778 | Rotates the image clockwise by C<$degrees> degrees, around the point at |
775 | C<$center_x> and C<$center_y> (specified as factor of image width/height). |
779 | C<$center_x> and C<$center_y> (specified as factor of image width/height). |
776 | |
780 | |
777 | Example: rotate the image by 90 degrees around it's center. |
781 | Example: rotate the image by 90 degrees around its center. |
778 | |
782 | |
779 | rotate 0.5, 0.5, 90, keep { load "$HOME/mybg.png" } |
783 | rotate 0.5, 0.5, 90, keep { load "$HOME/mybg.png" } |
780 | |
784 | |
781 | =cut |
785 | =cut |
782 | |
786 | |
… | |
… | |
813 | |
817 | |
814 | sub tint($$) { |
818 | sub tint($$) { |
815 | $_[1]->tint ($_[0]) |
819 | $_[1]->tint ($_[0]) |
816 | } |
820 | } |
817 | |
821 | |
|
|
822 | =item shade $factor, $img |
|
|
823 | |
|
|
824 | Shade the image by the given factor. |
|
|
825 | |
|
|
826 | =cut |
|
|
827 | |
|
|
828 | sub shade($$) { |
|
|
829 | $_[1]->shade ($_[0]) |
|
|
830 | } |
|
|
831 | |
818 | =item contrast $factor, $img |
832 | =item contrast $factor, $img |
819 | |
833 | |
820 | =item contrast $r, $g, $b, $img |
834 | =item contrast $r, $g, $b, $img |
821 | |
835 | |
822 | =item contrast $r, $g, $b, $a, $img |
836 | =item contrast $r, $g, $b, $a, $img |
… | |
… | |
881 | $img |
895 | $img |
882 | } |
896 | } |
883 | |
897 | |
884 | =item muladd $mul, $add, $img # EXPERIMENTAL |
898 | =item muladd $mul, $add, $img # EXPERIMENTAL |
885 | |
899 | |
886 | First multipliesthe pixels by C<$mul>, then adds C<$add>. This cna be used |
900 | First multiplies the pixels by C<$mul>, then adds C<$add>. This can be used |
887 | to implement brightness and contrast at the same time, with a wider value |
901 | to implement brightness and contrast at the same time, with a wider value |
888 | range than contrast and brightness operators. |
902 | range than contrast and brightness operators. |
889 | |
903 | |
890 | Due to numerous bugs in XRender implementations, it can also introduce a |
904 | Due to numerous bugs in XRender implementations, it can also introduce a |
891 | number of visual artifacts. |
905 | number of visual artifacts. |