/// <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 X = null; IGH_Goo Y = null; IGH_Goo Z = null; // Access the input parameters if (!DA.GetData(0, ref X)) { return; } if (!DA.GetData(1, ref Y)) { return; } if (!DA.GetData(2, ref Z)) { return; } Bitmap A = null; Bitmap B = null; wObject W = new wObject(); mTexture T = new mTexture(); if (X != null) { X.CastTo(out A); } if (Y != null) { Y.CastTo(out B); } Bitmap C = new Bitmap(A); if (Z != null) { Z.CastTo(out W); } T = (mTexture)W.Element; if ((A.Width != B.Width) || (A.Height != B.Height)) { mMatchBitmaps BitmapPair = new mMatchBitmaps(A, B, MatchType, MatchSizing); A = new Bitmap(BitmapPair.BottomImage); B = new Bitmap(BitmapPair.TopImage); } C = new mCompositeTextureMorph(A, B, T).ModifiedBitmap; DA.SetData(0, 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) { // Declare variables IGH_Goo X = null; IGH_Goo Y = null; int M = 0; // Access the input parameters if (!DA.GetData(0, ref X)) { return; } if (!DA.GetData(1, ref Y)) { return; } if (!DA.GetData(2, ref M)) { return; } Bitmap A = new Bitmap(10, 10); if (X != null) { X.CastTo(out A); } Bitmap B = new Bitmap(10, 10); if (Y != null) { Y.CastTo(out B); } mMatchBitmaps f = new mMatchBitmaps(A, B, 0, M); DA.SetData(0, f.TopImage); DA.SetData(0, f.BottomImage); }
/// <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 int M = 0; IGH_Goo X = null; IGH_Goo Y = null; double P = 0.5; // Access the input parameters if (!DA.GetData(0, ref X)) { return; } if (!DA.GetData(1, ref Y)) { return; } if (!DA.GetData(2, ref M)) { return; } if (!DA.GetData(3, ref P)) { return; } Bitmap A = null; Bitmap B = null; if (X != null) { X.CastTo(out A); } if (Y != null) { Y.CastTo(out B); } Bitmap C = new Bitmap(A); if ((A.Width != B.Width) || (A.Height != B.Height)) { mMatchBitmaps BitmapPair = new mMatchBitmaps(A, B, MatchType, MatchSizing); A = new Bitmap(BitmapPair.BottomImage); B = new Bitmap(BitmapPair.TopImage); } switch (M) { case 0: C = new mCompositeAdd(A, B).ModifiedBitmap; break; case 1: C = new mCompositeSubtract(A, B).ModifiedBitmap; break; case 2: C = new mCompositeDifference(A, B).ModifiedBitmap; break; case 3: C = new mCompositeIntersect(A, B).ModifiedBitmap; break; case 4: C = new mCompositeFlatField(A, B).ModifiedBitmap; break; case 5: C = new mCompositeMerge(A, B).ModifiedBitmap; break; case 6: C = new mCompositeMorph(A, B, P).ModifiedBitmap; break; case 7: C = new mCompositeMove(A, B, (int)P).ModifiedBitmap; break; case 8: C = new mDifferenceThreshold(A, B, (int)P).ModifiedBitmap; break; case 9: C = new mDifferenceEuclidean(A, B, (int)P).ModifiedBitmap; break; } DA.SetData(0, 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) { // Declare variables int M = 0; IGH_Goo X = null; IGH_Goo Y = null; int P = 50; // Access the input parameters if (!DA.GetData(0, ref M)) { return; } if (!DA.GetData(1, ref X)) { return; } if (!DA.GetData(2, ref Y)) { return; } if (!DA.GetData(3, ref P)) { return; } Bitmap A = null; Bitmap B = null; if (X != null) { X.CastTo(out A); } if (Y != null) { Y.CastTo(out B); } Bitmap C = new Bitmap(A); if ((A.Width != B.Width) || (A.Height != B.Height)) { mMatchBitmaps BitmapPair = new mMatchBitmaps(A, B, MatchType, MatchSizing); A = new Bitmap(BitmapPair.BottomImage); B = new Bitmap(BitmapPair.TopImage); } switch (M) { case 0: C = new mDifferenceThreshold(A, B, P).ModifiedBitmap; break; case 1: C = new mDifferenceEuclidean(A, B, P).ModifiedBitmap; break; } DA.SetData(0, C); }