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

8
LINES

< > BotCompany Repo | #1035857 // pixelsInImage - virtual list of Pt

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

Libraryless. Click here for Pure Java version (9187L/52K).

static L<Pt> pixelsInImage(BufferedImage image) {
  ret pixelsInImage(image.getWidth(), image.getHeight());
}

static L<Pt> pixelsInImage(WidthAndHeight etc size) {
  int h = size.h(), w = size.w();
  ret listFromFunction(w*h, idx -> pt(idx % w, idx/w));
}

Author comment

Began life as a copy of #1035716

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035857
Snippet name: pixelsInImage - virtual list of Pt
Eternal ID of this version: #1035857/3
Text MD5: ad71e456218239b68a2e70c483b7853c
Transpilation MD5: 66aa5e226df4f631da009a6fbbbe4786
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-03 04:11:51
Source code size: 263 bytes / 8 lines
Pitched / IR pitched: No / No
Views / Downloads: 163 / 194
Version history: 2 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)