/[gzz]/gzz/gfx/libutil/saveanim.py
ViewVC logotype

Diff of /gzz/gfx/libutil/saveanim.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by tjl, Fri Oct 4 22:16:50 2002 UTC revision 1.2 by tjl, Wed Oct 16 07:46:39 2002 UTC
# Line 4  from java.io import FileOutputStream Line 4  from java.io import FileOutputStream
4  from gzz.gfx.gl import GL  from gzz.gfx.gl import GL
5  import os  import os
6    
7  def saveframe(filename, win):  def save():
8      x,y = 0,0      x,y = 0,0
9      s = win.getSize()      s = win.getSize()
10      w,h = s.width, s.height      colors = win.readPixels(0, 0, s.width, s.height)
   
     v = GL.createByteVector(w * h * 3)  
     v.readFromBuffer_ubytes(win.window, "FRONT", x, y, w, h, "RGB")  
     barr = v.get()  
     f = FileOutputStream("img.tmp")  
     f.write(barr)  
     f.close()  
     os.system("rawtoppm %(w)s %(h)s img.tmp | pnmflip -tb | pnmtojpeg >%(filename)s" % locals())  
11    
12  def savesequence(win, filebase, vs1, vs2, n):  def savesequence(win, filebase, vs1, vs2, n):
13      for frame in range(0, n+1):      for frame in range(0, n+1):

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26