public static RayImage ArrayLogRangeXY(double[,] imagedata_in, ColorGradient c) { int ni = imagedata_in.GetLength(0); int nj = imagedata_in.GetLength(1); double[,] imagedata = new double[ni, nj]; for (int i = 0; i < ni; i++) { for (int j = 0; j < nj; j++) { imagedata[i, j] = Math.Log10(Math.Abs(imagedata_in[i, j]) + 1e-10); } } RayImage output = new RayImage(ni, nj); double minn = double.PositiveInfinity; double maxx = double.NegativeInfinity; for (int i = 0; i < ni; i++) { for (int j = 0; j < nj; j++) { maxx = (imagedata[i, j] > maxx) ? imagedata[i, j] : maxx; minn = (imagedata[i, j] < minn) ? imagedata[i, j] : minn; } } for (int i = 0; i < ni; i++) { for (int j = 0; j < nj; j++) { output.SetPixelXY(i, j, c.GetColor(imagedata[i, j], minn, maxx)); } } return(output); }
public static RayImage ArrayRangeXY(double[,] imagedata, ColorGradient c) { int ni = imagedata.GetLength(0); int nj = imagedata.GetLength(1); RayImage output = new RayImage(ni, nj); double minn = double.PositiveInfinity; double maxx = double.NegativeInfinity; for (int i = 0; i < ni; i++) { for (int j = 0; j < nj; j++) { maxx = (imagedata[i, j] > maxx) ? imagedata[i, j] : maxx; minn = (imagedata[i, j] < minn) ? imagedata[i, j] : minn; } } for (int i = 0; i < ni; i++) { for (int j = 0; j < nj; j++) { Triple col = c.GetColor(imagedata[i, j], minn, maxx); output.SetPixelXY(i, j, col); } } return(output); }
private void render_single(int i) { for (int j = 0; j < ny; j++) { im.SetPixelXY(i, j, GetBackgroundColor(rays[i, j])); } }
private void render_single(int i) { //Console.WriteLine(i); for (int j = 0; j < ny; j++) { //depth = 1 is a temporary fix!! Triple color = TraceRay(rays[i, j], 2, out bodyid_field[i, j], out distance_field[i, j], out times_field[i, j]); im.SetPixelXY(i, j, color); } }
public RayImage BasicRender(Camera c) { rays = c.GetRays(); im = new RayImage(c.NX, c.NY); nx = c.NX; ny = c.NY; if (par_rdr) { Parallel.For(0, nx, render_single); } else { for (int i = 0; i < c.NX; i++) { for (int j = 0; j < c.NY; j++) { im.SetPixelXY(i, j, GetBackgroundColor(rays[i, j])); } } } return(im); }