MCPcopy Index your code
hub / github.com/processing/processing / get

Method get

core/src/processing/core/PImage.java:727–741  ·  view source on GitHub ↗

( begin auto-generated from PImage_get.xml ) Reads the color of any pixel or grabs a section of an image. If no parameters are specified, the entire image is returned. Use the x and y parameters to get the value of one pixel. Get a section of the display window by specifying an additi

(int x, int y)

Source from the content-addressed store, hash-verified

725 * @see PApplet#copy(PImage, int, int, int, int, int, int, int, int)
726 */
727 public int get(int x, int y) {
728 if ((x < 0) || (y < 0) || (x >= pixelWidth) || (y >= pixelHeight)) return 0;
729
730 switch (format) {
731 case RGB:
732 return pixels[y*pixelWidth + x] | 0xff000000;
733
734 case ARGB:
735 return pixels[y*pixelWidth + x];
736
737 case ALPHA:
738 return (pixels[y*pixelWidth + x] << 24) | 0xffffff;
739 }
740 return 0;
741 }
742
743
744 /**

Callers 3

cloneMethod · 0.95
copyMethod · 0.95
blendMethod · 0.95

Calls 1

getImplMethod · 0.95

Tested by

no test coverage detected