Ejemplo n.º 1
0
        private static RGB8Map ApplyCurve(ColorMap <ushort> map, byte[][] curve)
        {
            var result = new RGB8Map(map.Width, map.Height);

            Parallel.For(0, result.Height, y =>
            {
                var input  = map.GetRow(y);
                var output = result.GetRow(y);
                for (var x = 0; x < result.Width; x++)
                {
                    output.SetAndMoveNext(curve[0][input.R], curve[1][input.G], curve[2][input.B]);
                    input.MoveNext();
                }
            });
            return(result);
        }
Ejemplo n.º 2
0
        private static RGB8Map ConvertToRGB(VectorMap map, VectorToColorFilter <byte> filter)
        {
            var result = new RGB8Map(map.Width, map.Height);

            Parallel.For(0, map.Height, y =>
            {
                var input  = map.GetRow(y);
                var output = result.GetRow(y);
                for (var x = 0; x < map.Width; x++)
                {
                    filter.ProcessColor(input, output);
                    input.MoveNext();
                    output.MoveNext();
                }
            });
            return(result);
        }