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

15
LINES

< > BotCompany Repo | #1014995 // toBWImage - extended synonym of toBW

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

Libraryless. Click here for Pure Java version (11758L/66K).

ifclass RGBImage
static BWImage toBWImage(RGBImage img) {
  ret toBW(img);
}
endif

static BWImage toBWImage(BufferedImage img) {
  ret img == null ?: new BWImage(img);
}

static BWImage toBWImage(MakesBufferedImage img) {
  if (img == null) null;
  if (img cast BWImage) ret img;
  ret new BWImage(toBufferedImage(img));
}

Author comment

Began life as a copy of #1009127

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014995
Snippet name: toBWImage - extended synonym of toBW
Eternal ID of this version: #1014995/6
Text MD5: 6280d62f27b9bf11a10d428326b5ee85
Transpilation MD5: 1a89a9d790cd3ebe5e59aefcecfbd1ac
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2023-02-13 18:39:19
Source code size: 337 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 461 / 578
Version history: 5 change(s)
Referenced in: [show references]