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.76 by root, Tue Aug 14 23:57:07 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.
398 for @_; 422 for @_;
399 423
400 $base 424 $base
401 } 425 }
402 426
427=back
428
403=head2 TILING MODES 429=head2 TILING MODES
404 430
405The following operators modify the tiling mode of an image, that is, the 431The following operators modify the tiling mode of an image, that is, the
406way that pixels outside the image area are painted when the image is used. 432way that pixels outside the image area are painted when the image is used.
407 433
827latter in a white picture. 853latter in a white picture.
828 854
829Due to idiosyncrasies in the underlying XRender extension, biases less 855Due to idiosyncrasies in the underlying XRender extension, biases less
830than zero can be I<very> slow. 856than zero can be I<very> slow.
831 857
858You can also try the experimental(!) C<muladd> operator.
859
832=cut 860=cut
833 861
834 sub contrast($$;$$;$) { 862 sub contrast($$;$$;$) {
835 my $img = pop; 863 my $img = pop;
836 my ($r, $g, $b, $a) = @_; 864 my ($r, $g, $b, $a) = @_;
851 $a = 1 if @_ < 4; 879 $a = 1 if @_ < 4;
852 880
853 $img = $img->clone; 881 $img = $img->clone;
854 $img->brightness ($r, $g, $b, $a); 882 $img->brightness ($r, $g, $b, $a);
855 $img 883 $img
884 }
885
886=item muladd $mul, $add, $img # EXPERIMENTAL
887
888First multipliesthe pixels by C<$mul>, then adds C<$add>. This cna be used
889to implement brightness and contrast at the same time, with a wider value
890range than contrast and brightness operators.
891
892Due to numerous bugs in XRender implementations, it can also introduce a
893number of visual artifacts.
894
895Example: increase contrast by a factor of C<$c> without changing image
896brightness too much.
897
898 muladd $c, (1 - $c) * 0.5, $img
899
900=cut
901
902 sub muladd($$$) {
903 $_[2]->muladd ($_[0], $_[1])
856 } 904 }
857 905
858=item blur $radius, $img 906=item blur $radius, $img
859 907
860=item blur $radius_horz, $radius_vert, $img 908=item blur $radius_horz, $radius_vert, $img

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines