예제 #1
0
 def EpsFile(self, data, trafo, relative_filename=1):
     write = self.file.write
     write('eps(')
     if trafo.matrix() != IdentityMatrix:
         write('(%g,%g,%g,%g,%g,%g)' % trafo.coeff())
     else:
         write('(%g,%g)' % (trafo.v1, trafo.v2))
     filename = data.Filename()
     if self.directory and relative_filename:
         filename = relpath(self.directory, filename)
     write(',%s)\n' % ` filename `)
예제 #2
0
파일: sksaver.py 프로젝트: shumik/skencil-c
    def EpsFile(self, data, trafo, relative_filename = 1):
	write = self.file.write
	write('eps(')
	if trafo.matrix() != IdentityMatrix:
	    write('(%g,%g,%g,%g,%g,%g)' % trafo.coeff())
	else:
	    write('(%g,%g)' % (trafo.v1, trafo.v2))
	filename = data.Filename()
	if self.directory and relative_filename:
	    filename = relpath(self.directory, filename)
	write(',%s)\n' % `filename`)
예제 #3
0
 def write_image(self, image, relative_filename=1):
     write = self.file.write
     if not self.saved_ids.has_key(id(image)):
         imagefile = image.Filename()
         if not imagefile:
             from streamfilter import Base64Encode
             write('bm(%d)\n' % id(image))
             file = Base64Encode(self.file)
             image.image.save(file, 'PNG')
             file.close()
             write('-\n')
         else:
             if self.directory and relative_filename:
                 imagefile = relpath(self.directory, imagefile)
             write('bm(%d,%s)\n' % (id(image), ` imagefile `))
         self.saved_ids[id(image)] = image
예제 #4
0
파일: sksaver.py 프로젝트: shumik/skencil-c
    def write_image(self, image, relative_filename = 1):
        write = self.file.write
        if not self.saved_ids.has_key(id(image)):
            imagefile = image.Filename()
            if not imagefile:
                from streamfilter import Base64Encode
		write('bm(%d)\n' % id(image))
		file = Base64Encode(self.file)
		image.image.save(file, 'PPM')
                file.close()
		write('-\n')
            else:
                if self.directory and relative_filename:
                    imagefile = relpath(self.directory, imagefile)
                write('bm(%d,%s)\n' % (id(image), `imagefile`))
            self.saved_ids[id(image)] = image