예제 #1
0
void Bundle::write_pgm(char *filename, int xsize, int ysize)
{
  Lowpass *low = new Lowpass (xsize, ysize, 2.0, 0.6);

  for (int i = 0; i < num_lines; i++) {
    Streamline *st = lines[i];
    for (int j = 0; j < st->samples - 1; j++) {
      float taper_scale = 0.5 * (st->pts[j].intensity + st->pts[j+1].intensity);
      low->filter_segment (st->xs(j), st->ys(j), st->xs(j+1), st->ys(j+1),
                           taper_scale);
    }
  }

  FloatImage *image = low->get_image_ptr();
  image->write_pgm (filename, 0.0, 1.1);

  delete low;
}
예제 #2
0
FloatImage *Bundle::filtered_render(int xsize, int ysize, float radius)
{
  Lowpass *low = new Lowpass (xsize, ysize, radius, 0.6);

  for (int i = 0; i < num_lines; i++) {
    Streamline *st = lines[i];
    for (int j = 0; j < st->samples - 1; j++) {
      float taper_scale = 0.5 * (st->pts[j].intensity + st->pts[j+1].intensity);
      low->filter_segment (st->xs(j), st->ys(j), st->xs(j+1), st->ys(j+1),
                           taper_scale);
    }
  }

  FloatImage *image = low->get_image_copy();
  delete low;

  return (image);
}