public VectorMap CopyAndUpdateColors(int newMaxBits, VectorMapProcessor processor) { var result = new VectorMap(_width, _height); var input = GetPixel(); var output = result.GetPixel(); for (var y = 0; y < _height; y++) for (var x = 0; x < _width; x++) { processor(x, y, input, output); input.MoveNext(); output.MoveNext(); } return result; }
private static VectorMap ApplyCurve(ColorMapUshort map, Vector3[] curve) { var result = new VectorMap(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[input.R].X, curve[input.G].Y, curve[input.B].Z); input.MoveNext(); } }); return result; }
public VectorMap CopyAndUpdateColors(int newMaxBits, VectorMapProcessor processor) { var result = new VectorMap(_width, _height); var input = GetPixel(); var output = result.GetPixel(); for (var y = 0; y < _height; y++) { for (var x = 0; x < _width; x++) { processor(x, y, input, output); input.MoveNext(); output.MoveNext(); } } return(result); }
public VectorMap ConvertToVector() { var result = new VectorMap(Width, Height); var mult = (float)MaxValue; Parallel.For(0, Height, y => { var input = GetRow(y); var output = result.GetRow(y); for (var x = 0; x < Width; x++) { output.SetAndMoveNext(input.R / mult, input.G / mult, input.B / mult); input.MoveNext(); } }); return(result); }
public void AutoAdjust(com.azi.Image.VectorMap map) { double maxbright = 0; Vector3 whiteColor = Vector3.One; map.ForEachPixel(color => { var bright = color.Value.LengthSquared(); if (bright < maxbright || color.Value.MaxComponent() >= 1f) { return; } maxbright = bright; whiteColor = color.Value; }); var maxComp = whiteColor.MaxComponent(); WhiteColor = whiteColor / maxComp; }
public VectorPixel(VectorMap map, int x, int y) : this(map, x, y, map.Width * map.Height) { }
public VectorPixel(VectorMap map) : this(map, 0, 0, map.Width * map.Height) { }
public VectorPixel(VectorMap map, int x, int y, int limit) { _map = map.Rgb; _limit = limit; _index = y * map.Width + x; }
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; }
private static void ApplySingleFilterInplace(VectorMap map, VectorToVectorFilter filter) { Parallel.For(0, map.Height, y => { var pix = map.GetRow(y); for (var x = 0; x < map.Width; x++) { filter.ProcessColor(pix, pix); pix.MoveNext(); } }); }
public VectorPixel(VectorMap map, int x, int y) : this(map, x, y, map.Width *map.Height) { }
public VectorPixel(VectorMap map) : this(map, 0, 0, map.Width *map.Height) { }