Calibrate() public method

Calibrates a raw luminance value
Typically, you start from a RAW XYZ value that you convert to xyY, pass the Y to this method and replace it into your orignal xyY, convert back to XYZ and voilĂ !
public Calibrate ( float _Luminance ) : float
_Luminance float The uncalibrated luminance value
return float
Example #1
0
        /// <summary>
        /// Calibrates a raw luminance value
        /// </summary>
        /// <param name="_xyY">The uncalibrated value</param>
        /// <returns>The calibrated reflectance value</returns>
        /// <remarks>Typically, you start from a RAW XYZ value that you convert to xyY, pass the Y to this method
        /// and replace it into your orignal xyY, convert back to XYZ and voilĂ !</remarks>
        public ImageUtility.float3      Calibrate(ImageUtility.float3 _xyY)
        {
            if (m_RootNode == null)
            {
                throw new Exception("Calibration grid hasn't been built: did you provide a valid database path? Does the path contain camera calibration data?");
            }
            if (m_InterpolatedCalibration == null)
            {
                throw new Exception("Calibration grid hasn't been prepared for calibration: did you call the PrepareCalibrationFor() method?");
            }

            float Reflectance = m_InterpolatedCalibration.Calibrate(m_WhiteReflectanceCorrectionFactor * _xyY.z);

            _xyY.z = Reflectance;
            if (m_DoWhiteBalance)
            {
                ImageUtility.float3 XYZ = ImageUtility.ColorProfile.xyY2XYZ(_xyY);
                XYZ *= m_WhiteBalanceXYZ;
                _xyY = ImageUtility.ColorProfile.XYZ2xyY(XYZ);
            }
            return(_xyY);
        }