Inheritance: MonoBehaviour
Example #1
1
	void Foo3 (ICC c)
	{
		c.Count ();
	}
Example #2
1
 /// <summary>
 /// Creates a new instance of a YCbCr Color
 /// </summary>
 /// <param name="Y">Luma-value (0.0 - 1.0)</param>
 /// <param name="Cb">Blue-Yellow Chrominance-value (0.0 - 1.0)</param>
 /// <param name="Cr">Red-Green Chrominance-value (0.0 - 1.0)</param>
 /// <param name="profile">The ICC profile for this color</param>
 public ColorYCbCr(ICC profile, double Y, double Cb, double Cr)
     : base(profile)
 {
     this.Y = Y;
     this.Cb = Cb;
     this.Cr = Cr;
 }
Example #3
0
        public ActionResult Edit(int id)
        {
            ICC iCC = ICCBll.GetById(id);

            ViewBag.infoClass = new SelectList(InfoClassBll.GetAll(), "InfoClass_ID", "Info_Class", iCC.InfoClass_ID);
            return(View(iCC));
        }
Example #4
0
 /// <summary>
 /// Creates a new instance of a YCbCr Color
 /// </summary>
 /// <param name="Y">Luma-value (0.0 - 1.0)</param>
 /// <param name="Cb">Blue-Yellow Chrominance-value (0.0 - 1.0)</param>
 /// <param name="Cr">Red-Green Chrominance-value (0.0 - 1.0)</param>
 /// <param name="profile">The ICC profile for this color</param>
 public ColorYCbCr(ICC profile, double Y, double Cb, double Cr)
     : base(profile)
 {
     this.Y  = Y;
     this.Cb = Cb;
     this.Cr = Cr;
 }
Example #5
0
        public string FindStartingPair(int product)
        {
            ICC icc  = new ICC(Input);
            int verb = 1;
            int max  = 99;

            int  noun  = max / 2;
            bool found = false;

            for (int i = 0; i <= 99; i++)
            {
                for (int j = 0; j <= 99; j++)
                {
                    icc.ResetMemory();
                    icc.SetArrayValues(1, i);
                    icc.SetArrayValues(2, j);
                    icc.IntCodeComputer();
                    var output = icc.opCodeSequence[0];
                    if (output == product)
                    {
                        verb  = j;
                        found = true;
                        break;
                    }
                }
                if (found)
                {
                    noun = i;
                    break;
                }
            }
            return($"{100 * noun + verb}");
        }
Example #6
0
 public PVViewModel(ICC cc, IEventAggregator _e)
 {
     PC = new DelegateCommand(e, c);
     PC.ObservesProperty(() => IC);
     cc.CCS.RegisterCommand(PC);
     ea = _e;
 }
Example #7
0
        private void Space_CoBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool en = false; ICC nICC = null;

            if (((RGBSpaceName)((ComboBox)sender).SelectedIndex) == RGBSpaceName.ICC)
            {
                if (((ComboBox)sender).Name != General_SpaceDrDo.Name)
                {
                    iccOpenDialog.InitialDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "Profiles");
                    iccOpenDialog.Title            = "Choose ICC for " + ((ComboBox)sender).Name.Substring(0, ((ComboBox)sender).Name.IndexOf('_'));
                    if (iccOpenDialog.ShowDialog() == DialogResult.OK)
                    {
                        en = true; nICC = new ICC(iccOpenDialog.FileName);
                    }
                    else
                    {
                        ((ComboBox)sender).SelectedIndex = PrevSpace;
                    }
                }
            }
            else
            {
                en = false;
            }
            SetICCStuff(en, nICC, ((ComboBox)sender).Name);
            PrevSpace = ((ComboBox)sender).SelectedIndex;
        }
Example #8
0
        protected override string SolvePartTwo()
        {
            ICC icc = new ICC(input);

            icc.manualInputs.Enqueue(7);
            return(icc.IntCodeComputer().outputFromPhase.ToString());
        }
Example #9
0
 /// <summary>
 /// Creates a new instance of a RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0.0 - 1.0)</param>
 /// <param name="G">The green value (0.0 - 1.0)</param>
 /// <param name="B">The blue value (0.0 - 1.0)</param>
 /// <param name="IsLinear">States if the given values are linear or not</param>
 public ColorRGB(ICC ICCprofile, double R, double G, double B, bool IsLinear)
     : base(ICCprofile)
 {
     this.R        = R;
     this.G        = G;
     this.B        = B;
     this.IsLinear = IsLinear;
 }
Example #10
0
        public ActionResult DeleteConfirmed(int id)
        {
            ICC iCC = db.ICC.Find(id);

            db.ICC.Remove(iCC);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ICC InitCC()
 {
     if (cc == null)
     {
         cc = new CC(G);
     }
     return(cc);
 }
Example #12
0
 public LVViewModel(ICC cc, IEventAggregator _e)
 {
     PC = new DelegateCommand(e, c);
     PC.ObservesProperty(() => IC);
     cc.CCS.RegisterCommand(PC);
     ea = _e;
     ev = ea.GetEvent <EA>();
     hs(true);
 }
Example #13
0
        protected override string SolvePartOne()
        {
            ICC icc = new ICC(Input);

            icc.SetArrayValues(1, 12);
            icc.SetArrayValues(2, 2);
            icc.IntCodeComputer();
            return(icc.opCodeSequence[0].ToString());
        }
        public string GetHighestThrustOutput(int phaseSettingStart, int phaseSettingEnd, bool feedbackLoop)
        {
            ICC icc = new ICC(input);

            //need to run all iterations.
            // 0 - 4.
            Int64 highestOutput = 0;
            int   max           = 4;
            int   amplifiers    = 5;
            int   comboCounter  = 0;

            //int[] outputBuff = new int[1];
            //outputBuff[0] = acs.RunAmplifier(4, 0);
            //outputBuff[0] = acs.RunAmplifier(3, outputBuff[0]);
            //outputBuff[0] = acs.RunAmplifier(2, outputBuff[0]);
            //outputBuff[0] = acs.RunAmplifier(1, outputBuff[0]);
            //outputBuff[0] = acs.RunAmplifier(0, outputBuff[0]);
            ACS[] amps = Enumerable.Range(0, 5).Select(x => new ACS(new ICC(input))).ToArray();
            for (var i = 1; i < amps.Length; i++)
            {
                amps[i].input = amps[i - 1].output;
            }

            if (feedbackLoop)
            {
                amps[0].input = amps[amps.Length - 1].output;
            }
            for (int a = phaseSettingStart; a <= phaseSettingEnd; ++a)
            {
                for (int b = phaseSettingStart; b <= phaseSettingEnd; ++b)
                {
                    for (int c = phaseSettingStart; c <= phaseSettingEnd; ++c)
                    {
                        for (int d = phaseSettingStart; d <= phaseSettingEnd; ++d)
                        {
                            for (int e = phaseSettingStart; e <= phaseSettingEnd; ++e)
                            {
                                int[] perms  = { a, b, c, d, e };
                                Int64 output = RunPhase(amps, perms, feedbackLoop);
                                if (output > highestOutput)
                                {
                                    highestOutput = output;
                                    Console.WriteLine($"New Highest Output {highestOutput}");
                                }
                                icc.ResetMemory();
                            }
                        }
                    }
                }
            }

            return(highestOutput.ToString());
        }
Example #15
0
        private void ChooseICC_Click(object sender, EventArgs e)
        {
            bool en = false; ICC nICC = null;

            iccOpenDialog.InitialDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "Profiles");
            iccOpenDialog.Title            = "Choose ICC for " + ((Button)sender).Name.Substring(0, ((Button)sender).Name.IndexOf('_'));
            if (iccOpenDialog.ShowDialog() == DialogResult.OK)
            {
                en = true; nICC = new ICC(iccOpenDialog.FileName);
            }
            SetICCStuff(en, nICC, ((Button)sender).Name);
        }
Example #16
0
 public ActionResult Edit([Bind(Include = "idObject,idtypeOfService,internetSpeed,idlastMileType,idpostOffice")] ICC iCC)
 {
     if (ModelState.IsValid)
     {
         db.Entry(iCC).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.idlastMileType  = new SelectList(db.LastMileType, "lastMileType", "lastMileType", iCC.idlastMileType);
     ViewBag.idpostOffice    = new SelectList(db.PostOffice, "postOffice", "idpost", iCC.idpostOffice);
     ViewBag.idtypeOfService = new SelectList(db.TypeOfService, "typeOfService", "typeOfService", iCC.idtypeOfService);
     return(View(iCC));
 }
Example #17
0
        // GET: ICC/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ICC iCC = db.ICC.Find(id);

            if (iCC == null)
            {
                return(HttpNotFound());
            }
            return(View(iCC));
        }
Example #18
0
        public ActionResult Create(ICC iCC)
        {
            ICC @class = new ICC
            {
                ICC_Name     = iCC.ICC_Name,
                InfoClass_ID = iCC.InfoClass_ID
            };
            var temp = ICCBll.Add(@class);

            if (temp == true)
            {
                return(RedirectToAction("Index", "InfoClass"));
            }
            ViewBag.infoClass = new SelectList(InfoClassBll.GetAll(), "InfoClass_ID", "Info_Class", iCC.ICC_ID);
            return(View(iCC));
        }
        private List <EMI> CabeceraEMI(RFNCCAB model)
        {
            EMI        mEMI  = new EMI();
            List <EMI> lmEMI = new List <EMI>();

            ICC        mICC  = new ICC();
            List <ICC> lmICC = new List <ICC>();

            TAC        mTAC;
            List <TAC> lmTAC = new List <TAC>();

            mEMI.EMI_1  = mRCO.COEXID;
            mEMI.EMI_2  = mRCO.CVATNM;
            mEMI.EMI_3  = mRCO.COAUTN;
            mEMI.EMI_4  = mRCO.COAUTB;
            mEMI.EMI_6  = mRCO.CMPNAM;
            mEMI.EMI_10 = mRCO.CMPAD1;
            mEMI.EMI_11 = mRCO.COSTE;
            mEMI.EMI_12 = mRCO.COADR3;
            mEMI.EMI_13 = mRCO.CMPOST;
            mEMI.EMI_15 = mRCO.COCRCC;
            mEMI.EMI_18 = mRCO.CMPAD1;

            mICC.ICC_1 = mRCO.COCRNO;
            mICC.ICC_3 = mRCO.CMPOST;
            mICC.ICC_5 = mRCO.COSTE;
            mICC.ICC_6 = mRCO.CMPAD1;
            mICC.ICC_7 = mRCO.COCRCC;
            mICC.ICC_8 = mRCO.COADR4;
            lmICC.Add(mICC);
            mEMI.LMdlICC = lmICC;

            lmZCC = dZCC.GetTablesRut();
            foreach (ZCC item in lmZCC)
            {
                mTAC = new TAC()
                {
                    TAC_1 = item.CCCODE
                };
                lmTAC.Add(mTAC);
            }
            mEMI.LMdlTAC = lmTAC;

            lmEMI.Add(mEMI);

            return(lmEMI);
        }
Example #20
0
        // GET: ICC/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ICC iCC = db.ICC.Find(id);

            if (iCC == null)
            {
                return(HttpNotFound());
            }
            ViewBag.idlastMileType  = new SelectList(db.LastMileType, "lastMileType", "lastMileType", iCC.idlastMileType);
            ViewBag.idpostOffice    = new SelectList(db.PostOffice, "postOffice", "idpost", iCC.idpostOffice);
            ViewBag.idtypeOfService = new SelectList(db.TypeOfService, "typeOfService", "typeOfService", iCC.idtypeOfService);
            return(View(iCC));
        }
Example #21
0
        private void YCbCr_CoBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            bool en = false; ICC nICC = null;

            if (((YCbCrSpaceName)((ComboBox)sender).SelectedIndex) == YCbCrSpaceName.ICC)
            {
                iccOpenDialog.InitialDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "Profiles");
                iccOpenDialog.Title            = "Choose ICC for YCbCr";
                if (iccOpenDialog.ShowDialog() == DialogResult.OK)
                {
                    en = true; nICC = new ICC(iccOpenDialog.FileName);
                }
                else
                {
                    ((ComboBox)sender).SelectedIndex = PrevSpace;
                }
            }
            else
            {
                en = false;
            }
            SetICCStuff(en, nICC, ((ComboBox)sender).Name);
            PrevYCbCrSpace = YCbCr_CoBox.SelectedIndex;
        }
Example #22
0
 /// <summary>
 /// Creates a new instance of a HSL Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 /// <param name="L">Lightness (0.0 - 1.0)</param>
 public ColorHSL(ICC ICCprofile, double H, double S, double L)
     : base(ICCprofile, H, S)
 {
     this.L = L;
 }
Example #23
0
 /// <summary>
 /// Creates a new instance of a HSL Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 /// <param name="L">Lightness (0.0 - 1.0)</param>
 public ColorHSL(ICC ICCprofile, double H, double S, double L)
     : base(ICCprofile, H, S)
 {
     this.L = L;
 }
Example #24
0
 /// <summary>
 /// Creates a new instance of a YCbCr Color
 /// </summary>
 /// <param name="profile">The ICC profile for this color</param>
 public ColorYCbCr(ICC profile)
     : base(profile)
 {
 }
Example #25
0
 /// <summary>
 /// Creates a new instance of a HSL Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 public ColorHSL(ICC ICCprofile)
     : base(ICCprofile)
 {
 }
Example #26
0
 /// <summary>
 /// Creates a new instance of a HSV Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 /// <param name="V">Value (0.0 - 1.0)</param>
 public ColorHSV(ICC ICCprofile, double H, double S, double V)
     : base(ICCprofile, H, S)
 {
     this.V = V;
 }
Example #27
0
        private void SetICCStuff(bool Enabled, ICC nICC, string Name)
        {
            switch (Name)
            {
            case "General_SpaceDrDo":
                if (IsInit)
                {
                    foreach (ComboBox c in SpaceCoBoxes)
                    {
                        if (c.Name != General_SpaceDrDo.Name)
                        {
                            c.SelectedIndex = (int)BaseSpace;
                        }
                        else
                        {
                            ColorConverter.StandardColorspace = BaseSpace;
                        }
                    }
                }
                break;

            case "RGB_CoBox":
                RGB_ICCbox.Enabled = Enabled;
                RGB_ICC            = nICC;
                RGB_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "HSL_CoBox":
                HSL_ICCbox.Enabled = Enabled;
                HSL_ICC            = nICC;
                HSL_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "HSV_CoBox":
                HSV_ICCbox.Enabled = Enabled;
                HSV_ICC            = nICC;
                HSV_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "YCbCr_CoBox":
                YCbCr_ICCbox.Enabled = Enabled;
                YCbCr_ICC            = nICC;
                YCbCr_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "CMY_ChICC":
                CMY_ICCbox.Enabled = Enabled;
                CMY_ICC            = nICC;
                CMY_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "CMYK_ChICC":
                CMYK_ICCbox.Enabled = Enabled;
                CMYK_ICC            = nICC;
                CMYK_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "Gray_ChICC":
                Gray_ICCbox.Enabled = Enabled;
                Gray_ICC            = nICC;
                Gray_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;

            case "ColorX_ChICC":
                XColor_ICCbox.Enabled = Enabled;
                XColor_ICC            = nICC;
                XColor_ICCbox.Text    = (nICC == null) ? String.Empty : nICC.ProfileName;
                break;
            }
        }
Example #28
0
 public SVViewModel(ICC cc)
 {
     SA = cc;
 }
Example #29
0
 /// <summary>
 /// Creates a new instance of a HSx Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 public ColorHSx(ICC ICCprofile, double H, double S)
     : base(ICCprofile)
 {
     this.H = H;
     this.S = S;
 }
Example #30
0
 /// <summary>
 /// Creates a new instance of a YCbCr Color
 /// </summary>
 /// <param name="profile">The ICC profile for this color</param>
 public ColorYCbCr(ICC profile)
     : base(profile)
 {
 }
Example #31
0
 /// <summary>
 /// Creates a new instance of a RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="IsLinear">States if the given values are linear or not</param>
 public ColorRGB(ICC ICCprofile, bool IsLinear)
     : this(ICCprofile, 0, 0, 0, IsLinear)
 {
 }
Example #32
0
 /// <summary>
 /// Creates a new instance of a non-linear RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 public ColorRGB(ICC ICCprofile)
     : this(ICCprofile, 0, 0, 0, false)
 {
 }
 void Foo3(ICC c)
 {
     c.Count();
 }
Example #34
0
 /// <summary>
 /// Creates a new instance of a HSx Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 public ColorHSx(ICC ICCprofile)
     : this(ICCprofile, 0, 0)
 {
 }
    // Start is called before the first frame update
    void Start()
    {
        //formating gameobjects when game starts
        // Insantiation
        puzzleTwoDoors              = new GameObject("PuzzleTwoDoors");
        puzzleTwoControllers        = new GameObject("PuzzleTwoControllers");
        puzzleTwoTilemapControllers = new GameObject("PuzzleTwoTilemapControllers");
        puzzleTwoColorChanger       = new GameObject("PuzzleTwoColorChanger");
        // Parenting
        puzzleTwoDoors.transform.parent              = this.transform;
        puzzleTwoControllers.transform.parent        = this.transform;
        puzzleTwoTilemapControllers.transform.parent = this.transform;
        puzzleTwoColorChanger.transform.parent       = this.transform;
        // Position
        puzzleTwoDoors.transform.localPosition              = Vector2.zero;
        puzzleTwoControllers.transform.localPosition        = Vector2.zero;
        puzzleTwoTilemapControllers.transform.localPosition = Vector2.zero;
        puzzleTwoColorChanger.transform.localPosition       = Vector2.zero;

        //Doors
        foreach (UniquePrefabInfo UPI in doorPrefabInfo)
        {
            //instantiate
            GameObject temp = Instantiate(doorPrefab, Vector3.zero, Quaternion.Euler(0, 0, UPI.prefabRot), puzzleTwoDoors.transform);
            // Position
            temp.transform.localPosition = UPI.prefabLoc;
            //scale
            temp.transform.localScale = new Vector3(UPI.prefabScale.x, UPI.prefabScale.y, 1);
        }

        //Controllers
        foreach (UniquePrefabInfo UPI in controllerPrefabInfo)
        {
            //instantiate
            GameObject temp = Instantiate(doorControllerPrefab, Vector3.zero, Quaternion.Euler(0, 0, UPI.prefabRot), puzzleTwoControllers.transform);
            // Position
            temp.transform.localPosition = UPI.prefabLoc;
            //scale
            temp.transform.localScale = new Vector3(UPI.prefabScale.x, UPI.prefabScale.y, 1);
        }

        //Tilemap Controllers
        foreach (UniquePrefabInfo UPI in tileMapControllerPrefabInfo)
        {
            GameObject tilemapControllerPrefab = tilemapControllerGreenPrefab;

            switch (UPI.colorIndex)
            {
            case 1:
                /* Default to Green
                 * tilemapControllerPrefab = tilemapControllerGreenPrefab;
                 */
                break;

            case 2:
                tilemapControllerPrefab = tilemapControllerRedPrefab;
                break;

            case 3:
                tilemapControllerPrefab = tilemapControllerBluePrefab;
                break;
            }

            //instantiate
            GameObject temp = Instantiate(tilemapControllerPrefab, Vector3.zero, Quaternion.Euler(0, 0, UPI.prefabRot), puzzleTwoTilemapControllers.transform);
            // Position
            temp.transform.localPosition = UPI.prefabLoc;
            //scale
            temp.transform.localScale = new Vector3(UPI.prefabScale.x, UPI.prefabScale.y, 1);

            //set the prefab to have specific tilemaps enabled and disabled
            ColoredWallPuzzle cwp;
            cwp = temp.GetComponentInChildren <ColoredWallPuzzle>();
            switch (temp.name)
            {
            case "GreenOff(Clone)":
                cwp.SetTilemap(Tilemaps[0], Tilemaps[1], Tilemaps[2]);
                break;

            case "RedOff(Clone)":
                cwp.SetTilemap(Tilemaps[1], Tilemaps[0], Tilemaps[2]);
                break;

            case "BlueOff(Clone)":
                cwp.SetTilemap(Tilemaps[2], Tilemaps[0], Tilemaps[1]);
                break;
            }
        }
        //Color Change Items
        foreach (UniquePrefabInfo UPI in colorChangerPrefabInfo)
        {
            //instantiate
            GameObject temp = Instantiate(colorChangerPrefab, Vector3.zero, Quaternion.Euler(0, 0, UPI.prefabRot), puzzleTwoColorChanger.transform);
            // Position
            temp.transform.localPosition = UPI.prefabLoc;
            //scale
            temp.transform.localScale = new Vector3(UPI.prefabScale.x, UPI.prefabScale.y, 1);

            //set the interact color change so that character changes to blue on interact
            InteractColorChange ICC;
            ICC = temp.GetComponentInChildren <InteractColorChange>();
            ICC.SetColorChangeObject(ChangeColorSkill.Instance.gameObject);
        }
    }
Example #36
0
 /// <summary>
 /// Creates a new instance of a RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0 - 65535)</param>
 /// <param name="G">The green value (0 - 65535)</param>
 /// <param name="B">The blue value (0 - 65535)</param>
 /// <param name="IsLinear">States if the given values are linear or not</param>
 public ColorRGB(ICC ICCprofile, ushort R, ushort G, ushort B, bool IsLinear)
     : this(ICCprofile, R / (double)ushort.MaxValue, G / (double)ushort.MaxValue, B / (double)ushort.MaxValue, IsLinear)
 {
 }
Example #37
0
 /// <summary>
 /// Creates a new instance of a HSL Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 public ColorHSL(ICC ICCprofile)
     : base(ICCprofile)
 {
 }
Example #38
0
 /// <summary>
 /// Creates a new instance of a non-linear RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0.0 - 1.0)</param>
 /// <param name="G">The green value (0.0 - 1.0)</param>
 /// <param name="B">The blue value (0.0 - 1.0)</param>
 public ColorRGB(ICC ICCprofile, double R, double G, double B)
     : this(ICCprofile, R, G, B, false)
 {
 }
Example #39
0
 /// <summary>
 /// Creates a new instance of a HSV Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 /// <param name="V">Value (0.0 - 1.0)</param>
 public ColorHSV(ICC ICCprofile, double H, double S, double V)
     : base(ICCprofile, H, S)
 {
     this.V = V;
 }
Example #40
0
 /// <summary>
 /// Creates a new instance of a RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0.0 - 1.0)</param>
 /// <param name="G">The green value (0.0 - 1.0)</param>
 /// <param name="B">The blue value (0.0 - 1.0)</param>
 /// <param name="IsLinear">States if the given values are linear or not</param>
 public ColorRGB(ICC ICCprofile, double R, double G, double B, bool IsLinear)
     : base(ICCprofile)
 {
     this.R = R;
     this.G = G;
     this.B = B;
     this.IsLinear = IsLinear;
 }
Example #41
0
 /// <summary>
 /// Creates a new instance of a non-linear RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0 - 255)</param>
 /// <param name="G">The green value (0 - 255)</param>
 /// <param name="B">The blue value (0 - 255)</param>
 public ColorRGB(ICC ICCprofile, byte R, byte G, byte B)
     : this(ICCprofile, R / (double)byte.MaxValue, G / (double)byte.MaxValue, B / (double)byte.MaxValue, false)
 {
 }
Example #42
0
        private void LoadICC(bool From, bool IsRGB)
        {
            ICC nICC = null;

            iccOpenDialog.InitialDirectory = System.IO.Path.Combine(Environment.CurrentDirectory, "Profiles");
            iccOpenDialog.Title            = "Choose ICC";
            if (iccOpenDialog.ShowDialog() == DialogResult.OK)
            {
                nICC = new ICC(iccOpenDialog.FileName);
            }
            else
            {
                if (From)
                {
                    if (IsRGB)
                    {
                        ColorspaceFromDroDo.SelectedIndex = PrevFromSpace;
                    }
                    else
                    {
                        YCbCrSpaceFromDroDo.SelectedIndex = PrevYCbCrFromSpace;
                    }
                    ICCboxFrom.Text = String.Empty;
                }
                else
                {
                    if (IsRGB)
                    {
                        ColorspaceToDroDo.SelectedIndex = PrevToSpace;
                    }
                    else
                    {
                        YCbCrSpaceToDroDo.SelectedIndex = PrevYCbCrToSpace;
                    }
                    ICCboxTo.Text = String.Empty;
                }
            }

            if (nICC != null)
            {
                if (From)
                {
                    if (IsRGB)
                    {
                        FromICC = nICC; ICCboxFrom.Text = nICC.ProfileName;
                    }
                    else
                    {
                        FromYCbCrICC = nICC; ICCYCbCrFromBox.Text = nICC.ProfileName;
                    }
                }
                else
                {
                    if (IsRGB)
                    {
                        ToICC = nICC; ICCboxTo.Text = nICC.ProfileName;
                    }
                    else
                    {
                        ToYCbCrICC = nICC; ICCYCbCrToBox.Text = nICC.ProfileName;
                    }
                }
            }
        }
Example #43
0
 /// <summary>
 /// Creates a new instance of a RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0 - 255)</param>
 /// <param name="G">The green value (0 - 255)</param>
 /// <param name="B">The blue value (0 - 255)</param>
 /// <param name="IsLinear">States if the given values are linear or not</param>
 public ColorRGB(ICC ICCprofile, byte R, byte G, byte B, bool IsLinear)
     : this(ICCprofile, R / (double)byte.MaxValue, G / (double)byte.MaxValue, B / (double)byte.MaxValue, IsLinear)
 {
 }
Example #44
0
 /// <summary>
 /// Creates a new instance of a non-linear RGB Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="R">The red value (0 - 65535)</param>
 /// <param name="G">The green value (0 - 65535)</param>
 /// <param name="B">The blue value (0 - 65535)</param>
 public ColorRGB(ICC ICCprofile, ushort R, ushort G, ushort B)
     : this(ICCprofile, R / (double)ushort.MaxValue, G / (double)ushort.MaxValue, B / (double)ushort.MaxValue, false)
 {
 }
Example #45
0
 /// <summary>
 /// Creates a new instance of a HSx Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 /// <param name="H">Hue (0.0 - 360.0)</param>
 /// <param name="S">Saturation (0.0 - 1.0)</param>
 public ColorHSx(ICC ICCprofile, double H, double S)
     : base(ICCprofile)
 {
     this.H = H;
     this.S = S;
 }
Example #46
0
 /// <summary>
 /// Creates a new instance of a HSx Color
 /// </summary>
 /// <param name="ICCprofile">The ICC profile for this color</param>
 public ColorHSx(ICC ICCprofile)
     : this(ICCprofile, 0, 0)
 {
 }