private IStepable MakeStepable()
        {
            var builder = new ImageCombineBuilder(models.GlData.TextureCache);

            var steps = new List <IStepable> {
                new ImageCombineStepable(equation, finalImage, models, builder)
            };

            if (equation.UseFilter)
            {
                for (int i = 0; i < models.Filter.NumFilter; ++i)
                {
                    if (i == models.Filter.StatisticsPoint)
                    {
                        steps.Add(new StatisticsSaveStepable(builder));
                    }

                    if (models.Filter.Filter[i].IsVisibleFor(equationId))
                    {
                        steps.Add(models.Filter.Filter[i].MakeStepable(models, builder));
                    }
                }
            }
            steps.Add(new FinalImageStepable(builder, finalImage));

            return(new StepList(steps));
        }
示例#2
0
        public IStepable MakeStepable(Models models, ImageCombineBuilder builder)
        {
            if (!IsSepa)
            {
                return(MakeIterationStepable(models, builder, 0));
            }

            var steps = new List <IStepable>
            {
                MakeIterationStepable(models, builder, 0),
                MakeIterationStepable(models, builder, 1)
            };

            return(new StepList(steps));
        }
示例#3
0
 public FilterStepableBase(
     Models.Models models,
     FilterModel model,
     ImageCombineBuilder builder,
     int layer,
     int mipmap,
     int iteration)
 {
     Model          = model;
     this.iteration = iteration;
     this.Builder   = builder;
     this.models    = models;
     this.layer     = layer;
     this.mipmap    = mipmap;
 }
示例#4
0
        private IStepable MakeIterationStepable(Models models, ImageCombineBuilder builder, int iteration)
        {
            var steps = new List <IStepable>();

            for (int layer = 0; layer < models.Images.NumLayers; ++layer)
            {
                for (int mipmap = 0; mipmap < models.Images.NumMipmaps; ++mipmap)
                {
                    if (IsSingleInvocation)
                    {
                        steps.Add(new SingleDispatchStepper(models, this, builder, layer: layer, mipmap: mipmap, iteration: iteration));
                    }
                    else
                    {
                        steps.Add(new MultiDispatchStepper(models, this, builder, layer: layer, mipmap: mipmap, iteration: iteration));
                    }
                }
            }
            return(new FilterStepList(builder, steps));
        }
示例#5
0
 public MultiDispatchStepper(Models.Models models, FilterModel model, ImageCombineBuilder builder, int layer, int mipmap, int iteration) :
     base(models, model, builder, layer: layer, mipmap: mipmap, iteration: iteration)
 {
     this.width  = GetNumMinimalInvocations(models.Images.GetWidth(mipmap));
     this.height = GetNumMinimalInvocations(models.Images.GetHeight(mipmap));
 }
示例#6
0
 public SingleDispatchStepper(Models.Models models, FilterModel model, ImageCombineBuilder builder, int layer, int mipmap, int iteration) :
     base(models, model, builder, layer: layer, mipmap: mipmap, iteration: iteration)
 {
     this.width  = Utility.Utility.DivideRoundUp(models.Images.GetWidth(mipmap), FilterShader.LocalSize);
     this.height = Utility.Utility.DivideRoundUp(models.Images.GetHeight(mipmap), FilterShader.LocalSize);
 }
示例#7
0
 public FilterStepList(ImageCombineBuilder builder, List <IStepable> steps) : base(steps)
 {
     this.builder = builder;
 }