diff options
author | N.N. <matju@users.sourceforge.net> | 2005-10-04 02:02:15 +0000 |
---|---|---|
committer | N.N. <matju@users.sourceforge.net> | 2005-10-04 02:02:15 +0000 |
commit | 5e2a1bc9e56003349e533f7e5841041ba5c04e28 (patch) | |
tree | ad040f6894d9383b732423a74420e732f62a66a5 /externals/gridflow/extra/smpte.rb | |
parent | 520a243c297175386ab31c78c84693a664934a69 (diff) |
starting to commit gridflow 0.8.0 ...
if you know how to use "cvs import" please mail me and i'll use it for 0.8.1
svn path=/trunk/; revision=3646
Diffstat (limited to 'externals/gridflow/extra/smpte.rb')
-rw-r--r-- | externals/gridflow/extra/smpte.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/externals/gridflow/extra/smpte.rb b/externals/gridflow/extra/smpte.rb new file mode 100644 index 00000000..c14c936e --- /dev/null +++ b/externals/gridflow/extra/smpte.rb @@ -0,0 +1,23 @@ +# Copyright 2001 by Mathieu Bouchard +# $Id: smpte.rb,v 1.1 2005-10-04 02:02:15 matju Exp $ + +# The standard SMPTE color test pattern. +# AS SEEN ON TV !!! (but this is a cheap plastic imitation) + +def make_smpte(picture="") + row_1 = "" + row_2 = "" + row_3 = "" + row_3_c = [[0,63,105],[255,255,255],[64,0,119]] + (0...320).each {|x| + n_barre_1 = 7 - x*7/320 + n_barre_2 = if n_barre_1&1==0 then 0 else 8 - n_barre_1 end + row_1 << yield (*([1,2,0].map{|c| 255 * ((n_barre_1 >> c)&1) })) + row_2 << yield (*([1,2,0].map{|c| 255 * ((n_barre_2 >> c)&1) })) + row_3 << yield (*(row_3_c[x/57] || [0,0,0])) + } + 160.times { picture << row_1 } + 20 .times { picture << row_2 } + 60 .times { picture << row_3 } + picture +end |