def test_gray16be_inspection(self): fmt = VideoFormat("gray16be", 640, 480) self.assertEqual(fmt.name, "gray16be") self.assertEqual(len(fmt.components), 1) self.assertFalse(fmt.is_planar) self.assertFalse(fmt.has_palette) self.assertFalse(fmt.is_rgb) self.assertEqual(fmt.chroma_width(), 640) self.assertEqual(fmt.chroma_height(), 480) self.assertEqual(fmt.chroma_width(1024), 1024) self.assertEqual(fmt.chroma_height(1024), 1024) comp = fmt.components[0] self.assertEqual(comp.plane, 0) self.assertEqual(comp.bits, 16) self.assertTrue(comp.is_luma) self.assertFalse(comp.is_chroma) self.assertEqual(comp.width, 640) self.assertEqual(comp.height, 480) self.assertFalse(comp.is_alpha)
def test_rgb24_inspection(self): fmt = VideoFormat("rgb24", 640, 480) self.assertEqual(fmt.name, "rgb24") self.assertEqual(len(fmt.components), 3) self.assertFalse(fmt.is_planar) self.assertFalse(fmt.has_palette) self.assertTrue(fmt.is_rgb) self.assertEqual(fmt.chroma_width(), 640) self.assertEqual(fmt.chroma_height(), 480) self.assertEqual(fmt.chroma_width(1024), 1024) self.assertEqual(fmt.chroma_height(1024), 1024) for i in xrange(3): comp = fmt.components[i] self.assertEqual(comp.plane, 0) self.assertEqual(comp.bits, 8) self.assertFalse(comp.is_luma) self.assertFalse(comp.is_chroma) self.assertFalse(comp.is_alpha) self.assertEqual(comp.width, 640) self.assertEqual(comp.height, 480)
def test_gray16be_inspection(self): fmt = VideoFormat('gray16be', 640, 480) self.assertEqual(fmt.name, 'gray16be') self.assertEqual(len(fmt.components), 1) self.assertFalse(fmt.is_planar) self.assertFalse(fmt.has_palette) self.assertFalse(fmt.is_rgb) self.assertEqual(fmt.chroma_width(), 640) self.assertEqual(fmt.chroma_height(), 480) self.assertEqual(fmt.chroma_width(1024), 1024) self.assertEqual(fmt.chroma_height(1024), 1024) comp = fmt.components[0] self.assertEqual(comp.plane, 0) self.assertEqual(comp.bits, 16) self.assertTrue(comp.is_luma) self.assertFalse(comp.is_chroma) self.assertEqual(comp.width, 640) self.assertEqual(comp.height, 480) self.assertFalse(comp.is_alpha)
def test_rgb24_inspection(self): fmt = VideoFormat('rgb24', 640, 480) self.assertEqual(fmt.name, 'rgb24') self.assertEqual(len(fmt.components), 3) self.assertFalse(fmt.is_planar) self.assertFalse(fmt.has_palette) self.assertTrue(fmt.is_rgb) self.assertEqual(fmt.chroma_width(), 640) self.assertEqual(fmt.chroma_height(), 480) self.assertEqual(fmt.chroma_width(1024), 1024) self.assertEqual(fmt.chroma_height(1024), 1024) for i in range(3): comp = fmt.components[i] self.assertEqual(comp.plane, 0) self.assertEqual(comp.bits, 8) self.assertFalse(comp.is_luma) self.assertFalse(comp.is_chroma) self.assertFalse(comp.is_alpha) self.assertEqual(comp.width, 640) self.assertEqual(comp.height, 480)
def test_pal8_inspection(self): fmt = VideoFormat('pal8', 640, 480) self.assertEqual(len(fmt.components), 1) self.assertTrue(fmt.has_palette)
def test_yuva420p_inspection(self): fmt = VideoFormat('yuva420p', 640, 480) self.assertEqual(len(fmt.components), 4) self._test_yuv420(fmt) self.assertFalse(fmt.components[3].is_chroma) self.assertEqual(fmt.components[3].width, 640)
def test_yuv420p_inspection(self): fmt = VideoFormat('yuv420p', 640, 480) self.assertEqual(fmt.name, 'yuv420p') self.assertEqual(len(fmt.components), 3) self._test_yuv420(fmt)