summaryrefslogtreecommitdiffstats
path: root/Demo/sgi/video/Vcopy.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>1993-09-28 16:46:15 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>1993-09-28 16:46:15 (GMT)
commit72d73649ffdea4ef6038d3fc9417c860ac1ff4e4 (patch)
tree124281ea0195f473095be3b528d287b9cf879537 /Demo/sgi/video/Vcopy.py
parentdbf71b7b4b3cbce6ad9b94f50ef4ebb8baec1265 (diff)
downloadcpython-72d73649ffdea4ef6038d3fc9417c860ac1ff4e4.zip
cpython-72d73649ffdea4ef6038d3fc9417c860ac1ff4e4.tar.gz
cpython-72d73649ffdea4ef6038d3fc9417c860ac1ff4e4.tar.bz2
- VFile: moved decompression code to VideoParams (so it is also
useable via VinFile). - Vcopy: now allows decompression of 'compress' movies.
Diffstat (limited to 'Demo/sgi/video/Vcopy.py')
-rwxr-xr-xDemo/sgi/video/Vcopy.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/Demo/sgi/video/Vcopy.py b/Demo/sgi/video/Vcopy.py
index e8d4f55..ef26f55 100755
--- a/Demo/sgi/video/Vcopy.py
+++ b/Demo/sgi/video/Vcopy.py
@@ -173,11 +173,25 @@ def process(infilename, outfilename):
scale = 0
flip = 0
+ decompress = 0
+ vinfmt = vin.format
+ if vinfmt == 'compress':
+ if not newtype or newtype == 'compress':
+ # compressed->compressed: copy compression header
+ vout.setcompressheader(vin.getcompressheader())
+ else:
+ # compressed->something else: go via rgb-24
+ decompress = 1
+ vinfmt = 'rgb'
+ elif newtype == 'compress':
+ # something else->compressed: not implemented
+ sys.stderr.write('Sorry, conversion to compressed not yet implemented\n')
+ return 1
if newtype:
vout.setformat(newtype)
try:
- convert = imgconv.getconverter(vin.format, vout.format)
+ convert = imgconv.getconverter(vinfmt, vout.format)
except imgconv.error, msg:
sys.stderr.write(str(msg) + '\n')
return 1
@@ -236,6 +250,8 @@ def process(infilename, outfilename):
tin, data, cdata = vin.getnextframe()
except EOFError:
break
+ if decompress:
+ data = vin.decompress(data)
nin = nin + 1
if regen:
tout = nin * regen