diff options
author | Guido van Rossum <guido@python.org> | 2002-09-17 20:36:40 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-09-17 20:36:40 (GMT) |
commit | 16aac45fc269ad355f069d5f76a0f4cafd06063f (patch) | |
tree | 1941156fe4df24b0c5a34d25174e3c1473c6e8d7 /Demo/sgi/video/vinfo.py | |
parent | d679e09970465d1b914b7d3dc11eaddbbcd6d289 (diff) | |
download | cpython-16aac45fc269ad355f069d5f76a0f4cafd06063f.zip cpython-16aac45fc269ad355f069d5f76a0f4cafd06063f.tar.gz cpython-16aac45fc269ad355f069d5f76a0f4cafd06063f.tar.bz2 |
Remove the SGI demos. These were all ancient and nobody cared enough.
Diffstat (limited to 'Demo/sgi/video/vinfo.py')
-rwxr-xr-x | Demo/sgi/video/vinfo.py | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/Demo/sgi/video/vinfo.py b/Demo/sgi/video/vinfo.py deleted file mode 100755 index 7f98237..0000000 --- a/Demo/sgi/video/vinfo.py +++ /dev/null @@ -1,90 +0,0 @@ -from gl import * -from GL import * -from DEVICE import * -import time -import sys -import getopt - -class Struct(): pass -epoch = Struct() -EndOfFile = 'End of file' -bye = 'bye' - -def openvideo(filename): - f = open(filename, 'r') - line = f.readline() - if not line: raise EndOfFile - if line[:4] == 'CMIF': line = f.readline() - x = eval(line[:-1]) - if len(x) == 3: w, h, pf = x - else: w, h = x; pf = 2 - return f, w, h, pf - -def loadframe(f, w, h, pf): - line = f.readline() - if line == '': - raise EndOfFile - x = eval(line[:-1]) - if type(x) == type(0) or type(x) == type(0.0): - tijd = x - if pf == 0: - size = w*h*4 - else: - size = (w/pf) * (h/pf) - else: - tijd, size = x - f.seek(size, 1) - return tijd - -def main(): - delta = 0 - short = 0 - try: - opts, names = getopt.getopt(sys.argv[1:], 'ds') - except getopt.error, msg: - sys.stderr.write(msg + '\n') - sys.stderr.write('usage: vinfo [-d] [-s] [file] ...\n') - sys.exit(2) - for opt, arg in opts: - if opt == '-d': delta = 1 # print delta between frames - elif opt == '-s': short = 1 # short: don't print times - if names == []: - names = ['film.video'] - for name in names: - try: - f, w, h, pf = openvideo(name) - except: - sys.stderr.write(name + ': cannot open\n') - continue - if pf == 0: - size = w*h*4 - else: - size = (w/pf) * (h/pf) - print name, ':', w, 'x', h, '; pf =', pf, ', size =', size, - if pf == 0: - print '(color)', - else: - print '(' + `(w/pf)` + 'x' + `(h/pf)` + ')', - if (w/pf)%4 <> 0: print '!!!', - print - num = 0 - try: - otijd = 0 - while not short: - try: - tijd = loadframe(f, w, h, pf) - if delta: print '\t' + `tijd-otijd`, - else: print '\t' + `tijd`, - otijd = tijd - num = num + 1 - if num % 8 == 0: - print - except EndOfFile: - raise bye - except bye: - pass - if num % 8 <> 0: - print - f.close() - -main() |