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

Method loadPixels

core/src/processing/awt/PGraphicsJava2D.java:2778–2793  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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// /**

Callers 3

endDrawMethod · 0.95
getNativeMethod · 0.45
getNativeImageMethod · 0.45

Calls 1

getRasterMethod · 0.95

Tested by

no test coverage detected