Libraryless. Click here for Pure Java version (8598L/48K).
1 | srecord noeq CountHolesInRegion(IImageRegion region) { |
2 | int holes; |
3 | |
4 | int get() { |
5 | if (region == null) ret 0; |
6 | var borderWalker = new RegionBorder_innerPoints_v2(region); |
7 | borderWalker.onNewTrace(isHole -> { if (isHole) holes++; }); |
8 | borderWalker.run(); |
9 | ret holes; |
10 | } |
11 | } |
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034657 |
Snippet name: | CountHolesInRegion |
Eternal ID of this version: | #1034657/2 |
Text MD5: | dc88924a25320ee541dd998e4236b0b0 |
Transpilation MD5: | 0fc24f11618c409fcbe0e0f9ce5f0c64 |
Author: | stefan |
Category: | javax / gazelle 22 |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-02-28 22:39:33 |
Source code size: | 299 bytes / 11 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 207 / 285 |
Version history: | 1 change(s) |
Referenced in: | [show references] |