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

9
LINES

< > BotCompany Repo | #1001880 // fill function (fill image with color)

JavaX fragment (include)

1  
ifclass RGBImage
2  
static void fill(RGBImage img, S col) {
3  
  RGB rgb = new RGB(col);
4  
  int w = img.getWidth(), h = img.getHeight();
5  
  for (int y = 0; y < h; y++)
6  
    for (int x = 0; x < w; x++)
7  
      img.setPixel(x, y, rgb);
8  
}
9  
endif

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1001880
Snippet name: fill function (fill image with color)
Eternal ID of this version: #1001880/2
Text MD5: 575b49916a4e79c32ce62a2a657b698b
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-10-22 02:12:08
Source code size: 238 bytes / 9 lines
Pitched / IR pitched: No / No
Views / Downloads: 682 / 929
Version history: 1 change(s)
Referenced in: [show references]