Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

13
LINES

< > BotCompany Repo | #1006675 // rgbCopy - see copyRGBImage (could be merged)

JavaX fragment (include)

static void rgbCopy(BufferedImage src, RGBImage dst, int dstX, int dstY) {
  rgbCopy(new RGBImage(src), dst, dstX, dstY);
}
  
static void rgbCopy(RGBImage src, RGBImage dst, int dstX, int dstY) {
  int w = dst.getWidth()-dstX;
  int h = dst.getHeight()-dstY;
  w = min(w, src.getWidth());
  h = min(h, src.getHeight());
  for (int y = 0; y < h; y++)
    for (int x = 0; x < w; x++)
      dst.setPixel(dstX+x, dstY+y, src.getInt(x, y));
}

Author comment

Began life as a copy of #1006079

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006675
Snippet name: rgbCopy - see copyRGBImage (could be merged)
Eternal ID of this version: #1006675/2
Text MD5: d12218b6b32fd254af3650e105182574
Author: stefan
Category: javax / images
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-21 13:37:37
Source code size: 452 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 431 / 469
Version history: 1 change(s)
Referenced in: [show references]