Libraryless. Click here for Pure Java version (6289L/36K).
1 | static BufferedImage pointsToImage(Iterable<Pt> points) { |
2 | var pointsList = asList(points); |
3 | if (empty(pointsList)) ret whiteImage(1); |
4 | Rect bounds = boundsOfPts(pointsList); |
5 | var img = whiteImage(bounds.w+2, bounds.h+2); |
6 | for ping (p : pointsList) |
7 | setPixel(img, p.x-bounds.x+1, p.y-bounds.y+1, Color.black); |
8 | ret img; |
9 | } |
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034967 |
Snippet name: | pointsToImage - white image with list of points marked black (cropped) |
Eternal ID of this version: | #1034967/5 |
Text MD5: | 40ae07fe0efcc01626ce6a8b40c417c8 |
Transpilation MD5: | b923b0464992d06207a7ef18f730496e |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-19 18:02:00 |
Source code size: | 338 bytes / 9 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 132 / 214 |
Version history: | 4 change(s) |
Referenced in: | [show references] |