Exemplo n.º 1
0
    def testNegativeSlope(self):
        """Tests that a negative slope raises a ValueError"""

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_NEGATIVE_SLOPE))
            self.file = f.name

        cdl_convert.HALT_ON_ERROR = True

        self.assertRaises(
            ValueError,
            cdl_convert.parse_cc,
            self.file
        )

        cdl_convert.HALT_ON_ERROR = False
        cdl_convert.ColorCorrection.members = {}

        cdl = cdl_convert.parse_cc(self.file)[0]

        self.assertEqual(
            (0.0, 0.678669, 1.0758),
            cdl.slope,
        )
Exemplo n.º 2
0
    def setUp(self):
        self.id = "014_xf_seqGrade_v01"
        self.desc = [
            'CC description 1', 'CC description 2', 'CC description 3',
            'CC description 4', 'CC description 5'
        ]
        self.input_desc = 'Input Desc Text'
        self.viewing_desc = 'Viewing Desc Text'

        self.sop_node_desc = [
            'Sop description 1', 'Sop description 2', 'Sop description 3'
        ]
        self.slope = (1.014, 1.0104, 0.62)
        self.offset = (-0.00315, -0.00124, 0.3103)
        self.power = (1.0, 0.9983, 1.0)
        self.sat_node_desc = [
            'Sat description 1', 'Sat description 2'
        ]
        self.sat = 1.09

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_FULL))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]
Exemplo n.º 3
0
    def setUp(self):
        self.id = "burp_100.x12"
        self.desc = []
        self.input_desc = None
        self.viewing_desc = None

        self.sop_node_desc = []
        self.slope = (1.014, 1.0104, 0.62)
        self.offset = (-0.00315, -0.00124, 0.3103)
        self.power = (1.0, 0.9983, 1.0)
        self.sat_node_desc = []
        self.sat = 1.09

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_BLANK_METADATA))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]
Exemplo n.º 4
0
    def setUp(self):
        self.id = "f54.112"
        self.desc = []
        self.input_desc = None
        self.viewing_desc = None

        self.sop_node_desc = []
        self.slope = (0.2331, 0.678669, 1.0758)
        self.offset = (0.031, 0.128, -0.096)
        self.power = (1.8, 0.97, 0.961)
        self.sat_node_desc = []
        self.sat = 1.01

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_BASIC_ORDER))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]
Exemplo n.º 5
0
    def setUp(self):
        self.id = "burp_300.x35"
        self.desc = []
        self.input_desc = None
        self.viewing_desc = None

        self.sop_node_desc = []
        self.slope = (0.2331, 0.678669, 1.0758)
        self.offset = (0.031, 0.128, -0.096)
        self.power = (1.8, 0.97, 0.961)
        self.sat_node_desc = []
        self.sat = 1.0

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_NO_SAT))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]

        # We need to call a SAT value to initialize the SAT subnode
        self.cdl.sat
Exemplo n.º 6
0
    def setUp(self):
        self.id = "burp_200.x15"
        self.desc = []
        self.input_desc = None
        self.viewing_desc = None

        self.sop_node_desc = []
        self.slope = (1.0, 1.0, 1.0)
        self.offset = (0.0, 0.0, 0.0)
        self.power = (1.0, 1.0, 1.0)
        self.sat_node_desc = ['I am a lovely sat node']
        self.sat = 1.01

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_NO_SOP))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]

        # We need to call a SOP value to initialize the SOP subnode
        self.cdl.slope
Exemplo n.º 7
0
    def testBlankId(self):
        """Tests that a blank id field ValueError"""

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_BLANK_ID))
            self.file = f.name

        cdl_convert.HALT_ON_ERROR = True

        self.assertRaises(
            ValueError,
            cdl_convert.parse_cc,
            self.file
        )

        cdl_convert.HALT_ON_ERROR = False

        cdl = cdl_convert.parse_cc(self.file)[0]

        self.assertEqual(
            '001',
            cdl.id
        )
Exemplo n.º 8
0
    def setUp(self):
        self.id = "f55.100"  # This will have been _sanitized()
        self.desc = [
            'Raised saturation a little!?! ag... \/Offset',
            'Raised saturation a little!?! ag... \/Offset',
        ]
        self.input_desc = 'METAL VIEWER!!! \/\/'
        self.viewing_desc = 'WOOD VIEWER!? ////'

        self.sop_node_desc = [
            'Raised saturation a little!?! ag... \/Offset'
        ]
        self.slope = (137829.329, 4327890.9833, 3489031.003)
        self.offset = (-3424.011, -342789423.013, -4238923.11)
        self.power = (3271893.993, .0000998, 0.0000000000000000113)
        self.sat_node_desc = []
        self.sat = 1798787.01

        # Build our cc
        with tempfile.NamedTemporaryFile(mode='wb', delete=False) as f:
            f.write(enc(CC_ODD))
            self.filename = f.name

        self.cdl = cdl_convert.parse_cc(self.filename)[0]