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

9
LINES

< > BotCompany Repo | #1022944 // renderColorPredicate

JavaX fragment (include)

1  
static RGBImage renderColorPredicate(F1<Int, Bool> predicate, RGBImage img) {
2  
  int w = img.getWidth(), h = img.getHeight();
3  
  RGBImage out = new(w, h);
4  
  for y to h:
5  
    for x to w:
6  
      if (callF(predicate, img.getInt(x, y)))
7  
        out.setPixel(x, y, Color.white);
8  
  ret out;
9  
}

Author comment

Began life as a copy of #1022943

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022944
Snippet name: renderColorPredicate
Eternal ID of this version: #1022944/1
Text MD5: 34d80960fa1c7cef0e6589f447a4fcaf
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-15 02:58:38
Source code size: 290 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 268 / 305
Referenced in: [show references]