Exemplo n.º 1
0
    def test_convert(self):
        ic1 = ImageContainer(Image())
        ci = ConvertImage.create('ci', 'bypass')
        ic2 = ci.convert(ic1)

        nt.assert_not_equal(ic1, ic2)
        nt.assert_not_equal(ic1.c_pointer, ic2.c_pointer)
        nt.assert_equal(hex(mem_address(ic1.c_pointer)),
                        hex(mem_address(ic2.c_pointer)))
Exemplo n.º 2
0
    def get_image(self):
        """
        Return a new pointer the to contained image. This instance shares the
        same internal memory as the contained image.

        :return: New ImageContainer instance
        :rtype: ImageContainer

        """
        ic_getimg = self.VITAL_LIB['vital_image_container_get_image']
        ic_getimg.argtypes = [self.C_TYPE_PTR]
        ic_getimg.restype = Image.C_TYPE_PTR
        return Image.from_c_pointer(ic_getimg(self))
Exemplo n.º 3
0
    def test_size(self):
        img = Image()
        nose.tools.assert_equal(img.size(), 0)

        img = Image(720, 480)
        nose.tools.assert_equal(img.size(), 720 * 480)
Exemplo n.º 4
0
 def test_new_sized(self):
     img = Image(720, 480)
Exemplo n.º 5
0
 def test_new(self):
     img = Image()
Exemplo n.º 6
0
    def test_size(self):
        img = Image()
        nose.tools.assert_equal(img.size(), 0)

        img = Image(720, 480)
        nose.tools.assert_equal(img.size(), 720*480)
Exemplo n.º 7
0
 def test_height(self):
     i = Image(720, 480)
     ic = ImageContainer(i)
     nose.tools.assert_equal(ic.height(), 480)
Exemplo n.º 8
0
 def test_width(self):
     i = Image(720, 480)
     ic = ImageContainer(i)
     nose.tools.assert_equal(ic.width(), 720)
Exemplo n.º 9
0
 def test_size(self):
     i = Image(720, 480)
     ic = ImageContainer(i)
     nose.tools.assert_equal(ic.size(), 720 * 480)
Exemplo n.º 10
0
    def test_new(self):
        image = Image()
        img_c = ImageContainer(image)

        image = Image(100, 100)
        img_c = ImageContainer(image)