TACC/DisplayCluster — Issue #15: Feature Request: Python: Dynamic Image Generation Push
Author: platinummonkey
Created: 2012-02-16 16:14:51+00:00
State: open

Perhaps this would fit well with the DesktopStreamer code with a python interface? This could enable live data visualizations for DisplayCluster.

Example code:
# Using PIL
import Image, ImageDraw, cStringIO

# Create PIL canvas
ims = cStringIO.StringIO()
im = Image.new('RGB',fill=0)
draw = ImageDraw.Draw(im)
im.save(ims,'PNG')

# Connect to DisplayCluster and create new Canvas to display ims
dc = pydc.connect(1234)
win = dc.newWindow(x,y,h,w,ims) # display blank canvas

# Draw rectangle and push to canvas by updating image stream.
draw.rectangle((0,0,10,10),fill=128)
im.save(ims,'PNG') # if required: win.update(ims)
...
# disconnect when finished
win.close()
dc.disconnect()
exit 0