Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
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
Ejemplo n.º 4
0
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
Ejemplo n.º 5
0
# Class to grab frames from a window.