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)))
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.MAPTK_LIB['maptk_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))
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)
def test_new_sized(self): img = Image(720, 480)
def test_new(self): img = Image()
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)
def test_height(self): i = Image(720, 480) ic = ImageContainer(i) nose.tools.assert_equal(ic.height(), 480)
def test_width(self): i = Image(720, 480) ic = ImageContainer(i) nose.tools.assert_equal(ic.width(), 720)
def test_size(self): i = Image(720, 480) ic = ImageContainer(i) nose.tools.assert_equal(ic.size(), 720 * 480)
def test_new(self): image = Image() img_c = ImageContainer(image) image = Image(100, 100) img_c = ImageContainer(image)