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