mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Change Vinfo and Vaddcache to usr /ufs/guido/bin/sgi/python.
Don't force packfactor to 1 in header when writing rgb data. Small bugfixes in Vcopy.
This commit is contained in:
parent
5e044b7009
commit
c97d2eddee
4 changed files with 14 additions and 19 deletions
|
@ -255,11 +255,6 @@ class VideoParams:
|
||||||
|
|
||||||
def setpf(self, pf):
|
def setpf(self, pf):
|
||||||
if self.frozen: raise CallError
|
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
|
if type(pf) is not type(()) or len(pf) <> 2: raise CallError
|
||||||
self.packfactor = pf
|
self.packfactor = pf
|
||||||
self.setderived()
|
self.setderived()
|
||||||
|
@ -707,10 +702,6 @@ def writefileheader(fp, values):
|
||||||
#
|
#
|
||||||
# Write frame geometry info
|
# Write frame geometry info
|
||||||
#
|
#
|
||||||
if format in ('rgb', 'jpeg'):
|
|
||||||
packfactor = 0
|
|
||||||
elif packfactor == 0:
|
|
||||||
packfactor = 1
|
|
||||||
data = (width, height, packfactor)
|
data = (width, height, packfactor)
|
||||||
fp.write(`data`+'\n')
|
fp.write(`data`+'\n')
|
||||||
|
|
||||||
|
|
|
@ -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
|
# Add a cache to each of the files given as command line arguments
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@ def usage():
|
||||||
print '-h height : output image height (default width*3/4 if -w used)'
|
print '-h height : output image height (default width*3/4 if -w used)'
|
||||||
print
|
print
|
||||||
print '-p pf : new x and y packfactor (default unchanged)'
|
print '-p pf : new x and y packfactor (default unchanged)'
|
||||||
print '-x xpf : new x packfactor (default 1 if -y used)'
|
print '-x xpf : new x packfactor (default unchanged)'
|
||||||
print '-y ypf : new y packfactor (default 1 if -x used)'
|
print '-y ypf : new y packfactor (default unchanged)'
|
||||||
print
|
print
|
||||||
print '-m delta : drop frames closer than delta msec (default 0)'
|
print '-m delta : drop frames closer than delta msec (default 0)'
|
||||||
print '-r delta : regenerate input time base delta msec apart'
|
print '-r delta : regenerate input time base delta msec apart'
|
||||||
|
@ -112,8 +112,6 @@ def main():
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
|
||||||
if xpf or ypf:
|
if xpf or ypf:
|
||||||
if not xpf: xpf = 1
|
|
||||||
if not ypf: ypf = 1
|
|
||||||
newpf = (xpf, ypf)
|
newpf = (xpf, ypf)
|
||||||
|
|
||||||
if newwidth or newheight:
|
if newwidth or newheight:
|
||||||
|
@ -148,7 +146,7 @@ def main():
|
||||||
# Copy one file to another
|
# Copy one file to another
|
||||||
|
|
||||||
def process(infilename, outfilename):
|
def process(infilename, outfilename):
|
||||||
global newwidth, newheight
|
global newwidth, newheight, newpf
|
||||||
|
|
||||||
try:
|
try:
|
||||||
vin = VFile.BasicVinFile().init(infilename)
|
vin = VFile.BasicVinFile().init(infilename)
|
||||||
|
@ -168,6 +166,8 @@ def process(infilename, outfilename):
|
||||||
sys.stderr.write(outfilename + ': I/O error: ' + `msg` + '\n')
|
sys.stderr.write(outfilename + ': I/O error: ' + `msg` + '\n')
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
vin.printinfo()
|
||||||
|
|
||||||
vout.setinfo(vin.getinfo())
|
vout.setinfo(vin.getinfo())
|
||||||
|
|
||||||
scale = 0
|
scale = 0
|
||||||
|
@ -182,6 +182,10 @@ def process(infilename, outfilename):
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
if newpf:
|
if newpf:
|
||||||
|
xpf, ypf = newpf
|
||||||
|
if not xpf: xpf = vin.xpf
|
||||||
|
if not ypf: ypf = vout.ypf
|
||||||
|
newpf = (xpf, ypf)
|
||||||
vout.setpf(newpf)
|
vout.setpf(newpf)
|
||||||
scale = 1
|
scale = 1
|
||||||
|
|
||||||
|
@ -217,6 +221,7 @@ def process(infilename, outfilename):
|
||||||
newwidth = newwidth / vout.xpf
|
newwidth = newwidth / vout.xpf
|
||||||
newheight = newheight / vout.ypf
|
newheight = newheight / vout.ypf
|
||||||
|
|
||||||
|
vout.printinfo()
|
||||||
vout.writeheader()
|
vout.writeheader()
|
||||||
|
|
||||||
told = 0
|
told = 0
|
||||||
|
@ -241,11 +246,10 @@ def process(infilename, outfilename):
|
||||||
told = tout
|
told = tout
|
||||||
if newtype:
|
if newtype:
|
||||||
data = convert(data, inwidth, inheight)
|
data = convert(data, inwidth, inheight)
|
||||||
if newwidth and newheight:
|
if scale:
|
||||||
data = imageop.scale(data, vout.bpp/8, \
|
data = imageop.scale(data, vout.bpp/8, \
|
||||||
inwidth, inheight, newwidth, newheight)
|
inwidth, inheight, newwidth, newheight)
|
||||||
if vin.upside_down <> vout.upside_down or \
|
if flip:
|
||||||
vin.mirror_image <> vout.mirror_image:
|
|
||||||
x0, y0 = 0, 0
|
x0, y0 = 0, 0
|
||||||
x1, y1 = newwidth-1, neheight-1
|
x1, y1 = newwidth-1, neheight-1
|
||||||
if vin.upside_down <> vout.upside_down:
|
if vin.upside_down <> vout.upside_down:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#! /usr/local/python
|
#! /ufs/guido/bin/sgi/python
|
||||||
|
|
||||||
# Print some info about a CMIF movie file
|
# Print some info about a CMIF movie file
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue