python: Allow to dump all images to disk.
This commit is contained in:
@@ -75,7 +75,13 @@ def show_image(surface):
|
|||||||
root.mainloop()
|
root.mainloop()
|
||||||
|
|
||||||
|
|
||||||
|
# Verbosity level: 0, 1, 2
|
||||||
verbose = 1
|
verbose = 1
|
||||||
|
# Dump images to disk instead of showing: True, False
|
||||||
|
images = False
|
||||||
|
|
||||||
|
|
||||||
|
image_no = 0
|
||||||
|
|
||||||
|
|
||||||
class Struct:
|
class Struct:
|
||||||
@@ -538,6 +544,12 @@ class Context(Object):
|
|||||||
self.real.flush()
|
self.real.flush()
|
||||||
|
|
||||||
if self.cbufs and self.cbufs[0]:
|
if self.cbufs and self.cbufs[0]:
|
||||||
|
if images:
|
||||||
|
global image_no
|
||||||
|
image_no += 1
|
||||||
|
filename = 'cbuf_%04u.png' % image_no
|
||||||
|
save_image(filename, self.cbufs[0])
|
||||||
|
else:
|
||||||
show_image(self.cbufs[0])
|
show_image(self.cbufs[0])
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user