Beispiel #1
0
        /// <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);
        }
Beispiel #2
0
        public mFilterTexture(mTexture SourceTexture, mFilters Filter)
        {
            BitmapType = Filter.BitmapType;

            MaskTexture = SourceTexture;

            Effect = new TexturedFilter(MaskTexture.Texture, Filter.Sequence[0]);

            Sequence.Clear();
            Sequence.Add(Effect);
        }
Beispiel #3
0
        /// <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;
            double X = 5.0;
            double Y = 10.0;

            // 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;
            }

            mTexture Texture = new mTexture();

            switch (M)
            {
            case 0:
                Texture = new mTextureClouds();
                break;

            case 1:
                Texture = new mTextureWood(X);
                break;

            case 2:
                Texture = new mTextureMarble(X, Y);
                break;

            case 3:
                Texture = new mTextureTextile();
                break;

            case 4:
                Texture = new mTextureLabyrinth();
                break;
            }


            wObject W = new wObject(Texture, "Macaw", Texture.Type);


            DA.SetData(0, W);
        }
Beispiel #4
0
        public mCompositeTextureMorph(Bitmap UnderlayBitmap, Bitmap OverlayBitmap, mTexture SourceTexture)
        {
            MaskTexture = SourceTexture;
            BitmapUnder = new mSetFormat(UnderlayBitmap, mFilter.BitmapTypes.Rgb24bpp).ModifiedBitmap;
            BitmapOver  = new mSetFormat(OverlayBitmap, mFilter.BitmapTypes.Rgb24bpp).ModifiedBitmap;

            ModifiedBitmap = new Bitmap(BitmapUnder);

            Effect = new TexturedMerge(MaskTexture.Texture);

            Effect.OverlayImage = BitmapOver;

            ModifiedBitmap = Effect.Apply(BitmapUnder);
        }
Beispiel #5
0
        /// <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;

            // Access the input parameters
            if (!DA.GetData(0, ref X))
            {
                return;
            }
            if (!DA.GetData(1, ref Y))
            {
                return;
            }

            mTexture T = new mTexture();
            wObject  Z = new wObject();
            wObject  U = new wObject();
            mFilters F = new mFilters();


            if (X != null)
            {
                X.CastTo(out Z);
            }
            T = (mTexture)Z.Element;
            if (Y != null)
            {
                Y.CastTo(out U);
            }
            F = (mFilters)U.Element;



            mFilters Filter = new mFilters();

            Filter = new mFilterTexture(T, F);


            wObject W = new wObject(Filter, "Macaw", Filter.Type);


            DA.SetData(0, W);
        }
Beispiel #6
0
        /// <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;
            int     W = 800;
            int     H = 600;

            // Access the input parameters
            if (!DA.GetData(0, ref X))
            {
                return;
            }
            if (!DA.GetData(1, ref W))
            {
                return;
            }
            if (!DA.GetData(2, ref H))
            {
                return;
            }

            wObject  Z = new wObject();
            mTexture T = new mTexture();

            if (X != null)
            {
                X.CastTo(out Z);
            }
            T = (mTexture)Z.Element;

            Bitmap B = new Bitmap(new mTextureApply(T, W, H).GeneratedBitmap);


            DA.SetData(0, B);
        }