@@ -273,7 +273,7 @@ def init(self):
273273 # setinfo() must reset some internal flags
274274
275275 def setinfo (self , values ):
276- VideoParams .setinfo (values )
276+ VideoParams .setinfo (self , values )
277277 self .colormapinited = 0
278278 self .skipchrom = 0
279279 self .color0 = None
@@ -282,33 +282,41 @@ def setinfo(self, values):
282282 # Show one frame, initializing the window if necessary
283283
284284 def showframe (self , data , chromdata ):
285+ self .showpartframe (data , chromdata , \
286+ (0 ,0 ,self .width ,self .height ))
287+
288+ def showpartframe (self , data , chromdata , (x ,y ,w ,h )):
285289 if not self .colormapinited :
286290 self .initcolormap ()
287291 if self .fixcolor0 :
288292 gl .mapcolor (self .color0 )
289293 self .fixcolor0 = 0
290- w , h , pf = self . width , self . height , self .packfactor
294+ pf = self .packfactor
291295 factor = self .magnify
292296 if pf : factor = factor * pf
293297 if chromdata and not self .skipchrom :
294298 cp = self .chrompack
299+ cx = int (x * factor * cp ) + self .xorigin
300+ cy = int (y * factor * cp ) + self .yorigin
295301 cw = (w + cp - 1 )/ cp
296302 ch = (h + cp - 1 )/ cp
297303 gl .rectzoom (factor * cp , factor * cp )
298304 gl .pixmode (GL .PM_SIZE , 16 )
299305 gl .writemask (self .mask - ((1 << self .c0bits ) - 1 ))
300- gl .lrectwrite (self .xorigin , self .yorigin , \
301- self .xorigin + cw - 1 , self .yorigin + ch - 1 , \
302- chromdata )
306+ gl .lrectwrite (cx , cy , cx + cw - 1 , cy + ch - 1 , \
307+ chromdata )
303308 #
304309 if pf :
305310 gl .writemask ((1 << self .c0bits ) - 1 )
306311 gl .pixmode (GL .PM_SIZE , 8 )
307312 w = w / pf
308313 h = h / pf
314+ x = x / pf
315+ y = y / pf
309316 gl .rectzoom (factor , factor )
310- gl .lrectwrite (self .xorigin , self .yorigin , \
311- self .xorigin + w - 1 , self .yorigin + h - 1 , data )
317+ x = int (x * factor )+ self .xorigin
318+ y = int (y * factor )+ self .yorigin
319+ gl .lrectwrite (x , y , x + w - 1 , y + h - 1 , data )
312320 gl .gflush ()
313321
314322 # Initialize the window: set RGB or colormap mode as required,
0 commit comments