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)
| 765 | * has already been properly cropped from the image to a valid region. |
| 766 | */ |
| 767 | protected void setImpl(PImage sourceImage, |
| 768 | int sourceX, int sourceY, |
| 769 | int sourceWidth, int sourceHeight, |
| 770 | int targetX, int targetY) { |
| 771 | int sourceOffset = sourceY * sourceImage.pixelWidth + sourceX; |
| 772 | int targetOffset = targetY * pixelWidth + targetX; |
| 773 | |
| 774 | for (int y = sourceY; y < sourceY + sourceHeight; y++) { |
| 775 | System.arraycopy(sourceImage.pixels, sourceOffset, pixels, targetOffset, sourceWidth); |
| 776 | sourceOffset += sourceImage.pixelWidth; |
| 777 | targetOffset += pixelWidth; |
| 778 | } |
| 779 | |
| 780 | //updatePixelsImpl(targetX, targetY, sourceWidth, sourceHeight); |
| 781 | updatePixels(targetX, targetY, sourceWidth, sourceHeight); |
| 782 | } |
| 783 | |
| 784 | |
| 785 |
no test coverage detected