コード例 #1
0
    def get_output_specification_from_data(self, data):
        """
        Returns the *CIECAM02* colour appearance model output specification
        from given data.

        Parameters
        ----------
        data : list
            Fixture data.

        Returns
        -------
        CIECAM02_Specification
            *CIECAM02* colour appearance model specification.
        """

        XYZ_w = np.array([data['X_w'], data['Y_w'], data['Z_w']])

        specification = CIECAM02_to_XYZ(data['J'], data['C'], data['h'],
                                        XYZ_w,
                                        data['L_A'],
                                        data['Y_b'],
                                        CIECAM02_InductionFactors(data['F'],
                                                                  data['c'],
                                                                  data['N_c']))
        return specification
コード例 #2
0
ファイル: test_ciecam02.py プロジェクト: vidakDK/colour
    def _XYZ_from_data(self, data, correlates):
        """
        Returns the *CIE XYZ* tristimulus values from given *CIECAM02* colour
        appearance model input data.

        Parameters
        ----------
        data : list
            Fixture data.
        correlates : array_like
            Correlates used to build the input *CIECAM02* colour appearance
            model specification.

        Returns
        -------
        array_like
            *CIE XYZ* tristimulus values
        """

        XYZ_w = tstack([data['X_w'], data['Y_w'], data['Z_w']])

        i, j, k = correlates
        CIECAM02_specification = as_namedtuple(
            {
                i: data[i],
                j: data[j],
                k: data[k]
            }, CIECAM02_Specification)

        XYZ = CIECAM02_to_XYZ(
            CIECAM02_specification, XYZ_w, data['L_A'], data['Y_b'],
            CIECAM02_InductionFactors(data['F'], data['c'], data['N_c']))

        return XYZ
コード例 #3
0
ファイル: tests_ciecam02.py プロジェクト: scooperly/colour
    def output_specification_from_data(self, data):
        """
        Returns the CIECAM02 colour appearance model output specification
        from given data.

        Parameters
        ----------
        data : list
            Fixture data.

        Returns
        -------
        CIECAM02_Specification
            CIECAM02 colour appearance model specification.
        """

        XYZ = tstack((data['X'], data['Y'], data['Z']))
        XYZ_w = tstack((data['X_w'], data['Y_w'], data['Z_w']))

        specification = XYZ_to_CIECAM02(
            XYZ, XYZ_w, data['L_A'], data['Y_b'],
            CIECAM02_InductionFactors(data['F'], data['c'], data['N_c']))

        return specification