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

19
LINES

< > BotCompany Repo | #1025059 // bwImageFromColumnFloats

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (2988L/18K).

static BWImage bwImageFromColumnFloats(float[] cols) {
  ret bwImageFromColumnFloats(cols, 20);
}

static BWImage bwImageFromColumnFloats(float[] cols, int h) {
  if (empty(cols) || h <= 0) null;
  int w = l(cols);
  BWImage bw = new(w, h);
  for x to w: {
    float f = cols[x];
    for y to h:
      bw.setPixel(x, y, f);
  }
  ret bw;
}

static BWImage bwImageFromColumnFloats(int h, float[] cols) {
  ret bwImageFromColumnFloats(cols, h);
}

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1025059
Snippet name: bwImageFromColumnFloats
Eternal ID of this version: #1025059/3
Text MD5: 92e9fcf70599c6e15802c4273f5d30fc
Transpilation MD5: 497ee1618c9ad593c49f1681c8f349c8
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-04 01:05:09
Source code size: 462 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 252 / 353
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)