示例#1
0
 public static ColorXYZ ToXYZ(ColorXYZFull xyz)
 {
     var x = (int)Math.Round(Clamp(xyz.X) * ColorXYZ.MaxValue);
     var y = (int)Math.Round(Clamp(xyz.Y) * ColorXYZ.MaxValue);
     var z = (int)Math.Round(Clamp(xyz.Z) * ColorXYZ.MaxValue);
     return new ColorXYZ(x, y, z);
 }
示例#2
0
 public static ColorRGBFull ToRGB(ColorXYZFull xyz)
 {
     return Multiply(XYZToRGB, xyz.X, xyz.Y, xyz.Z);
 }
示例#3
0
 public static ColorxyYFull ToxyY(ColorXYZFull xyz)
 {
     double sum = xyz.X + xyz.Y + xyz.Z;
     if (Math.Abs(sum) < Epsilon)
     {
         return new ColorxyYFull(1 / 3.0, 1 / 3.0, 0);
     }
     double x = xyz.X / sum;
     double y = xyz.Y / sum;
     return new ColorxyYFull(x, y, xyz.Y);
 }
示例#4
0
 public static ColorXYZFull Clamp(ColorXYZFull xyz)
 {
     return xyz;
 }