MCPcopy Index your code
hub / github.com/benfry/processing4 / mask

Method mask

core/src/processing/core/PImage.java:795–806  ·  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

793 * the same length as the image's pixel array.
794 */
795 public void mask(int[] maskArray) { // ignore
796 loadPixels();
797 // don't execute if mask image is different size
798 if (maskArray.length != pixels.length) {
799 throw new IllegalArgumentException("mask() can only be used with an image that's the same size.");
800 }
801 for (int i = 0; i < pixels.length; i++) {
802 pixels[i] = ((maskArray[i] & 0xff) << 24) | (pixels[i] & 0xffffff);
803 }
804 format = ARGB;
805 updatePixels();
806 }
807
808
809 /**

Callers

nothing calls this directly

Calls 2

loadPixelsMethod · 0.95
updatePixelsMethod · 0.95

Tested by

no test coverage detected