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

13
LINES

< > BotCompany Repo | #1004617 // copyBWImage

JavaX fragment (include)

static void copyBWImage(BWImage src, int srcX, int srcY, BWImage dst, int dstX, int dstY) {
  copyBWImage(src, srcX, srcY, dst, dstX, dstY, src.getWidth()-srcX, src.getHeight()-srcY);
}

static void copyBWImage(BWImage src, int srcX, int srcY, BWImage dst, int dstX, int dstY, int w, int h) {
  w = min(w, dst.getWidth()-dstX);
  h = min(h, dst.getHeight()-dstY);
  w = min(w, src.getWidth()-srcX);
  h = min(h, src.getHeight()-srcY);
  for (int y = 0; y < h; y++)
    for (int x = 0; x < w; x++)
      dst.setByte(dstX+x, dstY+y, src.getByte(srcX+x, srcY+y));
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1004617
Snippet name: copyBWImage
Eternal ID of this version: #1004617/1
Text MD5: 74731f5864aab483a85eb20a5c122d86
Author: stefan
Category: javax / images
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-23 23:39:01
Source code size: 576 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 598 / 585
Referenced in: [show references]