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

14
LINES

< > BotCompany Repo | #1035821 // iBinaryImageFromFunction

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

Libraryless. Click here for Pure Java version (10947L/62K).

1  
static IBinaryImage iBinaryImageFromFunction(IIntIntPred f, int w, int h) {
2  
  ret new IBinaryImage {
3  
    public int getWidth() { ret w; }
4  
    public int getHeight() { ret h; }
5  
    
6  
    public bool getBoolPixel(int x, int y) {
7  
      ret f.get(x, y);
8  
    }
9  
  };
10  
}
11  
12  
static IBinaryImage iBinaryImageFromFunction(int w, int h, IIntIntPred f) {
13  
  ret iBinaryImageFromFunction(f, w, h);
14  
}

Author comment

Began life as a copy of #1033589

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035821
Snippet name: iBinaryImageFromFunction
Eternal ID of this version: #1035821/3
Text MD5: a5743bbd417ac214bbc023c44bab336d
Transpilation MD5: 46dc34ab9e2e264c577f9766c7b23acd
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-01 22:19:22
Source code size: 394 bytes / 14 lines
Pitched / IR pitched: No / No
Views / Downloads: 177 / 234
Version history: 2 change(s)
Referenced in: [show references]