… | |
… | |
157 | This one first takes a snapshot of the screen background image, and then |
157 | This one first takes a snapshot of the screen background image, and then |
158 | moves it to the upper left corner of the screen (as opposed to the upper |
158 | moves it to the upper left corner of the screen (as opposed to the upper |
159 | left corner of the terminal window)- the result is pseudo-transparency: |
159 | left corner of the terminal window)- the result is pseudo-transparency: |
160 | the image seems to be static while the window is moved around. |
160 | the image seems to be static while the window is moved around. |
161 | |
161 | |
|
|
162 | =head2 COLOUR SPECIFICATIONS |
|
|
163 | |
|
|
164 | Whenever an oprator expects a "colour", then this can be specified in one |
|
|
165 | of two ways: Either as string with an X11 colour specification, such as: |
|
|
166 | |
|
|
167 | "red" # named colour |
|
|
168 | "#f00" # simple rgb |
|
|
169 | "[50]red" # red with 50% alpha |
|
|
170 | "TekHVC:300/50/50" # anything goes |
|
|
171 | |
|
|
172 | OR as an array reference with one, three or four components: |
|
|
173 | |
|
|
174 | [0.5] # 50% gray, 100% alpha |
|
|
175 | [0.5, 0, 0] # dark red, no green or blur, 100% alpha |
|
|
176 | [0.5, 0, 0, 0.7] # same with explicit 70% alpha |
|
|
177 | |
162 | =head2 CACHING AND SENSITIVITY |
178 | =head2 CACHING AND SENSITIVITY |
163 | |
179 | |
164 | Since some operations (such as C<load> and C<blur>) can take a long time, |
180 | Since some operations (such as C<load> and C<blur>) can take a long time, |
165 | caching results can be very important for a smooth operation. Caching can |
181 | caching results can be very important for a smooth operation. Caching can |
166 | also be useful to reduce memory usage, though, for example, when an image |
182 | also be useful to reduce memory usage, though, for example, when an image |
… | |
… | |
749 | =head2 COLOUR MODIFICATIONS |
765 | =head2 COLOUR MODIFICATIONS |
750 | |
766 | |
751 | The following operators change the pixels of the image. |
767 | The following operators change the pixels of the image. |
752 | |
768 | |
753 | =over 4 |
769 | =over 4 |
|
|
770 | |
|
|
771 | =item tint $color, $img |
|
|
772 | |
|
|
773 | Tints the image in the given colour. |
|
|
774 | |
|
|
775 | Example: tint the image red. |
|
|
776 | |
|
|
777 | tint "red", load "rgb.png" |
|
|
778 | |
|
|
779 | Example: the same, but specify the colour by component. |
|
|
780 | |
|
|
781 | tint [1, 0, 0], load "rgb.png" |
|
|
782 | |
|
|
783 | =cut |
|
|
784 | |
|
|
785 | sub tint($$) { |
|
|
786 | $_[1]->tint ($_[0]) |
|
|
787 | } |
754 | |
788 | |
755 | =item contrast $factor, $img |
789 | =item contrast $factor, $img |
756 | |
790 | |
757 | =item contrast $r, $g, $b, $img |
791 | =item contrast $r, $g, $b, $img |
758 | |
792 | |