1 | static BufferedImage pointsToImage_fromOrigin(Iterable<Pt> points) {
|
2 | var pointsList = asList(points); |
3 | if (empty(pointsList)) ret whiteImage(1); |
4 | Pt size = maxPt(pointsList); |
5 | var img = whiteImage(size.x+2, size.y+2); |
6 | for (p : pointsList) |
7 | setPixel(img, p, Color.black); |
8 | ret img; |
9 | } |
Began life as a copy of #1034967
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
| Snippet ID: | #1034968 |
| Snippet name: | pointsToImage_fromOrigin - white image with list of points marked black |
| Eternal ID of this version: | #1034968/1 |
| Text MD5: | da359c1ae14ce155ede80677270dde0a |
| Author: | stefan |
| Category: | javax / imaging |
| Type: | JavaX fragment (include) |
| Public (visible to everyone): | Yes |
| Archived (hidden from active list): | No |
| Created/modified: | 2022-03-18 23:11:15 |
| Source code size: | 301 bytes / 9 lines |
| Pitched / IR pitched: | No / No |
| Views / Downloads: | 386 / 415 |
| Referenced in: | [show references] |