Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # spixsub 1.1
- Function spixsub(clip c, int "left", int "top")
- {
- left=Default(left, 1) #set the "left" to 2 will make it 2 pass since the subtract mode in overlay ignore the negative result of subtracting, set it to -1 and will show the negative result only
- top=Default(top, 0) #same as left parameter
- Assert(!(left>2 || left<-1 || top>2 || top<-1), "spixsub: left and top modes must be between -1 to 2")
- c
- left != 0 ? PointResize(Width(), Height(), src_left=-1) : last
- leftsub1 = left != 0 ? overlay(c,last,mode="Subtract") : last
- leftsub2 = left == -1 || left > 1 ? overlay(last,c,mode="Subtract") : nop()
- left > 1 ? overlay(leftsub1,leftsub2,mode="add") : left == -1 ? leftsub2 : leftsub1
- h=last
- top != 0 ? c : last
- top != 0 ? PointResize(Width(), Height(), src_top=-1) : last
- topsub1 = top != 0 ? overlay(c,last,mode="Subtract") : last
- topsub2 = top == -1 || top > 1 ? overlay(last,c,mode="Subtract") : nop()
- top > 1 ? overlay(topsub1,topsub2,mode="add") : top == -1 ? topsub2 : topsub1
- top != 0 && left != 0 ? overlay(h,last,mode="add") : last
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement