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

16
LINES

< > BotCompany Repo | #1020687 // twoLevelIntListToBWImage

JavaX fragment (include)

static BWImage twoLevelIntListToBWImage(LL<Int> array) {
  if (empty(array)) null;
  int w = maxLength(array);
  int h = l(array);
  BWImage img = new(w, h);
  
  for y to h: {
    L<Int> row = array.get(y);
    for x to w: {
      Int value = get(row, x);
      if (value != null) 
        img.setInt(x, y, value);
    }
  }
  ret img;
}

Author comment

Began life as a copy of #1020683

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020687
Snippet name: twoLevelIntListToBWImage
Eternal ID of this version: #1020687/5
Text MD5: 4aced5b4f273d82d606743d0bf1a0a1b
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-30 21:50:16
Source code size: 353 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 313 / 372
Version history: 4 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)