diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1992-12-14 12:25:21 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1992-12-14 12:25:21 (GMT) |
commit | 3b25371ef12a15800dd6d1a9599c8d1a3dbb696b (patch) | |
tree | c5db3ff7ad97f1d9b03e4225aeb8be63c83beb8d /Demo/sgi/video/VFile.py | |
parent | cf5dd9cbfda918b417a17d4413b7d099d3f47aaa (diff) | |
download | cpython-3b25371ef12a15800dd6d1a9599c8d1a3dbb696b.zip cpython-3b25371ef12a15800dd6d1a9599c8d1a3dbb696b.tar.gz cpython-3b25371ef12a15800dd6d1a9599c8d1a3dbb696b.tar.bz2 |
Changes for supporting monochrome and greyscale video (not yet fully
functional)
Diffstat (limited to 'Demo/sgi/video/VFile.py')
-rwxr-xr-x | Demo/sgi/video/VFile.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Demo/sgi/video/VFile.py b/Demo/sgi/video/VFile.py index a5d1d92..5c05ed0 100755 --- a/Demo/sgi/video/VFile.py +++ b/Demo/sgi/video/VFile.py @@ -73,6 +73,7 @@ def conv_jpeg(r, g, b): raise Error, 'Attempt to make RGB colormap (jpeg)' conv_jpeggrey = conv_grey +conv_mono = conv_grey # Choose one of the above based upon a color system name @@ -213,7 +214,8 @@ class VideoParams: def init(self): # Essential parameters self.format = 'grey' # color system used - # Choose from: grey, rgb, rgb8, hsv, yiq, hls, jpeg, jpeggrey + # Choose from: grey, rgb, rgb8, hsv, yiq, hls, jpeg, jpeggrey, + # mono self.width = 0 # width of frame self.height = 0 # height of frame self.packfactor = 1 # expansion using rectzoom @@ -315,6 +317,9 @@ class Displayer(VideoParams): p = pf if (width, height, bytes) <> (w/p, h/p, b): raise Error, 'jpeg data has wrong size' + elif self.format == 'mono': + import imageop + data = imageop.mono2grey(data, w, h, 0x20, 0xdf) if not self.colormapinited: self.initcolormap() if self.fixcolor0: @@ -544,7 +549,7 @@ def readfileheader(fp, filename): c0bits = c1bits = c2bits = 0 chrompack = 0 offset = 0 - elif format in ('grey', 'jpeggrey'): + elif format in ('grey', 'jpeggrey', 'mono'): c0bits = rest c1bits = c2bits = 0 chrompack = 0 @@ -642,7 +647,7 @@ def writefileheader(fp, values): # if format in ('rgb', 'jpeg'): data = (format, 0) - elif format in ('grey', 'jpeggrey'): + elif format in ('grey', 'jpeggrey', 'mono'): data = (format, c0bits) else: data = (format, (c0bits, c1bits, c2bits, chrompack, offset)) |