Пример #1
0
        public async Task UpdateImagesAsync(CancellationToken ct)
        {
            var args = new ImagePipeline.UpdateImageArgs
            {
                Images           = models.Images,
                LayerLevelBuffer = layerLevelBuffer,
                Progress         = models.Progress,
                TextureCache     = models.TextureCache,
                Filters          = null,
                Sync             = syncQuery
            };

            for (var i = 0; i < models.Pipelines.Count; i++)
            {
                var pipe = models.Pipelines[i];
                if (pipe.HasChanges && pipe.IsValid && pipe.IsEnabled)
                {
                    if (pipe.UseFilter)
                    {
                        args.Filters = GetPipeFilters(i);
                    }

                    await pipe.UpdateImageAsync(args, ct);
                }
            }
        }
Пример #2
0
        public async Task UpdateImagesAsync(CancellationToken ct)
        {
            var args = new ImagePipeline.UpdateImageArgs
            {
                Models  = models,
                Filters = null,
            };

            for (var i = 0; i < models.Pipelines.Count; i++)
            {
                var pipe = models.Pipelines[i];
                if (pipe.HasChanges && pipe.IsValid && pipe.IsEnabled)
                {
                    args.Filters = pipe.UseFilter ? GetPipeFilters(i) : null;

                    await pipe.UpdateImageAsync(args, ct);
                }
            }
        }
        public async Task UpdateImagesAsync(IProgress progress)
        {
            var args = new ImagePipeline.UpdateImageArgs
            {
                Models  = models,
                Filters = null,
            };

            var numCompute = models.Pipelines.Count(pipe => pipe.HasChanges && pipe.IsValid && pipe.IsEnabled);
            var curCompute = 0;

            for (var i = 0; i < models.Pipelines.Count; i++)
            {
                var pipe = models.Pipelines[i];
                if (pipe.HasChanges && pipe.IsValid && pipe.IsEnabled)
                {
                    args.Filters = pipe.UseFilter ? GetPipeFilters(i) : null;

                    await pipe.UpdateImageAsync(args, progress.CreateSubProgress((++curCompute) / (float)numCompute));
                }
            }
        }