]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change Vinfo and Vaddcache to usr /ufs/guido/bin/sgi/python.
authorGuido van Rossum <guido@python.org>
Thu, 25 Feb 1993 14:50:27 +0000 (14:50 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 25 Feb 1993 14:50:27 +0000 (14:50 +0000)
Don't force packfactor to 1 in header when writing rgb data.
Small bugfixes in Vcopy.

Demo/sgi/video/VFile.py
Demo/sgi/video/Vaddcache.py
Demo/sgi/video/Vcopy.py
Demo/sgi/video/Vinfo.py

index 46f8547d5f3e5039c80fa4402c6670258459f7f0..e6191ab6f970d623259306c4d21f719f8dd1b242 100755 (executable)
@@ -255,11 +255,6 @@ class VideoParams:
 
        def setpf(self, pf):
                if self.frozen: raise CallError
-##             if type(pf) is type(0):
-##                     if pf == 0:
-##                             pf = (1, 1)
-##                     else:
-##                             pf = (pf, pf)
                if type(pf) is not type(()) or len(pf) <> 2: raise CallError
                self.packfactor = pf
                self.setderived()
@@ -707,10 +702,6 @@ def writefileheader(fp, values):
        #
        # Write frame geometry info
        #
-       if format in ('rgb', 'jpeg'):
-               packfactor = 0
-       elif packfactor == 0:
-               packfactor = 1
        data = (width, height, packfactor)
        fp.write(`data`+'\n')
 
index d89a78ab8ef5b0ad3c26d411be726d4e336a2211..4e5f0c30825df48c7fca0f9fdf995c99106a8495 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/local/python
+#! /ufs/guido/bin/sgi/python
 
 # Add a cache to each of the files given as command line arguments
 
index fb7afab7ad72e20b3b49b94629c79ccd7ba860d8..f9c954a3798d68836d92c4688d0f55b504e0d707 100755 (executable)
@@ -27,8 +27,8 @@ def usage():
        print '-h height  : output image height (default width*3/4 if -w used)'
        print
        print '-p pf      : new x and y packfactor (default unchanged)'
-       print '-x xpf     : new x packfactor (default 1 if -y used)'
-       print '-y ypf     : new y packfactor (default 1 if -x used)'
+       print '-x xpf     : new x packfactor (default unchanged)'
+       print '-y ypf     : new y packfactor (default unchanged)'
        print
        print '-m delta   : drop frames closer than delta msec (default 0)'
        print '-r delta   : regenerate input time base delta msec apart'
@@ -112,8 +112,6 @@ def main():
                sys.exit(2)
 
        if xpf or ypf:
-               if not xpf: xpf = 1
-               if not ypf: ypf = 1
                newpf = (xpf, ypf)
 
        if newwidth or newheight:
@@ -148,7 +146,7 @@ def main():
 # Copy one file to another
 
 def process(infilename, outfilename):
-       global newwidth, newheight
+       global newwidth, newheight, newpf
 
        try:
                vin = VFile.BasicVinFile().init(infilename)
@@ -168,6 +166,8 @@ def process(infilename, outfilename):
                sys.stderr.write(outfilename + ': I/O error: ' + `msg` + '\n')
                return 1
 
+       vin.printinfo()
+
        vout.setinfo(vin.getinfo())
 
        scale = 0
@@ -182,6 +182,10 @@ def process(infilename, outfilename):
                        return 1
 
        if newpf:
+               xpf, ypf = newpf
+               if not xpf: xpf = vin.xpf
+               if not ypf: ypf = vout.ypf
+               newpf = (xpf, ypf)
                vout.setpf(newpf)
                scale = 1
 
@@ -217,6 +221,7 @@ def process(infilename, outfilename):
        newwidth = newwidth / vout.xpf
        newheight = newheight / vout.ypf
 
+       vout.printinfo()
        vout.writeheader()
 
        told = 0
@@ -241,11 +246,10 @@ def process(infilename, outfilename):
                told = tout
                if newtype:
                        data = convert(data, inwidth, inheight)
-               if newwidth and newheight:
+               if scale:
                        data = imageop.scale(data, vout.bpp/8, \
                                  inwidth, inheight, newwidth, newheight)
-               if vin.upside_down <> vout.upside_down or \
-                         vin.mirror_image <> vout.mirror_image:
+               if flip:
                        x0, y0 = 0, 0
                        x1, y1 = newwidth-1, neheight-1
                        if vin.upside_down <> vout.upside_down:
index 8d163a178fcf5a5096ec5789dd77df18a33c1e86..e0c9e8ccaa1e6c06592f75e9c9f5000b95214bf0 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/local/python
+#! /ufs/guido/bin/sgi/python
 
 # Print some info about a CMIF movie file