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

Method setImpl

core/src/processing/core/PImage.java:915–930  ·  view source on GitHub ↗

Internal function to actually handle setting a block of pixels that has already been properly cropped from the image to a valid region.

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

Source from the content-addressed store, hash-verified

913 * has already been properly cropped from the image to a valid region.
914 */
915 protected void setImpl(PImage sourceImage,
916 int sourceX, int sourceY,
917 int sourceWidth, int sourceHeight,
918 int targetX, int targetY) {
919 int sourceOffset = sourceY * sourceImage.pixelWidth + sourceX;
920 int targetOffset = targetY * pixelWidth + targetX;
921
922 for (int y = sourceY; y < sourceY + sourceHeight; y++) {
923 System.arraycopy(sourceImage.pixels, sourceOffset, pixels, targetOffset, sourceWidth);
924 sourceOffset += sourceImage.pixelWidth;
925 targetOffset += pixelWidth;
926 }
927
928 //updatePixelsImpl(targetX, targetY, sourceWidth, sourceHeight);
929 updatePixels(targetX, targetY, sourceWidth, sourceHeight);
930 }
931
932
933

Callers 1

setMethod · 0.95

Calls 2

updatePixelsMethod · 0.95
arraycopyMethod · 0.80

Tested by

no test coverage detected