Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1554b7b

Browse files
committed
Use constants defined in cl module. (Sjoerd)
1 parent 1e57a04 commit 1554b7b

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

Demo/sgi/video/VFile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,15 @@ def decompress(self, data):
345345
if self.format <> 'compress':
346346
return data
347347
if not self.decompressor:
348-
import cl, CL
348+
import cl
349349
scheme = cl.QueryScheme(self.compressheader)
350350
self.decompressor = cl.OpenDecompressor(scheme)
351351
headersize = self.decompressor.ReadHeader(self.compressheader)
352-
width = self.decompressor.GetParam(CL.IMAGE_WIDTH)
353-
height = self.decompressor.GetParam(CL.IMAGE_HEIGHT)
354-
params = [CL.ORIGINAL_FORMAT, CL.RGBX, \
355-
CL.ORIENTATION, CL.BOTTOM_UP, \
356-
CL.FRAME_BUFFER_SIZE, width*height*CL.BytesPerPixel(CL.RGBX)]
352+
width = self.decompressor.GetParam(cl.IMAGE_WIDTH)
353+
height = self.decompressor.GetParam(cl.IMAGE_HEIGHT)
354+
params = [cl.ORIGINAL_FORMAT, cl.RGBX, \
355+
cl.ORIENTATION, cl.BOTTOM_UP, \
356+
cl.FRAME_BUFFER_SIZE, width*height*cl.BytesPerPixel(cl.RGBX)]
357357
self.decompressor.SetParams(params)
358358
data = self.decompressor.Decompress(1, data)
359359
return data

Demo/sgi/video/Vb.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import VCR
3434
try:
3535
import cl
36-
import CL
3736
except ImportError:
3837
cl = None
3938

@@ -200,10 +199,10 @@ def setdefaults(self):
200199
self.c_rgb24_size.addto_choice(label)
201200
self.c_rgb24_size.set_choice(self.rgb24_size)
202201
if cl:
203-
algs = cl.QueryAlgorithms(CL.VIDEO)
202+
algs = cl.QueryAlgorithms(cl.VIDEO)
204203
self.all_comp_schemes = []
205204
for i in range(0, len(algs), 2):
206-
if algs[i+1] in (CL.COMPRESSOR, CL.CODEC):
205+
if algs[i+1] in (cl.COMPRESSOR, cl.CODEC):
207206
self.all_comp_schemes.append(algs[i])
208207
self.c_cformat.clear_choice()
209208
for label in self.all_comp_schemes:
@@ -778,11 +777,11 @@ def get_aformat(self):
778777

779778
def init_compressor(self, w, h):
780779
self.compressor = None
781-
scheme = cl.QuerySchemeFromName(CL.VIDEO, self.comp_scheme)
780+
scheme = cl.QuerySchemeFromName(cl.VIDEO, self.comp_scheme)
782781
self.compressor = cl.OpenCompressor(scheme)
783-
parambuf = [CL.IMAGE_WIDTH, w, \
784-
CL.IMAGE_HEIGHT, h, \
785-
CL.ORIGINAL_FORMAT, CL.YUV422DC]
782+
parambuf = [cl.IMAGE_WIDTH, w, \
783+
cl.IMAGE_HEIGHT, h, \
784+
cl.ORIGINAL_FORMAT, cl.YUV422DC]
786785
self.compressor.SetParams(parambuf)
787786
return self.compressor.Compress(0, '')
788787

0 commit comments

Comments
 (0)