MCPcopy Index your code
hub / github.com/processing/processing / mask

Method mask

core/src/processing/core/PImage.java:943–954  ·  view source on GitHub ↗

@param maskArray array of integers used as the alpha channel, needs to be the same length as the image's pixel array.

(int maskArray[])

Source from the content-addressed store, hash-verified

941 * the same length as the image's pixel array.
942 */
943 public void mask(int maskArray[]) { // ignore
944 loadPixels();
945 // don't execute if mask image is different size
946 if (maskArray.length != pixels.length) {
947 throw new IllegalArgumentException("mask() can only be used with an image that's the same size.");
948 }
949 for (int i = 0; i < pixels.length; i++) {
950 pixels[i] = ((maskArray[i] & 0xff) << 24) | (pixels[i] & 0xffffff);
951 }
952 format = ARGB;
953 updatePixels();
954 }
955
956
957 /**

Callers

nothing calls this directly

Calls 2

loadPixelsMethod · 0.95
updatePixelsMethod · 0.95

Tested by

no test coverage detected