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

11
LINES

< > BotCompany Repo | #1035494 // toImage2B

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

Libraryless. Click here for Pure Java version (10932L/63K).

static Image2B toImage2B(BufferedImage img) {
  ret img == null ? : new Image2B(img);
}

static Image2B toImage2B(MakesBufferedImage img) {
  if (img == null) null;
  if (img cast Image2B) ret img;
  if (img cast BWImage) ret Image2B(img);
  if (img cast IBinaryImage) ret iBinaryImageToImage2B(img);
  ret new Image2B(toBufferedImage(img));
}

Author comment

Began life as a copy of #1014995

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035494
Snippet name: toImage2B
Eternal ID of this version: #1035494/4
Text MD5: 30b3f25e079505a69b9ac1cbcfe163dc
Transpilation MD5: 06cfad746195fd9234606613d4a47e31
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:14:20
Source code size: 353 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 138 / 186
Version history: 3 change(s)
Referenced in: [show references]