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.74 by root, Sat Jul 14 08:42:54 2012 UTC vs.
Revision 1.75 by root, Fri Aug 10 20:07:11 2012 UTC

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
15 --background-interval seconds 15 --background-interval seconds
16
17=head1 QUICK AND DIRTY CHEAT SHEET
18
19Just load a random jpeg image and tile the background with it without
20scaling or anything else:
21
22 load "/path/to/img.jpg"
23
24The same, but use mirroring/reflection instead of tiling:
25
26 mirror load "/path/to/img.jpg"
27
28Load an image and scale it to exactly fill the terminal window:
29
30 scale keep { load "/path/to/img.jpg" }
31
32Implement pseudo-transparency by using a suitably-aligned root pixmap
33as window background:
34
35 rootalign root
36
37Likewise, but keep a blurred copy:
38
39 rootalign keep { blur 10, root }
16 40
17=head1 DESCRIPTION 41=head1 DESCRIPTION
18 42
19This extension manages the terminal background by creating a picture that 43This extension manages the terminal background by creating a picture that
20is behind the text, replacing the normal background colour. 44is behind the text, replacing the normal background colour.
827latter in a white picture. 851latter in a white picture.
828 852
829Due to idiosyncrasies in the underlying XRender extension, biases less 853Due to idiosyncrasies in the underlying XRender extension, biases less
830than zero can be I<very> slow. 854than zero can be I<very> slow.
831 855
856You can also try the experimental(!) C<muladd> operator.
857
832=cut 858=cut
833 859
834 sub contrast($$;$$;$) { 860 sub contrast($$;$$;$) {
835 my $img = pop; 861 my $img = pop;
836 my ($r, $g, $b, $a) = @_; 862 my ($r, $g, $b, $a) = @_;
851 $a = 1 if @_ < 4; 877 $a = 1 if @_ < 4;
852 878
853 $img = $img->clone; 879 $img = $img->clone;
854 $img->brightness ($r, $g, $b, $a); 880 $img->brightness ($r, $g, $b, $a);
855 $img 881 $img
882 }
883
884=item muladd $mul, $add, $img # EXPERIMENTAL
885
886First multipliesthe pixels by C<$mul>, then adds C<$add>. This cna be used
887to implement brightness and contrast at the same time, with a wider value
888range than contrast and brightness operators.
889
890Due to numerous bugs in XRender implementations, it can also introduce a
891number of visual artifacts.
892
893Example: increase contrast by a factor of C<$c> without changing image
894brightness too much.
895
896 muladd $c, (1 - $c) * 0.5, $img
897
898=cut
899
900 sub muladd($$$) {
901 $_[2]->muladd ($_[0], $_[1])
856 } 902 }
857 903
858=item blur $radius, $img 904=item blur $radius, $img
859 905
860=item blur $radius_horz, $radius_vert, $img 906=item blur $radius_horz, $radius_vert, $img

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines