… | |
… | |
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 | |
|
|
19 | Just load a random jpeg image and tile the background with it without |
|
|
20 | scaling or anything else: |
|
|
21 | |
|
|
22 | load "/path/to/img.jpg" |
|
|
23 | |
|
|
24 | The same, but use mirroring/reflection instead of tiling: |
|
|
25 | |
|
|
26 | mirror load "/path/to/img.jpg" |
|
|
27 | |
|
|
28 | Load an image and scale it to exactly fill the terminal window: |
|
|
29 | |
|
|
30 | scale keep { load "/path/to/img.jpg" } |
|
|
31 | |
|
|
32 | Implement pseudo-transparency by using a suitably-aligned root pixmap |
|
|
33 | as window background: |
|
|
34 | |
|
|
35 | rootalign root |
|
|
36 | |
|
|
37 | Likewise, but keep a blurred copy: |
|
|
38 | |
|
|
39 | rootalign keep { blur 10, root } |
16 | |
40 | |
17 | =head1 DESCRIPTION |
41 | =head1 DESCRIPTION |
18 | |
42 | |
19 | This extension manages the terminal background by creating a picture that |
43 | This extension manages the terminal background by creating a picture that |
20 | is behind the text, replacing the normal background colour. |
44 | is behind the text, replacing the normal background colour. |
… | |
… | |
827 | latter in a white picture. |
851 | latter in a white picture. |
828 | |
852 | |
829 | Due to idiosyncrasies in the underlying XRender extension, biases less |
853 | Due to idiosyncrasies in the underlying XRender extension, biases less |
830 | than zero can be I<very> slow. |
854 | than zero can be I<very> slow. |
831 | |
855 | |
|
|
856 | You 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 | |
|
|
886 | First multipliesthe pixels by C<$mul>, then adds C<$add>. This cna be used |
|
|
887 | to implement brightness and contrast at the same time, with a wider value |
|
|
888 | range than contrast and brightness operators. |
|
|
889 | |
|
|
890 | Due to numerous bugs in XRender implementations, it can also introduce a |
|
|
891 | number of visual artifacts. |
|
|
892 | |
|
|
893 | Example: increase contrast by a factor of C<$c> without changing image |
|
|
894 | brightness 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 |