def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> GET.DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> (1, 1): raise Error, 'Sorry, can only grab rgb8 with packfactor (1,1)' if not VFile.is_entry_indigo(): raise Error, 'Sorry, can only grab rgb8 on entry level Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w - 1, h - 1) data = data[:w * h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None
def grab_rgb8(w, h, pf): if gl.getdisplaymode() <> GET.DMRGB: raise Error, 'Sorry, can only grab rgb8 in single-buf rgbmode' if pf <> (1, 1): raise Error, 'Sorry, can only grab rgb8 with packfactor (1,1)' if not VFile.is_entry_indigo(): raise Error, 'Sorry, can only grab rgb8 on entry level Indigo' # XXX Dirty Dirty here. # XXX Set buffer to cmap mode, grab image and set it back. gl.cmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 8) data = gl.lrectread(0, 0, w-1, h-1) data = data[:w*h] # BUG FIX for python lrectread gl.RGBmode() gl.gconfig() gl.pixmode(GL.PM_SIZE, 32) return data, None
# Class to grab frames from a window.