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

24
LINES

< > BotCompany Repo | #1034036 // g22_renderPosterizedHighlightedImage

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

Libraryless. Click here for Pure Java version (22731L/142K).

svoid g22_renderPosterizedHighlightedImage(ImageSurface isPosterized, Gazelle22_ImageToRegions itr, bool showRegionsAsOutline) {
  if (isPosterized == null) ret;
  
  var mouse = mouseLocationPt();
  if (!isScreenCoordinateInWindow(mouse, isPosterized)) {
    var mouse2 = itr.coordinatesFromScreen(mouse);
    //printVars(+mouse, +mouse2);
    mouse = mouse2;
  } else
    mouse = isPosterized.mousePosition;
    
  var pixels = itr.posterized.getRGBPixels();
  g22_highlightRegion(pixels, isPosterized, itr, mouse, showRegionsAsOutline);
  
  if (itr.scoredRegions != null)
    for (IImageRegion region, double score : itr.scoredRegions) {
      if (score >= .5) {
        int color = colorToIntOpaque(blendColors(lightBlue(), Color.blue, (score-.5)*2));
        g22_highlightRegion(pixels, itr, region.indexInCreator(), color, false);
      }
    }
    
  isPosterized.setImage(bufferedImage(pixels, itr.posterized));
}

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: 189 / 301
Version history: 7 change(s)
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)