()
| 2776 | |
| 2777 | |
| 2778 | @Override |
| 2779 | public void loadPixels() { |
| 2780 | if (pixels == null || (pixels.length != pixelWidth*pixelHeight)) { |
| 2781 | pixels = new int[pixelWidth * pixelHeight]; |
| 2782 | } |
| 2783 | |
| 2784 | WritableRaster raster = getRaster(); |
| 2785 | raster.getDataElements(0, 0, pixelWidth, pixelHeight, pixels); |
| 2786 | if (raster.getNumBands() == 3) { |
| 2787 | // Java won't set the high bits when RGB, returns 0 for alpha |
| 2788 | // https://github.com/processing/processing/issues/2030 |
| 2789 | for (int i = 0; i < pixels.length; i++) { |
| 2790 | pixels[i] = 0xff000000 | pixels[i]; |
| 2791 | } |
| 2792 | } |
| 2793 | } |
| 2794 | |
| 2795 | |
| 2796 | // /** |
no test coverage detected