make_header.c 907 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "vizual.h"
  2. #include <grass/raster3d.h>
  3. void viz_make_header(file_info * hf, double dmin, double dmax,
  4. RASTER3D_Region * g3reg)
  5. {
  6. hf->min = dmin;
  7. hf->max = dmax;
  8. hf->xdim = g3reg->cols;
  9. hf->ydim = g3reg->rows;
  10. fprintf(stderr, "rows=%d cols=%d depths=%d\n",
  11. g3reg->rows, g3reg->cols, g3reg->depths);
  12. /*
  13. hf->ydim = g3reg->cols;
  14. hf->xdim = g3reg->rows;
  15. TRIAL: */
  16. hf->zdim = g3reg->depths;
  17. hf->north = g3reg->north;
  18. hf->south = g3reg->south;
  19. hf->east = g3reg->east;
  20. hf->west = g3reg->west;
  21. hf->top = g3reg->top;
  22. hf->bottom = g3reg->bottom;
  23. hf->ns_res = (g3reg->north - g3reg->south) / g3reg->rows;
  24. hf->ew_res = (g3reg->east - g3reg->west) / g3reg->cols;
  25. hf->tb_res = (g3reg->top - g3reg->bottom) / g3reg->depths;
  26. /* not needed here ?
  27. hf->zone
  28. hf->proj
  29. hf->type
  30. */
  31. }