/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap img = null; DA.GetData(0, ref img); Interval w = new Interval(0, img.Width); DA.GetData(1, ref w); Interval h = new Interval(0, img.Height); DA.GetData(2, ref h); Boolean coupled = true; DA.GetData(3, ref coupled); Tuple <Bitmap, Bitmap, Bitmap, Bitmap, List <Bitmap> > results; results = ImageConstruct.blob(img, w, h, coupled); DA.SetData(0, results.Item1); DA.SetData(1, results.Item2); DA.SetData(3, results.Item3); DA.SetData(4, results.Item4); DA.SetDataList(2, results.Item5); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap sourceImage = null; DA.GetData(0, ref sourceImage); Color C = Color.White; DA.GetData(1, ref C); DA.SetData(0, ImageConstruct.MatchColorImage(sourceImage, C)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap img = null; DA.GetData(0, ref img); List <Color> C = new List <Color>(); DA.GetDataList(1, C); DA.SetData(0, ImageConstruct.CreateGradient(img, C)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { int Width = 0; DA.GetData(0, ref Width); int Height = 0; DA.GetData(1, ref Height); int DPI = 72; DA.GetData(2, ref DPI); Color C = Color.White; DA.GetData(3, ref C); DA.SetData(0, ImageConstruct.ColorImage(Width, Height, DPI, DPI, C)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap img = null; DA.GetData(0, ref img); double param1 = 0; DA.GetData(1, ref param1); double param2 = 0; DA.GetData(2, ref param2); int texture = 0; DA.GetData(3, ref texture); DA.SetData(0, ImageConstruct.CreateTexture(img, param1, param2, texture)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap img = null; DA.GetData(0, ref img); Color Cc = Color.White; DA.GetData(1, ref Cc); List <Color> Ce = new List <Color>(); DA.GetDataList(2, Ce); int factor = 0; DA.GetData(3, ref factor); float newFactor = (float)(factor / 100.0f); newFactor = Math.Min(1, newFactor); newFactor = Math.Max(0, newFactor); DA.SetData(0, ImageConstruct.CreateBoundaryGradient(img, Cc, Ce, newFactor)); }
/// <summary> /// This is the method that actually does the work. /// </summary> /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param> protected override void SolveInstance(IGH_DataAccess DA) { Bitmap img = null; DA.GetData(0, ref img); Color Cs = Color.Black; DA.GetData(1, ref Cs); Color Ce = Color.White; DA.GetData(2, ref Ce); int angle = 0; DA.GetData(3, ref angle); int factor = 0; DA.GetData(4, ref factor); DA.SetData(0, ImageConstruct.CreateGradient(img, Cs, Ce, angle, factor / 100.0f)); //DA.SetData(0, ImageConstruct.CreateGradient2(img, Cs, Ce, new PointF(0, 0), // new PointF(img.Width, (int)(img.Height/2f)), factor / 100.0f)); }