diff options
author | Guido van Rossum <guido@python.org> | 1992-09-29 17:07:10 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-09-29 17:07:10 (GMT) |
commit | 4df20fa80f0e24b065c7ca5ab861f047eda15763 (patch) | |
tree | 828f9610da877829ce435041b8d80ee0dc154054 /Demo/sgi/video/VFile.py | |
parent | 384f24816b7a50c7c2c23740bbc1080fcb7a2d3f (diff) | |
download | cpython-4df20fa80f0e24b065c7ca5ab861f047eda15763.zip cpython-4df20fa80f0e24b065c7ca5ab861f047eda15763.tar.gz cpython-4df20fa80f0e24b065c7ca5ab861f047eda15763.tar.bz2 |
New tool Vfix: truncate the right edge of 'grey' type images to make
the scanline width a multiple of 4.
VFile: use gl.gversion() to distinguish 4.0.1 and 4.0.5 Indigos;
truncate width and height to multiples of packfactor.
Vinfo: add -t to descriptive comment; print '!' after packfactor for
files that should be fixed with Vfix.
Diffstat (limited to 'Demo/sgi/video/VFile.py')
-rwxr-xr-x | Demo/sgi/video/VFile.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py index 12e087c..6443fb6 100755 --- a/Demo/sgi/video/VFile.py +++ b/Demo/sgi/video/VFile.py @@ -309,10 +309,11 @@ class Displayer(VideoParams): data, width, height, bytes = jpeg.decompress(data) if self.format == 'jpeg': b = 4 + p = 1 else: b = 1 - width, height = width*pf, height*pf - if (width, height, bytes) <> (w, h, b): + p = pf + if (width, height, bytes) <> (w/p, h/p, b): raise Error, 'jpeg data has wrong size' if not self.colormapinited: self.initcolormap() @@ -359,14 +360,15 @@ class Displayer(VideoParams): gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return -## XXX Unfortunately this doesn't work on IRIX 4.0.1... -## if self.format == 'rgb8' and is_entry_indigo(): -## gl.RGBmode() -## gl.gconfig() -## gl.RGBcolor(200, 200, 200) # XXX rather light grey -## gl.clear() -## gl.pixmode(GL.PM_SIZE, 8) -## return + # This only works on an Entry-level Indigo from IRIX 4.0.5 + if self.format == 'rgb8' and is_entry_indigo() and \ + gl.gversion() == 'GL4DLG-4.0.': # Note trailing '.'! + gl.RGBmode() + gl.gconfig() + gl.RGBcolor(200, 200, 200) # XXX rather light grey + gl.clear() + gl.pixmode(GL.PM_SIZE, 8) + return gl.cmode() gl.gconfig() self.skipchrom = 0 @@ -571,6 +573,9 @@ def readfileheader(fp, filename): packfactor = 2 else: raise Error, filename + ': Bad (w,h,pf) info' + if packfactor > 1: + width = (width / packfactor) * packfactor + height = (height / packfactor) * packfactor # # Return (version, values) # |