/// <summary> /// Converts a color model CIE XYZ in model CIE Lab. /// </summary> /// <param name="x">Component X</param> /// <param name="y">Component Y</param> /// <param name="z">Component Z</param> /// <returns>CIE Lab structure</returns> public static LAB ToLAB(float x, float y, float z) { LAB lab = new LAB(); lab.L = 116.0f * Fxyz(y / XYZ.White.Y) - 16; lab.A = 500.0f * (Fxyz(x / XYZ.White.X) - Fxyz(y / XYZ.White.Y)); lab.B = 200.0f * (Fxyz(y / XYZ.White.Y) - Fxyz(z / XYZ.White.Z)); return(lab); }
/// <summary> /// Converts a color model CIE Lab in model CIE XYZ. /// </summary> /// <param name="lab">CIE Lab structure</param> /// <returns>CIE XYZ structure</returns> public static XYZ ToXYZ(LAB lab) { return(LAB.ToXYZ(lab.L, lab.A, lab.B)); }