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

Method getImpl

core/src/processing/core/PImage.java:822–832  ·  view source on GitHub ↗

Internal function to actually handle getting a block of pixels that has already been properly cropped to a valid region. That is, x/y/w/h are guaranteed to be inside the image space, so the implementation can use the fastest possible pixel copying method.

(int sourceX, int sourceY,
                         int sourceWidth, int sourceHeight,
                         PImage target, int targetX, int targetY)

Source from the content-addressed store, hash-verified

820 * use the fastest possible pixel copying method.
821 */
822 protected void getImpl(int sourceX, int sourceY,
823 int sourceWidth, int sourceHeight,
824 PImage target, int targetX, int targetY) {
825 int sourceIndex = sourceY*pixelWidth + sourceX;
826 int targetIndex = targetY*target.pixelWidth + targetX;
827 for (int row = 0; row < sourceHeight; row++) {
828 System.arraycopy(pixels, sourceIndex, target.pixels, targetIndex, sourceWidth);
829 sourceIndex += pixelWidth;
830 targetIndex += target.pixelWidth;
831 }
832 }
833
834
835 /**

Callers 1

getMethod · 0.95

Calls 1

arraycopyMethod · 0.80

Tested by

no test coverage detected