1 | static BWImage twoLevelIntListToBWImage(LL<Int> array) {
|
2 | if (empty(array)) null; |
3 | int w = maxLength(array); |
4 | int h = l(array); |
5 | BWImage img = new(w, h); |
6 | |
7 | for y to h: {
|
8 | L<Int> row = array.get(y); |
9 | for x to w: {
|
10 | Int value = get(row, x); |
11 | if (value != null) |
12 | img.setInt(x, y, value); |
13 | } |
14 | } |
15 | ret img; |
16 | } |
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: | 538 / 595 |
| Version history: | 4 change(s) |
| Referenced in: | [show references] |