def test_issue_188_neels_case(self): proxies = [Mono12] width = 2456 height = 2058 for proxy in proxies: self.assertEqual( 10108896, # = 2456 * 2058 * 2 Component2DImage._get_nr_bytes(pf_proxy=proxy(), width=width, height=height))
def test_issue_238(self): proxies = [RGB10p, BGR10p, RGB12p, BGR12p] expected_bytes = [ [4, 4, 5, 5], # 1 x 1 [8, 8, 9, 9], # 2 x 1 [12, 12, 14, 14], # 3 x 1 ] for i in self._range: for j, proxy in enumerate(proxies): self.assertEqual( expected_bytes[i][j], Component2DImage._get_nr_bytes(pf_proxy=proxy(), width=i + 1, height=self._height))
def test_issue_188_unpacked(self): proxies = [Mono8, Mono10, Mono12, Mono14, Mono16] expected_bytes = [ [1, 2, 2, 2, 2], # 1 x 1 [2, 4, 4, 4, 4], # 2 x 1 [3, 6, 6, 6, 6], # 3 x 1 ] for i in self._range: for j, proxy in enumerate(proxies): self.assertEqual( expected_bytes[i][j], Component2DImage._get_nr_bytes(pf_proxy=proxy(), width=i + 1, height=self._height))
def test_issue_188_p(self): proxies = [Mono10p, Mono12p, Mono14p] expected_bytes = [ [2, 2, 2], # 1 x 1 [3, 3, 4], # 2 x 1 [4, 5, 6], # 3 x 1 ] for i in self._range: for j, proxy in enumerate(proxies): self.assertEqual( expected_bytes[i][j], Component2DImage._get_nr_bytes(pf_proxy=proxy(), width=i + 1, height=self._height))
def test_issue_188_packed(self): proxies = [Mono10Packed, Mono12Packed] expected_results = [ [2, 2], # 1 x 1 [3, 3], # 2 x 1 [4, 5], # 3 x 1 ] for i in self._range: for j, proxy in enumerate(proxies): self.assertEqual( expected_results[i][j], Component2DImage._get_nr_bytes(pf_proxy=proxy(), width=i + 1, height=self._height))