def test_to_domain_int(self): """Test :func:`colour.utilities.common.to_domain_int` definition.""" with domain_range_scale("Reference"): self.assertEqual(to_domain_int(1), 1) with domain_range_scale("1"): self.assertEqual(to_domain_int(1), 255) with domain_range_scale("100"): self.assertEqual(to_domain_int(1), 2.55) with domain_range_scale("100"): self.assertEqual(to_domain_int(1, 10), 10.23) with domain_range_scale("100"): self.assertEqual( to_domain_int(1, dtype=np.float16).dtype, np.float16)
def test_to_domain_int(self): """ Tests :func:`colour.utilities.common.to_domain_int` definition. """ with domain_range_scale('Reference'): self.assertEqual(to_domain_int(1), 1) with domain_range_scale('1'): self.assertEqual(to_domain_int(1), 255) with domain_range_scale('100'): self.assertEqual(to_domain_int(1), 2.55) with domain_range_scale('100'): self.assertEqual(to_domain_int(1, 10), 10.23) with domain_range_scale('100'): self.assertEqual( to_domain_int(1, dtype=np.float16).dtype, np.float16)