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

10
LINES

< > BotCompany Repo | #1032468 // bwIntegralImageFromFunction

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

Libraryless. Click here for Pure Java version (8446L/49K).

// f: (x, y) -> 0..255
// TODO: optimize!!
static BWIntegralImage bwIntegralImageFromFunction(int w, int h default w, IF2_Int f) {
  byte[] pixels = new[w*h];
  int i = 0;
  for y to h:
    for x to w:
      pixels[i++] = (byte) f.get(x, y);
  ret BWIntegralImage(BWImage(w, h, pixels));
}

Author comment

Began life as a copy of #1032161

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx

No comments. add comment

Snippet ID: #1032468
Snippet name: bwIntegralImageFromFunction
Eternal ID of this version: #1032468/3
Text MD5: 72ab647de6515dc0fe06e3181d14ddcb
Transpilation MD5: b0fb9c52db2d06cddf0f720204cda21f
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2021-10-11 14:23:07
Source code size: 298 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 169 / 237
Version history: 2 change(s)
Referenced in: [show references]