Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2014
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. import vapoursynth as vs
  2.  
  3. core = vs.get_core()
  4.  
  5. def make_gray_lines(width, height):
  6.     white_clip = core.std.BlankClip(width=width, height=1, format=vs.GRAY8, color=255)
  7.     black_clip = core.std.BlankClip(width=width, height=1, format=vs.GRAY8, color=0)
  8.     line_source = []
  9.     for line in range(height):
  10.         if (line % 8 == 0) or (line % 8 == 7):
  11.             line_source.append(white_clip)
  12.         else:
  13.             line_source.append(black_clip)
  14.     return core.std.StackVertical(line_source)
  15.    
  16. def make_gray_grid(width, height):
  17.     h_lines = make_gray_lines(width, height)
  18.     v_lines = core.std.Transpose(make_gray_lines(height, width))
  19.     return core.std.Expr([h_lines, v_lines], expr='x y max')
  20.  
  21. def make_grid(width, height):
  22.     return core.std.ShufflePlanes([make_gray_grid(width, height), make_gray_grid(width // 2, height // 2)], planes=[0, 0, 0], colorfamily=vs.YUV)
  23.    
  24. make_grid(640, 480).set_output()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement