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)); }
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)); }
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; }
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)); }
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)); }
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); }
public FilterStepList(ImageCombineBuilder builder, List <IStepable> steps) : base(steps) { this.builder = builder; }