Exemplo n.º 1
0
 public async Task Set(ILayerResult input) => await Task.Factory.StartNew(() => {
     Parallel.For(0, input.Width, x => {
         for (var y = 0; y < input.Height; y++)
         {
             _pixels[input.Left + x, input.Top + y] = input.Colors[x, y];
         }
     });
 });
Exemplo n.º 2
0
        public async Task Set(ILayerResult input) => await Task.Run(() => {
            var color = Interpolate(input.Score);

            Parallel.For(0, input.Width, x => {
                for (var y = 0; y < input.Height; y++)
                {
                    _pixels[input.Left + x, input.Top + y] = color;
                }
            });
        });
Exemplo n.º 3
0
        public async Task Set(ILayerResult input)
        {
            var tasks = _creators.Select(creator => creator.Set(input));

            await Task.WhenAll(tasks);
        }
Exemplo n.º 4
0
 public async Task Set(ILayerResult input) => await Task.Run(() => {