Пример #1
0
        /// <summary>
        /// Converts YUV to HSB.
        /// </summary>
        /// <param name="y">Y must be in [0, 1].</param>
        /// <param name="u">U must be in [-0.436, +0.436].</param>
        /// <param name="v">V must be in [-0.615, +0.615].</param>
        public static HSB YUVtoHSB(double y, double u, double v)
        {
            RGB rgb = YUVtoRGB(y, u, v);

            return(RGBtoHSB(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #2
0
        /// <summary>
        /// Converts YUV to CMYK.
        /// </summary>
        /// <param name="y">Y must be in [0, 1].</param>
        /// <param name="u">U must be in [-0.436, +0.436].</param>
        /// <param name="v">V must be in [-0.615, +0.615].</param>
        public static CMYK YUVtoCMYK(double y, double u, double v)
        {
            RGB rgb = YUVtoRGB(y, u, v);

            return(RGBtoCMYK(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #3
0
        /// <summary>
        /// Converts YUV to a .net Color.
        /// </summary>
        /// <param name="y">Y must be in [0, 1].</param>
        /// <param name="u">U must be in [-0.436, +0.436].</param>
        /// <param name="v">V must be in [-0.615, +0.615].</param>
        public static Color YUVtoColor(double y, double u, double v)
        {
            RGB rgb = YUVtoRGB(y, u, v);

            return(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #4
0
        /// <summary>
        /// Converts YUV to a .net Color.
        /// </summary>
        public static Color YUVtoColor(YUV yuv)
        {
            RGB rgb = YUVtoRGB(yuv);

            return(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #5
0
 /// <summary>
 /// Converts RGB to YUV.
 /// </summary>
 public static YUV RGBtoYUV(RGB rgb)
 {
     return RGBtoYUV(rgb.Red, rgb.Green, rgb.Blue);
 }
Пример #6
0
        /// <summary>
        /// Converts HSB to CMYK.
        /// </summary>
        public static YUV HSBtoYUV(double h, double s, double b)
        {
            RGB rgb = HSBtoRGB(new HSB(h, s, b));

            return(RGBtoYUV(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #7
0
 /// <summary>
 /// Converts RGB to YUV.
 /// </summary>
 public static YUV RGBtoYUV(RGB rgb)
 {
     return(RGBtoYUV(rgb.Red, rgb.Green, rgb.Blue));
 }
Пример #8
0
 /// <summary>
 /// Converts RGB to CIELab.
 /// </summary>
 public static CIELab RGBtoLab(RGB rgb)
 {
     return XYZtoLab(RGBtoXYZ(rgb.Red, rgb.Green, rgb.Blue));
 }
Пример #9
0
 /// <summary>
 /// Converts RGB to HSB.
 /// </summary>
 public static HSB RGBtoHSB(RGB rgb)
 {
     return(RGBtoHSB(rgb.Red, rgb.Green, rgb.Blue));
 }
Пример #10
0
 /// <summary>
 /// Converts RGB to CMYK
 /// </summary>
 public static CMYK RGBtoCMYK(RGB rgb)
 {
     return(RGBtoCMYK(rgb.Red, rgb.Green, rgb.Blue));
 }
Пример #11
0
        /// <summary>
        /// Converts HSL to YUV.
        /// </summary>
        public static YUV HSLtoYUV(double h, double s, double l)
        {
            RGB rgb = HSLtoRGB(h, s, l);

            return(RGBtoYUV(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #12
0
        /// <summary>
        /// Converts HSL to CMYK.
        /// </summary>
        public static CMYK HSLtoCMYK(double h, double s, double l)
        {
            RGB rgb = HSLtoRGB(h, s, l);

            return(RGBtoCMYK(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #13
0
        /// <summary>
        /// Converts HSL to .net Color.
        /// </summary>
        /// <param name="hsl">The HSL structure to convert.</param>
        public static Color HSLtoColor(double h, double s, double l)
        {
            RGB rgb = HSLtoRGB(h, s, l);

            return(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #14
0
 /// <summary>
 /// Converts RGB to CMYK
 /// </summary>
 public static CMYK RGBtoCMYK(RGB rgb)
 {
     return RGBtoCMYK(rgb.Red, rgb.Green, rgb.Blue);
 }
Пример #15
0
 /// <summary>
 /// Converts RGB to CIEXYZ.
 /// </summary>
 public static CIEXYZ RGBtoXYZ(RGB rgb)
 {
     return(RGBtoXYZ(rgb.Red, rgb.Green, rgb.Blue));
 }
Пример #16
0
 /// <summary> 
 /// Converts RGB to HSL.
 /// </summary>
 public static HSL RGBtoHSL(RGB rgb)
 {
     return RGBtoHSL(rgb.Red, rgb.Green, rgb.Blue);
 }
Пример #17
0
 /// <summary>
 /// Converts RGB to CIELab.
 /// </summary>
 public static CIELab RGBtoLab(RGB rgb)
 {
     return(XYZtoLab(RGBtoXYZ(rgb.Red, rgb.Green, rgb.Blue)));
 }
Пример #18
0
 /// <summary>
 /// Converts RGB to CIEXYZ.
 /// </summary>
 public static CIEXYZ RGBtoXYZ(RGB rgb)
 {
     return RGBtoXYZ(rgb.Red, rgb.Green, rgb.Blue);
 }
Пример #19
0
        /// <summary>
        /// Converts CMYK to YUV.
        /// </summary>
        public static YUV CMYKtoYUV(double c, double m, double y, double k)
        {
            RGB rgb = CMYKtoRGB(c, m, y, k);

            return(RGBtoYUV(rgb.Red, rgb.Green, rgb.Blue));
        }
Пример #20
0
        /// <summary>
        /// Converts YUV to RGB.
        /// </summary>
        /// <param name="y">Y must be in [0, 1].</param>
        /// <param name="u">U must be in [-0.436, +0.436].</param>
        /// <param name="v">V must be in [-0.615, +0.615].</param>
        public static RGB YUVtoRGB(double y, double u, double v)
        {
            var rgb = new RGB();

            rgb.Red = Convert.ToInt32((y + 1.139837398373983740 * v) * 255);
            rgb.Green = Convert.ToInt32((y - 0.3946517043589703515 * u - 0.5805986066674976801 * v) * 255);
            rgb.Blue = Convert.ToInt32((y + 2.032110091743119266 * u) * 255);

            return rgb;
        }
Пример #21
0
        /// <summary>
        /// Converts HSB to Color.
        /// </summary>
        /// <param name="hsv">the HSB structure to convert.</param>
        public static Color HSBtoColor(HSB hsb)
        {
            RGB rgb = HSBtoRGB(hsb);

            return(Color.FromArgb(rgb.Red, rgb.Green, rgb.Blue));
        }