Пример #1
0
        public List <ImageCompositionDynamic.Item> Init(ImageCompositionCustom composition, string name, Vector2Int textureSize, List <object> variables, ResourceCache resourceCache)
        {
            this.composition = composition;
            this.textureSize = textureSize;
            identityMul      = new Material("Atlas/Identity", "Atlas/IdentityMul")
            {
                blendingFactorSource      = OpenTK.Graphics.OpenGL4.BlendingFactor.One,
                blendingFactorDestination = OpenTK.Graphics.OpenGL4.BlendingFactor.OneMinusSrcAlpha
            };
            matrixUVMul = new Material("Atlas/MatrixUV", "Atlas/IdentityMul")
            {
                blendingFactorSource      = OpenTK.Graphics.OpenGL4.BlendingFactor.One,
                blendingFactorDestination = OpenTK.Graphics.OpenGL4.BlendingFactor.OneMinusSrcAlpha
            };
            identityDiv = new Material("Atlas/Identity", "Atlas/IdentityDiv");
            clear       = new Material("Atlas/Identity", "Atlas/Clear");

            deTrain = ImageCompositionStaticSimplex.GetComposition("Images/bg/train_animation/de_train.png", resourceCache);
            var ret = new List <ImageCompositionDynamic.Item>
            {
                new ImageCompositionDynamic.Item(deTrain)
            };

            trainBacks = new ImageComposition[9];
            for (int i = 0; i < trainBacks.Length; i++)
            {
                trainBacks[i] = ImageCompositionStaticSimplex.GetComposition($"Images/bg/train_animation/train_back_{i + 1}.png", resourceCache);
                ret.Add(new ImageCompositionDynamic.Item(trainBacks[i]));
            }
            return(ret);
        }
Пример #2
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)
        {
            Bitmap img = null;

            DA.GetData(0, ref img);
            string text = "";

            DA.GetData(1, ref text);
            int align = 0;

            DA.GetData(2, ref align);
            int size = 10;

            DA.GetData(3, ref size);
            Color cText = Color.Black;

            DA.GetData(4, ref cText);
            Color bText = Color.White;

            DA.GetData(5, ref bText);
            string font = "Arial";

            DA.GetData(6, ref font);

            DA.SetData(0, ImageComposition.AddTitle(img, text, size / 100.0f, align, cText, bText, font));
        }
Пример #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)
        {
            Bitmap img = null;

            DA.GetData(0, ref img);
            Color C = Color.White;

            DA.GetData(1, ref C);

            DA.SetData(0, ImageComposition.AddBackgroundImage(img, C));
        }
Пример #4
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)
        {
            List <Bitmap> sourceImage = new List <Bitmap>();

            DA.GetDataList(0, sourceImage);
            int Align = 0;

            DA.GetData(1, ref Align);
            Boolean Dir = false;

            DA.GetData(2, ref Dir);
            int Pad = 0;

            DA.GetData(3, ref Pad);

            DA.SetData(0, ImageComposition.ArrayImages(sourceImage, Align, Dir, Pad));
        }
        /// <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)
        {
            List <Bitmap> img = new List <Bitmap>();

            DA.GetDataList(0, img);
            int align = 0;

            DA.GetData(1, ref align);
            int size = 0;

            DA.GetData(2, ref size);
            Color Ftext = Color.White;

            DA.GetData(3, ref Ftext);
            string font = "Calibri";

            DA.GetData(4, ref font);

            DA.SetDataList(0, ImageComposition.AddNumbering(img, size, align, Ftext, font));
        }
Пример #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)
        {
            List <Bitmap> sourceImages = new List <Bitmap>();

            DA.GetDataList(0, sourceImages);
            int warp = 0;

            DA.GetData(1, ref warp);
            int pad = 0;

            DA.GetData(2, ref pad);
            Boolean dir = true;

            DA.GetData(3, ref dir);
            Color C = Color.White;

            DA.GetData(4, ref C);

            DA.SetData(0, ImageComposition.GridImages(sourceImages, warp, pad, dir, C));
        }
Пример #7
0
        public List <ImageCompositionDynamic.Item> Init(ImageCompositionCustom composition, string name, Vector2Int textureSize, List <object> variables, ResourceCache resourceCache)
        {
            this.composition = composition;
            this.textureSize = textureSize;
            identityMul      = new Material("Atlas/Identity", "Atlas/IdentityMul")
            {
                blendingFactorSource      = OpenTK.Graphics.OpenGL4.BlendingFactor.One,
                blendingFactorDestination = OpenTK.Graphics.OpenGL4.BlendingFactor.OneMinusSrcAlpha
            };
            matrixMul = new Material("Atlas/Matrix", "Atlas/IdentityMul")
            {
                blendingFactorSource      = OpenTK.Graphics.OpenGL4.BlendingFactor.One,
                blendingFactorDestination = OpenTK.Graphics.OpenGL4.BlendingFactor.OneMinusSrcAlpha
            };
            identityDiv = new Material("Atlas/Identity", "Atlas/IdentityDiv");
            clear       = new Material("Atlas/Identity", "Atlas/Clear");

            if (!ImageComposition.TryGetComposition("train tun", out tunAnim))
            {
                var files = FileManager.DataGetFiles("Images/bg/train_animation/tun", "*.png");
                var list  = new List <ImageCompositionFrameAnimation.FrameItemPrototype>(files.Length);
                for (int i = 0; i < files.Length; i++)
                {
                    list.Add(new ImageCompositionFrameAnimation.FrameItemPrototype(ImageCompositionStaticSimplex.GetComposition(files[i], resourceCache), 0.03f));
                }
                tunAnim = new ImageCompositionFrameAnimation("train tun", new Vector2Int((int)(textureSize.x / 2520f * 1920f), textureSize.y), list);
            }
            deTrain = ImageCompositionStaticSimplex.GetComposition("Images/bg/train_animation/de_train2.png", resourceCache);
            var ret = new List <ImageCompositionDynamic.Item>
            {
                new ImageCompositionDynamic.Item(deTrain),
                new ImageCompositionDynamic.Item(tunAnim)
            };

            return(ret);
        }
Пример #8
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)
        {
            Bitmap sourceImage = null;

            DA.GetData(0, ref sourceImage);
            string text = "";

            DA.GetData(1, ref text);
            int size = 1;

            DA.GetData(2, ref size);
            int align = 0;

            DA.GetData(3, ref align);
            Color C = Color.Black;

            DA.GetData(4, ref C);
            string font = "Arial";

            DA.GetData(5, ref font);


            DA.SetData(0, ImageComposition.AddTextImage(sourceImage, text, size, align, C, font));
        }