@param maskArray array of integers used as the alpha channel, needs to be the same length as the image's pixel array.
(int maskArray[])
| 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 | /** |
nothing calls this directly
no test coverage detected