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.50 by root, Sun Jun 10 17:31:53 2012 UTC vs.
Revision 1.51 by sf-exg, Sun Jun 10 19:01:03 2012 UTC

57 57
58For example, an expression such as C<scale load "$HOME/mybg.png"> scales the 58For example, an expression such as C<scale load "$HOME/mybg.png"> scales the
59image to the window size, so it relies on the window size and will 59image to the window size, so it relies on the window size and will
60be reevaluated each time it is changed, but not when it moves for 60be reevaluated each time it is changed, but not when it moves for
61example. That ensures that the picture always fills the terminal, even 61example. That ensures that the picture always fills the terminal, even
62after it's size changes. 62after its size changes.
63 63
64=head2 EXPRESSIONS 64=head2 EXPRESSIONS
65 65
66Expressions are normal Perl expressions, in fact, they are Perl blocks - 66Expressions are normal Perl expressions, in fact, they are Perl blocks -
67which means you could use multiple lines and statements: 67which means you could use multiple lines and statements:
115horizontal and vertical dimensions. For example, this halves the image 115horizontal and vertical dimensions. For example, this halves the image
116width and doubles the image height: 116width and doubles the image height:
117 117
118 scale 0.5, 2, load "$HOME/mypic.png" 118 scale 0.5, 2, load "$HOME/mypic.png"
119 119
120Other effects than scalign are also readily available, for exmaple, you can 120Other effects than scaling are also readily available, for example, you can
121tile the image to fill the whole window, instead of resizing it: 121tile the image to fill the whole window, instead of resizing it:
122 122
123 tile load "$HOME/mypic.png" 123 tile load "$HOME/mypic.png"
124 124
125In fact, images returned by C<load> are in C<tile> mode by default, so the C<tile> operator 125In fact, images returned by C<load> are in C<tile> mode by default, so the C<tile> operator
151This only works for one cycle though, so as long as you load the same 151This only works for one cycle though, so as long as you load the same
152image every time, it will always be cached, but when you load a different 152image every time, it will always be cached, but when you load a different
153image, it will forget about the first one. 153image, it will forget about the first one.
154 154
155This allows you to either speed things up by keeping multiple images in 155This allows you to either speed things up by keeping multiple images in
156memory, or comserve memory by loading images more often. 156memory, or conserve memory by loading images more often.
157 157
158For example, you can keep two images in memory and use a random one like 158For example, you can keep two images in memory and use a random one like
159this: 159this:
160 160
161 my $img1 = load "img1.png"; 161 my $img1 = load "img1.png";
191Specifying this flag changes the behaviour, so that the image only 191Specifying this flag changes the behaviour, so that the image only
192replaces the background of the character area. 192replaces the background of the character area.
193 193
194=item --background-interval seconds 194=item --background-interval seconds
195 195
196Since some operations in the underlying XRender extension can effetively 196Since some operations in the underlying XRender extension can effectively
197freeze your X-server for prolonged time, this extension enforces a minimum 197freeze your X-server for prolonged time, this extension enforces a minimum
198time between updates, which is normally about 0.1 seconds. 198time between updates, which is normally about 0.1 seconds.
199 199
200If you want to do updates more often, you can decrease this safety 200If you want to do updates more often, you can decrease this safety
201interval with this switch. 201interval with this switch.
324become transparent. This mode is most useful when you want to place an 324become transparent. This mode is most useful when you want to place an
325image over another image or the background colour while leaving all 325image over another image or the background colour while leaving all
326background pixels outside the image unchanged. 326background pixels outside the image unchanged.
327 327
328Example: load an image and display it in the upper left corner. The rest 328Example: load an image and display it in the upper left corner. The rest
329of the space is left "empty" (transparent or wahtever your compisotr does 329of the space is left "empty" (transparent or whatever your compositor does
330in alpha mode, else background colour). 330in alpha mode, else background colour).
331 331
332 pad load "mybg.png" 332 pad load "mybg.png"
333 333
334=item extend $img 334=item extend $img
335 335
336Extends the image over the whole plane, using the closest pixel in the 336Extends the image over the whole plane, using the closest pixel in the
337area outside the image. This mode is mostly useful when you more complex 337area outside the image. This mode is mostly useful when you use more complex
338filtering operations and want the pixels outside the image to have the 338filtering operations and want the pixels outside the image to have the
339same values as the pixels near the edge. 339same values as the pixels near the edge.
340 340
341Example: just for curiosity, how does this pixel extension stuff work? 341Example: just for curiosity, how does this pixel extension stuff work?
342 342
673 673
674Values less than 0 reduce brightness, while values larger than 0 increase 674Values less than 0 reduce brightness, while values larger than 0 increase
675it. Useful range is from -1 to 1 - the former results in a black, the 675it. Useful range is from -1 to 1 - the former results in a black, the
676latter in a white picture. 676latter in a white picture.
677 677
678Due to idiosynchrasies in the underlying XRender extension, biases less 678Due to idiosyncrasies in the underlying XRender extension, biases less
679than zero can be I<very> slow. 679than zero can be I<very> slow.
680 680
681=cut 681=cut
682 682
683 sub contrast($$;$$;$) { 683 sub contrast($$;$$;$) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines