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

15
LINES

< > BotCompany Repo | #1015235 // Check BWImage <-> BufferedImage (Now OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (2488L/15K).

1  
!7
2  
3  
p {
4  
  for (int b = 0; b < 256; b++) {
5  
    BWImage img = new BWImage(1, 1);
6  
    img.setByte(0, 0, b);
7  
    assertEquals(b, 0xFF & img.getByte(0, 0));
8  
    BufferedImage bufferedImage = img.getBufferedImage();
9  
    //assertBWImagesIdentical(img, new BWImage(bufferedImage));
10  
    int got = 0xFF & new BWImage(bufferedImage).getByte(0, 0);
11  
    if (b != got)
12  
      print("Should: " + b + ", got: " + got);
13  
  }
14  
  print("OK");
15  
 }

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: #1015235
Snippet name: Check BWImage <-> BufferedImage (Now OK)
Eternal ID of this version: #1015235/7
Text MD5: 2795d13ba3b80d3ae504c832f3856b44
Transpilation MD5: 1ac0dea7aa388b8df9521d94d481f674
Author: stefan
Category: javax / imaging
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-05-10 23:50:59
Source code size: 437 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 460 / 1485
Version history: 6 change(s)
Referenced in: [show references]