Libraryless. Click here for Pure Java version (22731L/142K).
1 | svoid g22_renderPosterizedHighlightedImage(ImageSurface isPosterized, Gazelle22_ImageToRegions itr, bool showRegionsAsOutline) { |
2 | if (isPosterized == null) ret; |
3 | |
4 | var mouse = mouseLocationPt(); |
5 | if (!isScreenCoordinateInWindow(mouse, isPosterized)) { |
6 | var mouse2 = itr.coordinatesFromScreen(mouse); |
7 | //printVars(+mouse, +mouse2); |
8 | mouse = mouse2; |
9 | } else |
10 | mouse = isPosterized.mousePosition; |
11 | |
12 | var pixels = itr.posterized.getRGBPixels(); |
13 | g22_highlightRegion(pixels, isPosterized, itr, mouse, showRegionsAsOutline); |
14 | |
15 | if (itr.scoredRegions != null) |
16 | for (IImageRegion region, double score : itr.scoredRegions) { |
17 | if (score >= .5) { |
18 | int color = colorToIntOpaque(blendColors(lightBlue(), Color.blue, (score-.5)*2)); |
19 | g22_highlightRegion(pixels, itr, region.indexInCreator(), color, false); |
20 | } |
21 | } |
22 | |
23 | isPosterized.setImage(bufferedImage(pixels, itr.posterized)); |
24 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034036 |
Snippet name: | g22_renderPosterizedHighlightedImage |
Eternal ID of this version: | #1034036/8 |
Text MD5: | 01bf1c1487e2ea641a7c9878910f5959 |
Transpilation MD5: | 8b6d698eed6c427ae469b1cfb070e785 |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-03-16 18:14:05 |
Source code size: | 945 bytes / 24 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 188 / 301 |
Version history: | 7 change(s) |
Referenced in: | [show references] |