示例#1
0
 def test_rotate(self):
     init()
     with transform(angle=0.1):
         box(0.5)
     write_to_png("/tmp/rotate.png")
     a = get_npimage()
     self.assertIsInstance(a, np.ndarray)
示例#2
0
 def test_main(self):
     init(face_color="#123456", background_color="#aaaaaa")
     circle(1)
     a = get_npimage()
     print(a.shape)
     report()
     write_to_png("/tmp/test.png")
示例#3
0
 def test_primitives(self):
     init(face_color="#123456", background_color="#aaaaaa")
     line(1, 1)
     triangle(0.5)
     a = get_npimage()
     print(a.shape)
     report()
     write_to_png("/tmp/primitives.png")
示例#4
0
 def test_flip(self):
     init()
     with flip_y():
         box(0.5)
     a = get_npimage(y_origin="bottom")
     self.assertIsInstance(a, np.ndarray)