View/Edit #5730:superimpose

Switch to edit mode.

Name(s): superimpose
1:  ":superimpose(pic1, pic2, x,y[, width[, height]])"
2:  {pic1, pic2, x, y, ?width = min(length(pic1[1]) - x + 1, length(pic2[1])), ?height = min(length(pic1) - y + 1, length(pic2))} = args
3:  p1d = this:dim(pic1)
4:  p2d = this:dim(pic2)
5:  x < 0 && (x = p1d[1] - p2d[1] + x + 2)
6:  y < 0 && (y = p1d[2] - p2d[2] + y + 2)
7:  for j in [y..y + height - 1]
8:    pic1[j][x..min(x + width - 1, $)] = pic2[j - y + 1][1..width]
9:  endfor
10: return pic1

Verb arguments: this none this
Verb perms: Readable eXecutable NOT-Debug
Verb owned by: manta (#7165)

You are not logged in.

[home | help | who | search | setup | code]