Пример #1
0
        private Color CreateInstance()
        {
            var             sctor = ColorspaceDropDown.Items[ColorspaceDropDown.SelectedIndex] as ListItem;
            ConstructorInfo ctor  = sctor.Tag as ConstructorInfo;

            switch (sctor.Key)
            {
            case "wp":
                Whitepoint wp = GetWhitepoint();
                return(ctor.Invoke(new object[] { wp }) as Color);

            case "rgb":
                ColorspaceRGB rgbspace = GetRGBColorspace();
                return(ctor.Invoke(new object[] { rgbspace }) as Color);

            case "gray":
                double     gamma  = GammaNum.Value;
                Whitepoint gwp    = GetWhitepoint();
                var        gspace = new ColorspaceGray(gwp, gamma);
                return(ctor.Invoke(new object[] { gspace }) as Color);

            case "icc":
                string iccPath = ICCTextBox.Text;
                var    profile = new ICCProfileReader().Read(iccPath);
                return(ctor.Invoke(new object[] { profile }) as Color);

            default:
                throw new Exception("Invalid Key");
            }
        }
Пример #2
0
 /// <summary>
 /// Creates a new instance of a BCH Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="B">Brightness (0 - 100)</param>
 /// <param name="C">Chroma</param>
 /// <param name="H">Hue (0 - 360)</param>
 public ColorBCH(Whitepoint ReferenceWhite, double B, double C, double H)
     : base()
 {
     this.wp = ReferenceWhite;
     this.B  = B;
     this.C  = C;
     this.H  = H;
 }
Пример #3
0
 public TestColorspaceRGB(Whitepoint wp, double[] Cr, double[] Cg, double[] Cb, double Gamma)
     : base(wp)
 {
     _Cr    = Cr;
     _Cg    = Cg;
     _Cb    = Cb;
     _Gamma = Gamma;
 }
Пример #4
0
 /// <summary>
 /// Creates a new instance of a Bef Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="B">B-value</param>
 /// <param name="e">e-value</param>
 /// <param name="f">f-value</param>
 public ColorBef(Whitepoint ReferenceWhite, double B, double e, double f)
     : base()
 {
     this.wp = ReferenceWhite;
     this.B  = B;
     this.e  = e;
     this.f  = f;
 }
Пример #5
0
 /// <summary>
 /// Creates a new instance of a CIE L*u*v* Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="L">Lightness (0 - 100)</param>
 /// <param name="u">u-value (red/green)</param>
 /// <param name="v">v-value (blue/yellow)</param>
 public ColorLuv(Whitepoint ReferenceWhite, double L, double u, double v)
     : base()
 {
     this.wp = ReferenceWhite;
     this.L  = L;
     this.u  = u;
     this.v  = v;
 }
Пример #6
0
 /// <summary>
 /// Creates a new instance of a DEF Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="D">D-value</param>
 /// <param name="E">E-value</param>
 /// <param name="F">F-value</param>
 public ColorDEF(Whitepoint ReferenceWhite, double D, double E, double F)
     : base()
 {
     this.wp = ReferenceWhite;
     this.D  = D;
     this.E  = E;
     this.F  = F;
 }
Пример #7
0
 /// <summary>
 /// Creates a new instance of a CIE L*a*b* Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="L">Lightness (0 - 100)</param>
 /// <param name="a">a-value (green/magenta)</param>
 /// <param name="b">b-value (blue/yellow)</param>
 public ColorLab(Whitepoint ReferenceWhite, double L, double a, double b)
     : base()
 {
     this.wp = ReferenceWhite;
     this.L  = L;
     this.a  = a;
     this.b  = b;
 }
Пример #8
0
 /// <summary>
 /// Creates a new instance of a CIE Yxy Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="Y">Y-value (0.0 - 1.0)</param>
 /// <param name="x">x-value</param>
 /// <param name="y">y-value</param>
 public ColorYxy(Whitepoint ReferenceWhite, double Y, double x, double y)
     : base()
 {
     this.wp = ReferenceWhite;
     this.Y  = Y;
     this.x  = x;
     this.y  = y;
 }
Пример #9
0
 /// <summary>
 /// Creates a new instance of a CIE XYZ Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="X">X-value (0.0 - 1.0)</param>
 /// <param name="Y">Y-value (0.0 - 1.0)</param>
 /// <param name="Z">Z-value (0.0 - 1.0)</param>
 public ColorXYZ(Whitepoint ReferenceWhite, double X, double Y, double Z)
     : base()
 {
     this.wp = ReferenceWhite;
     this.X  = X;
     this.Y  = Y;
     this.Z  = Z;
 }
Пример #10
0
 /// <summary>
 /// Creates a new instance of a CIE L*a*b* Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 public ColorLab(Whitepoint ReferenceWhite)
     : this(ReferenceWhite, 0, 0, 0)
 {
 }
Пример #11
0
 /// <summary>
 /// Creates a new instance of a CIE Yxy Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="Y">Y-value (0.0 - 1.0)</param>
 /// <param name="x">x-value</param>
 /// <param name="y">y-value</param>
 public ColorYxy(Whitepoint ReferenceWhite, double Y, double x, double y)
     : base()
 {
     this.wp = ReferenceWhite;
     this.Y = Y;
     this.x = x;
     this.y = y;
 }
Пример #12
0
 /// <summary>
 /// Creates a new instance of a CIE XYZ Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="X">X-value (0.0 - 1.0)</param>
 /// <param name="Y">Y-value (0.0 - 1.0)</param>
 /// <param name="Z">Z-value (0.0 - 1.0)</param>
 public ColorXYZ(Whitepoint ReferenceWhite, double X, double Y, double Z)
     : base()
 {
     this.wp = ReferenceWhite;
     this.X = X;
     this.Y = Y;
     this.Z = Z;
 }
Пример #13
0
 /// <summary>
 /// Creates a new instance of a CIE L*u*v* Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="L">Lightness (0 - 100)</param>
 /// <param name="u">u-value (red/green)</param>
 /// <param name="v">v-value (blue/yellow)</param>
 public ColorLuv(Whitepoint ReferenceWhite, double L, double u, double v)
     : base()
 {
     this.wp = ReferenceWhite;
     this.L = L;
     this.u = u;
     this.v = v;
 }
Пример #14
0
 /// <summary>
 /// Creates a new instance of a BCH Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="B">Brightness (0 - 100)</param>
 /// <param name="C">Chroma</param>
 /// <param name="H">Hue (0 - 360)</param>
 public ColorBCH(Whitepoint ReferenceWhite, double B, double C, double H)
     : base()
 {
     this.wp = ReferenceWhite;
     this.B = B;
     this.C = C;
     this.H = H;
 }
Пример #15
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorLCHab"/> class
 /// </summary>
 /// <param name="wp">The reference white for this color</param>
 public ColorLCHab(Whitepoint wp)
     : base(wp)
 {
 }
Пример #16
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorBef"/> class
 /// </summary>
 /// <param name="B">Value for the Brightness channel</param>
 /// <param name="e">Value for the e channel</param>
 /// <param name="f">Value for the f channel</param>
 /// <param name="wp">The reference white for this color</param>
 public ColorBef(double B, double e, double f, Whitepoint wp)
     : base(new Colorspace(wp), B, e, f)
 {
 }
Пример #17
0
 /// <summary>
 /// Creates a new instance of a CIE L*a*b* Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="L">Lightness (0 - 100)</param>
 /// <param name="a">a-value (green/magenta)</param>
 /// <param name="b">b-value (blue/yellow)</param>
 public ColorLab(Whitepoint ReferenceWhite, double L, double a, double b)
     : base()
 {
     this.wp = ReferenceWhite;
     this.L = L;
     this.a = a;
     this.b = b;
 }
Пример #18
0
 /// <summary>
 /// Creates a new instance of a BCH Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 public ColorBCH(Whitepoint ReferenceWhite)
     : this(ReferenceWhite, 0, 0, 0)
 {
 }
Пример #19
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorBef"/> class
 /// </summary>
 /// <param name="wp">The reference white for this color</param>
 public ColorBef(Whitepoint wp)
     : base(new Colorspace(wp), 0, 0, 0)
 {
 }
Пример #20
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorLCHBase"/> class
 /// </summary>
 /// <param name="wp">The reference white for this color</param>
 protected ColorLCHBase(Whitepoint wp)
     : base(new Colorspace(wp), 0, 0, 0)
 {
 }
Пример #21
0
 /// <summary>
 /// Creates a new instance of a Bef Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="B">B-value</param>
 /// <param name="e">e-value</param>
 /// <param name="f">f-value</param>
 public ColorBef(Whitepoint ReferenceWhite, double B, double e, double f)
     : base()
 {
     this.wp = ReferenceWhite;
     this.B = B;
     this.e = e;
     this.f = f;
 }
Пример #22
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorBCH"/> class
 /// </summary>
 /// <param name="B">Value for the Brightness channel</param>
 /// <param name="C">Value for the Chromaticity channel</param>
 /// <param name="H">Value for the Hue channel</param>
 /// <param name="wp">The reference white for this color</param>
 public ColorBCH(double B, double C, double H, Whitepoint wp)
     : base(new Colorspace(wp), B, C, H)
 {
 }
Пример #23
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorLCHab"/> class
 /// </summary>
 /// <param name="L">Value for the Lightness channel</param>
 /// <param name="C">Value for the Chroma channel</param>
 /// <param name="H">Value for the Hue channel</param>
 /// <param name="wp">The reference white for this color</param>
 public ColorLCHab(double L, double C, double H, Whitepoint wp)
     : base(L, C, H, wp)
 {
 }
Пример #24
0
 /// <summary>
 /// Creates a new instance of a DEF Color
 /// </summary>
 /// <param name="ReferenceWhite">The reference white</param>
 /// <param name="D">D-value</param>
 /// <param name="E">E-value</param>
 /// <param name="F">F-value</param>
 public ColorDEF(Whitepoint ReferenceWhite, double D, double E, double F)
     : base()
 {
     this.wp = ReferenceWhite;
     this.D = D;
     this.E = E;
     this.F = F;
 }
Пример #25
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorLCHBase"/> class
 /// </summary>
 /// <param name="L">Value for the Lightness channel</param>
 /// <param name="C">Value for the Chroma channel</param>
 /// <param name="H">Value for the Hue channel</param>
 /// <param name="wp">The reference white for this color</param>
 protected ColorLCHBase(double L, double C, double H, Whitepoint wp)
     : base(new Colorspace(wp), L, C, H)
 {
 }
Пример #26
0
 /// <summary>
 /// Creates a new instance of the <see cref="ColorDEF"/> class
 /// </summary>
 /// <param name="D">Value for the D channel</param>
 /// <param name="E">Value for the E channel</param>
 /// <param name="F">Value for the F channel</param>
 /// <param name="wp">The reference white for this color</param>
 public ColorDEF(double D, double E, double F, Whitepoint wp)
     : base(new Colorspace(wp), D, E, F)
 {
 }