| rescale |
(Number scale [, Number offset, ...]) |
typedict.Image |
| |
Adjusts the brightness of this image by changing the color components
of each pixel in this image using the formula,
newcomp = scale*comp + offset
in which the optional
offset
argument is
0
if it is not supplied,
and returns this image to the caller.
One or two arguments tells
rescale
to apply the scaling to all the color components in the image.
Three or more arguments means
rescale
only touches the first
argc/2
color components, where
argc
is the number of arguments in the call.
| |
| Example: |
The program,
import yoix.*.*;
Image img = {
String source = "http://www.yoix.org/imgs/ATTlogo.gif";
Array metrics = {0, 0, 1.0, 1.0};
};
Image img_dark = {
Image source = img;
Array metrics = {0, 0, 1.0, 1.0};
paint() {
rescale(.5);
}
};
Image img_blue = {
Image source = img;
Array metrics = {0, 0, 1.0, 1.0};
paint() {
rescale(0, 0, 0, 0);
}
};
JFrame f = {
paint(Rectangle r) {
graphics {
rectclip(r);
moveto(72, 72);
showimage(img);
showimage(img_dark);
showimage(img_blue);
initclip();
}
}
};
f.visible = TRUE;
uses
rescale
to darken one image and extract the blue color component in another.
Notice how the
metrics
arrays defined in the images control where showimage, which is defined in
Graphics,
places them.
| | |
| Return: |
Image
| | |
| See Also: |
convert,
convolve,
getpixel,
replace,
setpixel,
transform
|
|
Yoix is a registered trademark of AT&T Intellectual Property.
|