g3dresample.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #include <stdio.h>
  2. #include <grass/gis.h>
  3. #include "G3d_intern.h"
  4. /*--------------------------------------------------------------------------*/
  5. /*!
  6. * \brief
  7. *
  8. * The default resampling function which uses nearest
  9. * neighbor resampling.
  10. *
  11. * \param map
  12. * \param row
  13. * \param col
  14. * \param depth
  15. * \param value
  16. * \param type
  17. * \return void
  18. */
  19. void
  20. G3d_nearestNeighbor(G3D_Map * map, int row, int col, int depth, void *value,
  21. int type)
  22. {
  23. /*AV*/
  24. /* BEGIN OF ORIGINAL CODE */
  25. /*
  26. G3d_getValueRegion (map, row, col, depth, value, type);
  27. */
  28. /* END OF ORIGINAL CODE */
  29. /*AV*/
  30. /* BEGIN OF MY CODE */
  31. G3d_getValueRegion(map, col, row, depth, value, type);
  32. /* END OF MY CODE */
  33. }
  34. /*--------------------------------------------------------------------------*/
  35. /*!
  36. * \brief
  37. *
  38. * Sets the resampling function to be used by
  39. * G3d_getValue () (cf.{g3d:G3d.getValue}). This function is defined
  40. * as follows:
  41. *
  42. * \return void
  43. */
  44. void G3d_setResamplingFun(G3D_Map * map, void (*resampleFun) ())
  45. {
  46. map->resampleFun = resampleFun;
  47. }
  48. /*--------------------------------------------------------------------------*/
  49. /*!
  50. * \brief
  51. *
  52. *
  53. * Returns in <em>resampleFun</em> a pointer to the resampling function used by
  54. * <em>map</em>.
  55. *
  56. * \return void
  57. */
  58. void G3d_getResamplingFun(G3D_Map * map, void (**resampleFun) ())
  59. {
  60. *resampleFun = map->resampleFun;
  61. }
  62. /*--------------------------------------------------------------------------*/
  63. /*!
  64. * \brief
  65. *
  66. * Returns
  67. * in <em>nnFunPtr</em> a pointer to G3d_nearestNeighbor () (cf.{g3d:G3d.nearestNeighbor}).
  68. *
  69. * \return void
  70. */
  71. void G3d_getNearestNeighborFunPtr(void (**nnFunPtr) ())
  72. {
  73. *nnFunPtr = G3d_nearestNeighbor;
  74. }