1 | static void copyRGBImage(RGBImage src, int srcX, int srcY, RGBImage dst, int dstX, int dstY) { |
2 | copyRGBImage(src, srcX, srcY, dst, dstX, dstY, src.getWidth()-srcX, src.getHeight()-srcY); |
3 | } |
4 | |
5 | static void copyRGBImage(RGBImage src, int srcX, int srcY, RGBImage dst, int dstX, int dstY, int w, int h) { |
6 | w = min(w, dst.getWidth()-dstX); |
7 | h = min(h, dst.getHeight()-dstY); |
8 | w = min(w, src.getWidth()-srcX); |
9 | h = min(h, src.getHeight()-srcY); |
10 | for (int y = 0; y < h; y++) |
11 | for (int x = 0; x < w; x++) |
12 | dst.setPixel(dstX+x, dstY+y, src.getInt(srcX+x, srcY+y)); |
13 | } |
Began life as a copy of #1004617
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006079 |
Snippet name: | copyRGBImage |
Eternal ID of this version: | #1006079/1 |
Text MD5: | 1e026efa5b65dc524848236ae5524d25 |
Author: | stefan |
Category: | javax / images |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2016-12-17 01:20:22 |
Source code size: | 583 bytes / 13 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 619 / 623 |
Referenced in: | [show references] |