public override void Execute(List <string> arguments, Models model)
        {
            var reader   = new ParameterReader(arguments);
            var color    = reader.ReadString("image equation");
            var hasAlpha = reader.HasMoreArgs();
            var alpha    = reader.ReadString("alpha equation", "");

            reader.ExpectNoMoreArgs();

            model.Pipelines[0].Color.Formula = color;
            if (hasAlpha)
            {
                model.Pipelines[0].Alpha.Formula = alpha;
            }
        }
        public override void Execute(List <string> arguments, Models model)
        {
            var reader = new ParameterReader(arguments);

            if (reader.HasMoreArgs())
            {
                var idx = reader.ReadInt("index");
                reader.ExpectNoMoreArgs();

                model.Filter.DeleteFilter(idx);
            }
            else
            {
                // delete all
                model.Filter.SetFilter(new List <FilterModel>());
            }
        }
Example #3
0
        public override void Execute(List <string> arguments, Models model)
        {
            var reader = new ParameterReader(arguments);

            if (reader.HasMoreArgs())
            {
                var idx = reader.ReadInt("image index");
                reader.ExpectNoMoreArgs();

                model.Images.DeleteImage(idx);
            }
            else
            {
                // TODO add clear method to images
                while (model.Images.NumImages != 0)
                {
                    model.Images.DeleteImage(0);
                }
            }
        }
        public override void Execute(List <string> arguments, Models model)
        {
            var reader = new ParameterReader(arguments);
            var enable = reader.ReadBool("enabled");

            if (!reader.HasMoreArgs())
            {
                export.UseCropping = enable;
            }
            else
            {
                var xStart = reader.ReadInt("xStart");
                var yStart = reader.ReadInt("yStart");
                var xEnd   = reader.ReadInt("xEnd");
                var yEnd   = reader.ReadInt("yEnd");
                reader.ExpectNoMoreArgs();

                export.UseCropping = enable;
                export.CropStart   = new Size3(xStart, yStart, 0).ToCoords(model.Images.Size);
                export.CropEnd     = new Size3(xEnd, yEnd, 0).ToCoords(model.Images.Size);
            }
        }
        public override void Execute(List <string> arguments, Models model)
        {
            var reader = new ParameterReader(arguments);
            var enable = reader.ReadBool("enabled");

            if (!reader.HasMoreArgs())
            {
                model.Export.UseCropping = enable;
            }
            else
            {
                var xStart = reader.ReadInt("xStart");
                var yStart = reader.ReadInt("yStart");
                var xEnd   = reader.ReadInt("xEnd");
                var yEnd   = reader.ReadInt("yEnd");
                reader.ExpectNoMoreArgs();

                model.Export.UseCropping = enable;
                model.Export.CropStartX  = xStart;
                model.Export.CropStartY  = yStart;
                model.Export.CropEndX    = xEnd;
                model.Export.CropEndY    = yEnd;
            }
        }