PImage::mask() \ Language (API) \ Processing 1.0
Search processing.org:
Language (A-Z) \
Libraries \
Tools \
Environment \
Compare \
Troubleshooting
Reference for Processing version 1.0+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.
Class
PImage
Name
mask()
Examples
PImage img = loadImage("test.jpg");
PImage maskImg = loadImage("mask.jpg");
img.mask(maskImg);
image(img, 0, 0);
image(img, 25, 0);
Description
Masks part of an image from displaying by loading another image and using it as an alpha channel. This mask image should only contain grayscale data, but only the blue color channel is used. The mask image needs to be the same size as the image to which it is applied.In addition to using a mask image, an integer array containing the alpha channel data can be specified directly. This method is useful for creating dynamically generated alpha masks. This array must be of the same length as the target image's pixels array and should contain only grayscale data of values between 0-255.
Syntax
img.mask(maskImg)
img.mask(maskArray)
Parameters
img
any variable of type PImage
maskImg
PImage: any PImage object used as the alpha channel for "img", needs to be same size as "img"
maskArray
int[]: any array of Integer numbers used as the alpha channel, needs to be same length as the image's pixel array
Usage
Web & Application
Updated on November 22, 2008 08:39:25pm PST
Processing was initiated by Ben Fry and Casey Reas. It is developed by a small team of volunteers.
© Info \
Site hosted by Media Temple!
Wyszukiwarka
Podobne podstrony:
PImage maskPImage maskPImage loadPixelsThe Mask WearerPImage filterpermission maskPImage resizePImage alphaFugees The maskPImage blendwięcej podobnych podstron