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

17
LINES

< > BotCompany Repo | #1020135 // mergeImagesHorizontally_top [with spacing, align on top]

JavaX fragment (include)

static RGBImage mergeImagesHorizontally_top(RGBImage... images) {
  ret mergeImagesHorizontally_top(toList(images));
}

static RGBImage mergeImagesHorizontally_top(L<RGBImage> images) {
  int spacing = imageMergeSpacing();
  RGB spaceColor = new RGB(0.9f);
  int w = intSum(images, "width")+(l(images)-1)*spacing, h = intMax(images, "height");
  RGBImage out = new RGBImage(w, h, spaceColor);
  int x = 0;
  for i over images: {
    RGBImage img = images.get(i);
    copyRGBImage(img, 0, 0, out, x, 0);
    x += img.w() + spacing;
  }
  ret out;
}

Author comment

Began life as a copy of #1006374

download  show line numbers  debug dex  old transpilations   

Travelled to 8 computer(s): bhatertpkbcr, cfunsshuasjs, gwrvuhgaqvyk, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1020135
Snippet name: mergeImagesHorizontally_top [with spacing, align on top]
Eternal ID of this version: #1020135/1
Text MD5: 70cb1651ceb8c162b352874b5f004e9b
Author: stefan
Category: javax / imaging
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-08 23:07:33
Source code size: 563 bytes / 17 lines
Pitched / IR pitched: No / No
Views / Downloads: 319 / 321
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)