def clear(self): if not self.colormapinited: raise CallError if gl.getdisplaymode() in (GET.DMRGB, GET.DMRGBDOUBLE): gl.RGBcolor(200, 200, 200) # XXX rather light grey gl.clear() return gl.writemask(0xffffffff) gl.clear()
def clearto(self, r, g, b): if not self.colormapinited: raise CallError if gl.getdisplaymode() in (GET.DMRGB, GET.DMRGBDOUBLE): gl.RGBcolor(r, g, b) gl.clear() return index = self.color0[0] self.fixcolor0 = 1 gl.mapcolor(index, r, g, b) gl.writemask(0xffffffff) gl.clear() gl.gflush()
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
def grab_rgb(w, h, pf): if gl.getdisplaymode() <> GET.DMRGB: raise Error, 'Sorry, can only grab rgb in single-buf rgbmode' if pf <> (1, 1): raise Error, 'Sorry, only grab rgb with packfactor (1,1)' return gl.lrectread(0, 0, w-1, h-1), None
def grab_rgb(w, h, pf): if gl.getdisplaymode() <> GET.DMRGB: raise Error, 'Sorry, can only grab rgb in single-buf rgbmode' if pf <> (1, 1): raise Error, 'Sorry, only grab rgb with packfactor (1,1)' return gl.lrectread(0, 0, w - 1, h - 1), None
# Classes to read and write CMIF video files.
# Class to grab frames from a window.