public RGB8Map MakeRGB8Map(int width, int height) { var result = new RGB8Map(width, height); var max = MaxValues.Average(); for (int x = 0; x < width; x++) { var ind = x * width / (_maxIndex + 1); var val = (Values[0][ind] + Values[1][ind] + Values[2][ind]) / 3; for (int y = (int)(height - height * val / max); y < height; y++) { result.SetPixel(x, y, 255, 255, 255); } } return(result); }
public static WriteableBitmap MakeBitmap(RGB8Map image) { var bmp = new WriteableBitmap(image.Width, image.Height, 96, 96, PixelFormats.Rgb24, null); bmp.WritePixels(new Int32Rect(0, 0, image.Width, image.Height), image.Rgb, image.Stride, 0); return bmp; }
public RGB8Map MakeRGB8Map(int width, int height) { var result = new RGB8Map(width, height); var max = MaxValues.Average(); for (int x = 0; x < width; x++) { var ind = x * width / (_maxIndex + 1); var val = (Values[0][ind] + Values[1][ind] + Values[2][ind]) / 3; for (int y = (int)(height - height * val / max); y < height; y++) result.SetPixel(x, y, 255,255,255); } return result; }
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; }
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; }