1 | static RGBImage mergeImagesVertically(RGBImage... images) { |
2 | ret mergeImagesVertically(toList(images)); |
3 | } |
4 | |
5 | static RGBImage mergeImagesVertically(L<RGBImage> images, O... _) { |
6 | optPar int spacing = imageMergeSpacing(); |
7 | RGB spaceColor = optPar spaceColor(_, RGB(0.9f)); |
8 | int h = intSum(images, "height")+(l(images)-1)*spacing, w = intMax(images, "width"); |
9 | RGBImage out = new RGBImage(w, h, spaceColor); |
10 | int y = 0; |
11 | for i over images: { |
12 | RGBImage img = images.get(i); |
13 | int x = (w-img.w())/2; |
14 | copyRGBImage(img, 0, 0, out, x, y); |
15 | y += img.h() + spacing; |
16 | } |
17 | ret out; |
18 | } |
Began life as a copy of #1006078
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1006081 |
Snippet name: | mergeImagesVertically [with spacing] |
Eternal ID of this version: | #1006081/3 |
Text MD5: | 69f3a3f533dee36ee0cd73250be90dae |
Author: | stefan |
Category: | javax / imaging |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-24 00:48:45 |
Source code size: | 606 bytes / 18 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 521 / 549 |
Version history: | 2 change(s) |
Referenced in: | [show references] |