Skip to content

Commit ab70272

Browse files
committed
add snake option to array join
handy for joining images grabbed snakewise
1 parent 7e761e8 commit ab70272

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
started 8.5 24/1/17
22
- add max_slope to lhist
33
- gaussnoise goes via vips8 now
4+
- add snake option to array join [Joe Padfield]
45

56
started 8.4.1 25/9/16
67
- simplify nip2-icon.rc build, bgilbert

share/nip2/start/Image.def

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1527,16 +1527,26 @@ Image_join_item = class
15271527
bg_colour = Expression "Background colour" 0;
15281528
halign = Option "Horizontal alignment" valign_names 1;
15291529
valign = Option "Vertical alignment" halign_names 1;
1530+
snake = Toggle "Reverse the order of every other row" false;
15301531

15311532
_l
15321533
= split_lines ncol.value x.value, is_Group x
15331534
= split_lines ncol.value x;
15341535

1536+
_l'
1537+
= map2 reverse_if_odd [0..] _l, snake
1538+
= _l
1539+
{
1540+
reverse_if_odd n x
1541+
= reverse x, n % 2 == 1
1542+
= x;
1543+
}
1544+
15351545
_result
15361546
= (image_set_origin 0 0 @
15371547
foldl1 (join_tb vshim.value bg_colour.expr halign.value) @
15381548
map (foldl1 (join_lr hshim.value
1539-
bg_colour.expr valign.value))) (to_list (to_list _l));
1549+
bg_colour.expr valign.value))) (to_list (to_list _l'));
15401550
}
15411551
}
15421552
}

0 commit comments

Comments
 (0)