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

25
LINES

< > BotCompany Repo | #1034030 // gazelle22_highlightRegionOutline

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

Libraryless. Click here for Pure Java version (19032L/116K).

1  
svoid gazelle22_highlightRegionOutline(int[] pixels,
2  
  Gazelle22_ImageToRegions itr, RegionBorder_innerPoints x) {
3  
  class X {
4  
    bool hole;
5  
    int n;
6  
    Gazelle22_GradientImage gradientImage = new(itr.posterized);
7  
    
8  
    *() {
9  
      gradientImage.init();
10  
      int color = 0xFF008000, holeColor = 0xFFFFB266;
11  
      x.onNewTrace(isHole -> hole = isHole);
12  
      x.onFoundPoint(p -> {
13  
        ++n;
14  
        bool gradient = gradientImage.isGradientPoint(p.x, p.y);
15  
        int col = hole ? holeColor : color;
16  
        if (gradient)
17  
          //col = darkerIntColor(col);
18  
          if (odd(n)) ret;
19  
        pixels[p.y*itr.regions.w+p.x] = col;
20  
      });
21  
      x.run();
22  
    }
23  
  }
24  
  new X;
25  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, ekrmjmnbrukm, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034030
Snippet name: gazelle22_highlightRegionOutline
Eternal ID of this version: #1034030/8
Text MD5: 33b8ada27478dcbf378b735a3f6a9ce7
Transpilation MD5: 69fe0334ac28457b14d6a7bd8707761d
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-01-17 18:39:51
Source code size: 712 bytes / 25 lines
Pitched / IR pitched: No / No
Views / Downloads: 157 / 255
Version history: 7 change(s)
Referenced in: [show references]