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)
| 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 |
no test coverage detected