def testGetDifferenceWithMask(self): self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25), (0, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.white25, self.white25), (0, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.white25, self.black25), (255, 255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25, mask=self.black25), (0, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25, mask=self.white25), (0, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.white25, mask=self.black25), (255, 255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.white25, mask=self.white25), (0, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.white25, different_color=(255, 0, 0, 255)), (255, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.white25, self.white25, same_color=(255, 0, 0, 255)), (255, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.white25, self.white25, mask=self.white25, masked_color=(255, 0, 0, 255)), (255, 0, 0, 255))) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.black50) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.white25, mask=self.black50)
def testGetDifferenceWithMask(self): black25x25 = _GenImage((25, 25), (0, 0, 0)) white25x25 = _GenImage((25, 25), (255, 255, 255)) black50x50 = _GenImage((50, 50), (0, 0, 0)) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, black25x25), (0, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( white25x25, white25x25), (0, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( white25x25, black25x25), (255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, black25x25, mask=black25x25), (0, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, black25x25, mask=white25x25), (0, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, white25x25, mask=black25x25), (255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, white25x25, mask=white25x25), (0, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( black25x25, white25x25, different_color=(255, 0, 0)), (255, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( white25x25, white25x25, same_color=(255, 0, 0)), (255, 0, 0))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( white25x25, white25x25, mask=white25x25, masked_color=(255, 0, 0)), (255, 0, 0))) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, white25x25, black50x50) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, white25x25, white25x25, mask=black50x50)
def testGetDifferenceWithMask(self): self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.black25, self.black25)[0], (255, 255, 255, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.white25, self.black25)[0], (210, 0, 0, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.black25, self.black25, mask=self.black25)[0], (255, 255, 255, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.black25, self.black25, mask=self.white25)[0], (225, 225, 225, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.black25, self.white25, mask=self.black25)[0], (210, 0, 0, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(self.black25, self.white25, mask=self.white25)[0], (225, 225, 225, 255))) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.black50) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.white25, mask=self.black50)
def testGetDifferenceWithMask(self): self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25)[0], (255, 255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.white25, self.black25)[0], (210, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25, mask=self.black25)[0], (255, 255, 255, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.black25, mask=self.white25)[0], (225, 225, 225, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.white25, mask=self.black25)[0], (210, 0, 0, 255))) self.assertTrue(_AllPixelsOfColor(image_tools._GetDifferenceWithMask( self.black25, self.white25, mask=self.white25)[0], (225, 225, 225, 255))) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.black50) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, self.white25, self.white25, mask=self.black50)
def testGetDifferenceWithMask(self): black25x25 = _GenImage((25, 25), (0, 0, 0)) white25x25 = _GenImage((25, 25), (255, 255, 255)) black50x50 = _GenImage((50, 50), (0, 0, 0)) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, black25x25), (0, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(white25x25, white25x25), (0, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(white25x25, black25x25), (255, 255, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, black25x25, mask=black25x25), (0, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, black25x25, mask=white25x25), (0, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, white25x25, mask=black25x25), (255, 255, 255))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, white25x25, mask=white25x25), (0, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(black25x25, white25x25, different_color=(255, 0, 0)), (255, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(white25x25, white25x25, same_color=(255, 0, 0)), (255, 0, 0))) self.assertTrue( _AllPixelsOfColor( image_tools._GetDifferenceWithMask(white25x25, white25x25, mask=white25x25, masked_color=(255, 0, 0)), (255, 0, 0))) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, white25x25, black50x50) self.assertRaises(Exception, image_tools._GetDifferenceWithMask, white25x25, white25x25, mask=black50x50)