Exemple #1
0
 def testDraw(self):
     w, h, path = 68, 72, 'polygon 14,12 64,0 68,72 0,54'
     l = []
     for i in range(10):
         im = Image.create(w, h, Color.named("blue"))
         im.draw(path)
         l.append(im)
Exemple #2
0
 def testDraw(self):
     w, h, path = 68, 72, 'polygon 14,12 64,0 68,72 0,54'
     l = []
     for i in range(10):
         im = Image.create(w, h, Color.named("blue"))
         im.draw(path)
         l.append(im)
Exemple #3
0
 def testGetPixels(self):
     im = Image.create(100, 100, Color.named('white'))
     with im.getPixels(50, 50, 50, 50) as px:
         p0 = px[0, 0]
         self.assertEqual((p0.red, p0.green, p0.blue),
                            (65535, 65535, 65535))
         p0 = px[49, 49]
         self.assertEqual((p0.red, p0.green, p0.blue),
                            (65535, 65535, 65535))
Exemple #4
0
 def testGetPixels(self):
     im = Image.create(100, 100, Color.named('white'))
     with im.getPixels(50, 50, 50, 50) as px:
         p0 = px[0, 0]
         self.assertEqual((p0.red, p0.green, p0.blue),
                          (65535, 65535, 65535))
         p0 = px[49, 49]
         self.assertEqual((p0.red, p0.green, p0.blue),
                          (65535, 65535, 65535))
Exemple #5
0
 def testImage(self):
     for i in range(1*self.mult):
         self.show('Image', i)
         im = []
         for j in range(10):
             im.append(Image.create(1024, 1024, Color.named("white")))
             if self.verbose > 1:
                 import os
                 with open('/proc/{0}/status'.format(os.getpid()), 'rt') as f:
                     for line in f:
                         if 'VmData' in line:
                             print(line.strip())
Exemple #6
0
 def testImage(self):
     for i in range(1 * self.mult):
         self.show('Image', i)
         im = []
         for j in range(10):
             im.append(Image.create(1024, 1024, Color.named("white")))
             if self.verbose > 1:
                 import os
                 with open('/proc/{0}/status'.format(os.getpid()),
                           'rt') as f:
                     for line in f:
                         if 'VmData' in line:
                             print(line.strip())
Exemple #7
0
 def testBackgroundColor(self):
     im = self.testRead()
     im.setBackgroundColor(Color.named('red'))
Exemple #8
0
 def testNewImage(self):
     im = Image.create(100, 100, Color.named("blue"))
     self.assertTrue(im)
     return im
Exemple #9
0
 def testStr(self):
     c = Color.named("yellow")
     self.assertEqual('#ffff0000', str(c))
Exemple #10
0
 def testYellow(self):
     c = Color.named("yellow")
     self.assertEqual('<Color: rgba(65535,65535,0,0)>', repr(c))
Exemple #11
0
 def testBlue(self):
     c = Color.named("blue")
     self.assertEqual('<Color: rgba(0,0,65535,0)>', repr(c))
Exemple #12
0
 def testStr(self):
     c = Color.named("yellow")
     self.assertEqual("#ffff0000", str(c))
Exemple #13
0
 def testYellow(self):
     c = Color.named("yellow")
     self.assertEqual("<Color: rgba(65535,65535,0,0)>", repr(c))
Exemple #14
0
 def testBlue(self):
     c = Color.named("blue")
     self.assertEqual("<Color: rgba(0,0,65535,0)>", repr(c))
Exemple #15
0
 def testBackgroundColor(self):
     im = self.testRead()
     im.setBackgroundColor(Color.named('red'))
Exemple #16
0
 def testNewImage(self):
     im = Image.create(100, 100, Color.named("blue"))
     self.assertTrue(im)
     return im