Advertisement
Guest User

spixsub

a guest
Aug 12th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # spixsub 1.1
  2. Function spixsub(clip c, int "left", int "top")
  3. {
  4. 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
  5. top=Default(top, 0) #same as left parameter
  6. Assert(!(left>2 || left<-1 || top>2 || top<-1), "spixsub: left and top modes must be between -1 to 2")
  7. c
  8. left != 0 ? PointResize(Width(), Height(), src_left=-1) : last
  9. leftsub1 = left != 0 ? overlay(c,last,mode="Subtract") : last
  10. leftsub2 = left == -1 || left > 1 ? overlay(last,c,mode="Subtract") : nop()
  11. left > 1 ? overlay(leftsub1,leftsub2,mode="add") : left == -1 ? leftsub2 : leftsub1
  12. h=last
  13. top != 0 ? c : last
  14. top != 0 ? PointResize(Width(), Height(), src_top=-1) : last
  15. topsub1 = top != 0 ? overlay(c,last,mode="Subtract") : last
  16. topsub2 = top == -1 || top > 1 ? overlay(last,c,mode="Subtract") : nop()
  17. top > 1 ? overlay(topsub1,topsub2,mode="add") : top == -1 ? topsub2 : topsub1
  18.  
  19. top != 0 && left != 0 ? overlay(h,last,mode="add") : last
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement