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).

!7

p {
  for (int b = 0; b < 256; b++) {
    BWImage img = new BWImage(1, 1);
    img.setByte(0, 0, b);
    assertEquals(b, 0xFF & img.getByte(0, 0));
    BufferedImage bufferedImage = img.getBufferedImage();
    //assertBWImagesIdentical(img, new BWImage(bufferedImage));
    int got = 0xFF & new BWImage(bufferedImage).getByte(0, 0);
    if (b != got)
      print("Should: " + b + ", got: " + got);
  }
  print("OK");
 }

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: 459 / 1484
Version history: 6 change(s)
Referenced in: #1016912 - class BWImage with BWImageSimpleStorage (old)
#3000526 - Smart Bot's answer to: !fresh latestPrograms()