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

14
LINES

< > BotCompany Repo | #1006977 // getAlphaChannel

JavaX fragment (include)

static BWImage getAlphaChannel(BufferedImage src) {
  int w = src.getWidth();
  int h = src.getHeight();

  BWImage alpha = new BWImage(w, h);
  for y to h: for x to w: {
    //int a = (srcBuffer[i] >> 24) & 0xff;
    //int a = srcBuffer[i] & 0xff;
    int a = (src.getRGB(x, y) >> 24) &0xff;
    alpha.setByte(x, y, a);
    //print(intToHex= (srcBuffer[i]));
  }
  ret alpha;
}

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: #1006977
Snippet name: getAlphaChannel
Eternal ID of this version: #1006977/10
Text MD5: 58776b05c7b358f7527ffed416df64b5
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-02-21 19:19:19
Source code size: 391 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 518 / 514
Version history: 9 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1035299 - alphaChannelFromPixels