public void SetAxisProperties(int Spacing, wDomain Bounds, bool HasAxisLabel, double TextAngle) { Enabled = Spacing > 0; HasGrid = Spacing > 1; if (Enabled) { MajorSpacing = 1; } else { MajorSpacing = 0; } if (HasGrid) { MinorSpacing = Spacing; } else { MinorSpacing = 0; } Domain = Bounds; HasLabel = HasAxisLabel; Angle = TextAngle; }
public void SetGantSeries(DataPtSet PollenDataSet) { DataList = PollenDataSet; ChartType = SeriesChartType.Gantt; List <GanttPoint> DmList = new List <GanttPoint>(); ChartSequence = new RowSeries(); foreach (DataPt D in DataList.Points) { wDomain SD = SortDomain(D.Domain.Item1, D.Domain.Item2); DmList.Add(new GanttPoint(SD.T0, SD.T1)); RowSeries TempSeries = new RowSeries { Values = new ChartValues <GanttPoint> { new GanttPoint(SD.T0, SD.T1) } }; TempSeries = SetProperties(TempSeries, D); ChartSeries.Add(TempSeries); } ChartSequence.Values = new ChartValues <GanttPoint>(DmList.ToArray()); }
public mAdjustLevels(wDomain grayIn, wDomain grayOut) { GrayIn = grayIn; GrayOut = grayOut; RunLevels(); }
public mNoiseAdditive(wDomain GeneratorDomain) { Domain = GeneratorDomain; BitmapType = mFilter.BitmapTypes.Rgb24bpp; filter = new AdditiveNoise(); }
private wDomain SortDomain(double T0, double T1) { wDomain OutputDomain = new wDomain(T0, T1); if (T0 > T1) { OutputDomain = new wDomain(T1, T0); } return(OutputDomain); }
public mFigureFilter(wDomain WidthRange, wDomain HeightRange) { Width = WidthRange; Height = HeightRange; BitmapType = BitmapTypes.GrayscaleBT709; Effect = new BlobsFiltering((int)Width.T0, (int)Height.T0, (int)Width.T1, (int)Height.T1); filter = Effect; }
public mAdjustLevels(wDomain redIn, wDomain redOut, wDomain greenIn, wDomain greenOut, wDomain blueIn, wDomain blueOut) { RedIn = redIn; GreenIn = greenIn; BlueIn = blueIn; RedOut = redOut; GreenOut = greenOut; BlueOut = blueOut; RunLevels(); }
public mFilterYCbCrChannel(wDomain Luminance, wDomain Blue, wDomain Red) { Y = Luminance; Cb = Blue; Cr = Red; BitmapType = mFilter.BitmapTypes.None; Effect = new YCbCrExtractChannel(); filter = Effect; }
public mFilterYCbCrColor(wDomain Luminance, wDomain Blue, wDomain Red, bool isOut, Color fillColor) { Y = Luminance; Cb = Blue; Cr = Red; IsOut = isOut; FillColor = fillColor; BitmapType = mFilter.BitmapTypes.Rgb24bpp; Effect = new YCbCrFiltering(new Range((float)Y.T0, (float)Y.T1), new Range((float)Cb.T0, (float)Cb.T1), new Range((float)Cr.T0, (float)Cr.T1)); Effect.FillOutsideRange = IsOut; Effect.FillColor = YCbCr.FromRGB(new RGB(FillColor)); }
public mFigureFilter(wDomain WidthRange, wDomain HeightRange, bool coupled) { Width = WidthRange; Height = HeightRange; Coupled = coupled; BitmapType = BitmapTypes.GrayscaleBT709; Effect = new BlobsFiltering((int)Width.T0, (int)Height.T0, (int)Width.T1, (int)Height.T1); Effect.CoupledSizeFiltering = Coupled; filter = Effect; }
public mFigureUnique(wDomain WidthRange, wDomain HeightRange) { Width = WidthRange; Height = HeightRange; BitmapType = BitmapTypes.Rgb24bpp; Effect = new ConnectedComponentsLabeling(); Effect.MinWidth = (int)Width.T0; Effect.MaxWidth = (int)Width.T1; Effect.MinHeight = (int)Height.T0; Effect.MaxHeight = (int)Height.T1; filter = Effect; }
private void CalculateDataExtents() { double[] TempNumberSet = new double[Points.Count]; NumericSum = 0; for (int i = 0; i < Points.Count; i++) { DataPt Pt = Points[i]; TempNumberSet[i] = Pt.Number; NumericSum += Pt.Number; } Array.Sort(TempNumberSet); NumericBounds = new wDomain(TempNumberSet[0], TempNumberSet[TempNumberSet.Count() - 1]); }
public mFilterARGBColor(wDomain RedRange, wDomain GreenRange, wDomain BlueRange, bool isOut, Color fillColor) { Red = RedRange; Green = GreenRange; Blue = BlueRange; IsOut = isOut; FillColor = fillColor; BitmapType = mFilter.BitmapTypes.None; Effect = new ColorFiltering(new IntRange((int)Red.T0, (int)Red.T1), new IntRange((int)Green.T0, (int)Green.T1), new IntRange((int)Blue.T0, (int)Blue.T1)); Effect.FillOutsideRange = IsOut; Effect.FillColor = new Accord.Imaging.RGB(FillColor); filter = Effect; }
public mFilterARGBChannel(wDomain RedRange, wDomain GreenRange, wDomain BlueRange, bool isOut) { Red = RedRange; Green = GreenRange; Blue = BlueRange; IsOut = isOut; BitmapType = mFilter.BitmapTypes.None; Effect = new ChannelFiltering(new IntRange((int)Red.T0, (int)Red.T1), new IntRange((int)Green.T0, (int)Green.T1), new IntRange((int)Blue.T0, (int)Blue.T1)); Effect.RedFillOutsideRange = IsOut; Effect.GreenFillOutsideRange = IsOut; Effect.BlueFillOutsideRange = IsOut; filter = Effect; }
public mFilterHSL(wDomain HueValue, wDomain SaturationValue, wDomain LuminanceValue, bool isOut, Color fillColor) { Hue = HueValue; Sat = SaturationValue; Lum = LuminanceValue; IsOut = isOut; FillColor = fillColor; BitmapType = mFilter.BitmapTypes.None; Effect = new HSLFiltering(new Accord.IntRange((int)Hue.T0, (int)Hue.T1), new Accord.Range((float)Sat.T0, (float)Sat.T1), new Accord.Range((float)Lum.T0, (float)Lum.T1)); Effect.FillOutsideRange = IsOut; Effect.FillColor = HSL.FromRGB(new RGB(FillColor)); filter = Effect; }
/// <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) { // Declare variables IGH_Goo Z = null; int M = 0; Interval U = new Interval(50, 1000); Interval V = new Interval(50, 1000); // Access the input parameters if (!DA.GetData(0, ref Z)) return; if (!DA.GetData(1, ref M)) return; if (!DA.GetData(2, ref U)) return; if (!DA.GetData(3, ref V)) return; Bitmap A = null; if (Z != null) { Z.CastTo(out A); } Bitmap B = new Bitmap(A); mFilter Filter = new mFilter(); wDomain X = new wDomain(U.T0,U.T1); wDomain Y = new wDomain(V.T0, V.T1); switch (M) { case 0: Filter = new mFigureUnique(X, Y); break; case 1: Filter = new mFigureFilter(X, Y); break; case 2: Filter = new mFigureCorners(Color.Red); break; } B = new mApply(A, Filter).ModifiedBitmap; wObject W = new wObject(Filter, "Macaw", Filter.Type); DA.SetData(0, B); DA.SetData(1, W); }
public mFilterHSLLinear(wDomain SaturationIn, wDomain SaturationOut, wDomain LuminanceIn, wDomain LuminanceOut) { SatIn = SaturationIn; SatOut = SaturationOut; LumIn = LuminanceIn; LumOut = LuminanceOut; BitmapType = mFilter.BitmapTypes.None; Effect = new HSLLinear(); Effect.InSaturation = new Accord.Range((float)SatIn.T0, (float)SatIn.T1); Effect.OutSaturation = new Accord.Range((float)SatOut.T0, (float)SatOut.T1); Effect.InLuminance = new Accord.Range((float)LumIn.T0, (float)LumIn.T1); Effect.OutLuminance = new Accord.Range((float)LumOut.T0, (float)LumOut.T1); filter = Effect; }
public mAnalyzeBlobs(Bitmap BaseBitmap, wDomain WidthRange, wDomain HeightRange) { Width = WidthRange; Height = HeightRange; BitmapType = 0; Effect = new ConnectedComponentsLabeling(); Effect.MinWidth = (int)Width.T0; Effect.MaxWidth = (int)Width.T1; Effect.MinHeight = (int)Height.T0; Effect.MaxHeight = (int)Height.T1; Effect.Apply(BaseBitmap); Effect.BlobCounter.ProcessImage(BaseBitmap); Sequence.Clear(); Sequence.Add(Effect); }
public mFigureUnique(wDomain WidthRange, wDomain HeightRange, bool coupled, bool blob) { Width = WidthRange; Height = HeightRange; Coupled = coupled; Blob = blob; BitmapType = BitmapTypes.Rgb24bpp; Effect = new ConnectedComponentsLabeling(); Effect.MinWidth = (int)Width.T0; Effect.MaxWidth = (int)Width.T1; Effect.MinHeight = (int)Height.T0; Effect.MaxHeight = (int)Height.T1; Effect.CoupledSizeFiltering = Coupled; Effect.FilterBlobs = Blob; filter = Effect; }
private List <DataPt> ObjectListToDataPointList(List <object> objects) { List <DataPt> DataPoints = new List <DataPt>(); double[] TempNumberSet = new double[objects.Count]; NumericSum = 0; for (int i = 0; i < objects.Count; i++) { wObject W = (wObject)objects[i]; DataPt Pt = (DataPt)W.Element; DataPoints.Add((DataPt)W.Element); TempNumberSet[i] = Pt.Number; NumericSum += Pt.Number; } Array.Sort(TempNumberSet); NumericBounds = new wDomain(TempNumberSet[0], TempNumberSet[TempNumberSet.Count() - 1]); return(DataPoints); }
public mFilterYCbCrLinear(wDomain YinRange, wDomain CBinRange, wDomain CRinRange, wDomain YoutRange, wDomain CBoutRange, wDomain CRoutRange) { Yin = YinRange; Yout = YoutRange; Cbin = CBinRange; Cbout = CBoutRange; Crin = CRinRange; Crout = CRoutRange; BitmapType = mFilter.BitmapTypes.None; Effect = new YCbCrLinear(); Effect.InY = new Range((float)Yin.T0, (float)Yin.T1); Effect.InCb = new Range((float)Cbin.T0, (float)Cbin.T1); Effect.InCr = new Range((float)Crin.T0, (float)Crin.T1); Effect.OutY = new Range((float)Yout.T0, (float)Yout.T1); Effect.OutCb = new Range((float)Cbout.T0, (float)Cbout.T1); Effect.OutCr = new Range((float)Crout.T0, (float)Crout.T1); filter = Effect; }
public void SetXaxis(wDomain Bounds) { ChartsArea.AxisX.Minimum = Bounds.T0; ChartsArea.AxisX.Maximum = Bounds.T1; }
//GANTT CHART ######################################################################################################################### public void SetGanttChart() { if (ChartType != SeriesChartType.Gantt) { Element.Series.Clear(); } ChartType = SeriesChartType.Gantt; List <List <GanttPoint> > GP = new List <List <GanttPoint> >(); //Populate Data Set for (int i = 0; i < DataGrid.Sets.Count; i++) { List <GanttPoint> tGP = new List <GanttPoint>(); for (int j = 0; j < DataGrid.Sets[i].Points.Count; j++) { wDomain TD = SortDomain(DataGrid.Sets[i].Points[j].Domain.Item1, DataGrid.Sets[i].Points[j].Domain.Item2); tGP.Add(new GanttPoint(TD.T0, TD.T1)); } GP.Add(tGP); } int C = Element.Series.Count; int S = GP.Count; for (int i = C; i < S; i++) { Element.Series.Add(new RowSeries()); Element.Series[i].Values = new ChartValues <GanttPoint>(GP[i].ToArray()); } C = Element.Series.Count; if (C > S) { for (int i = S; i < C; i++) { Element.Series.RemoveAt(Element.Series.Count - 1); } } C = Element.Series.Count; for (int i = 0; i < S; i++) { int T = Element.Series[i].Values.Count; int V = GP[i].Count; for (int j = T; j < V; j++) { Element.Series[i].Values.Add(new GanttPoint()); } } for (int i = 0; i < S; i++) { int T = Element.Series[i].Values.Count; int V = GP[i].Count; if (T > V) { for (int j = V; j < T; j++) { Element.Series[i].Values.RemoveAt(Element.Series[i].Values.Count - 1); } } } for (int i = 0; i < S; i++) { int V = GP[i].Count; for (int j = 0; j < V; j++) { Element.Series[i].Values[j] = GP[i][j]; SetSequenceProperties(i, j, (RowSeries)Element.Series[i]); } } }