Hi, folks.
 
Is it appropriate to have one template instantiation file like vil_gauss_filter+common.common.cxx, which includes a dozen of files like vil_gauss_filter+byte.byte.cxx, vil_gauss_filter+uint_16.float.cxx, and etc?
 
The advantage is that fewer files need to be taken care of. The disavantage is that it cannot be judged what is inside by looking at the filename. (But if someone does want to find out, just take a look into the file).
 
 
 
By the way, I wrote the following macro
#define RIL_IMAGE_VIEW_DRIVER_BASICS(pixel_format, functor) switch(pixel_format) { \
  case VIL_PIXEL_FORMAT_UINT_32:                      \
    {  functor(VIL_PIXEL_FORMAT_UINT_32);  }          \
    break;                                            \
  case VIL_PIXEL_FORMAT_UINT_16:                      \
    {  functor(VIL_PIXEL_FORMAT_UINT_16);  }          \
    break;                                            \
  case VIL_PIXEL_FORMAT_BYTE:                         \
    {  functor(VIL_PIXEL_FORMAT_BYTE);  }             \
    break;                                            \
  case VIL_PIXEL_FORMAT_INT_32:                       \
    {  functor(VIL_PIXEL_FORMAT_INT_32);  }           \
    break;                                            \
  case VIL_PIXEL_FORMAT_INT_16:                       \
    {  functor(VIL_PIXEL_FORMAT_INT_16);  }           \
    break;                                            \
  case VIL_PIXEL_FORMAT_SBYTE:                        \
    {  functor(VIL_PIXEL_FORMAT_SBYTE);  }            \
    break;                                            \
  case VIL_PIXEL_FORMAT_FLOAT:                        \
    {  functor(VIL_PIXEL_FORMAT_FLOAT);  }            \
    break;                                            \
  case VIL_PIXEL_FORMAT_DOUBLE:                       \
    {  functor(VIL_PIXEL_FORMAT_DOUBLE);  }           \
    break;                                            \
  }
 
which allows user to things easier. For example, in the GUI, to apply gaussian smoothing,  one can write
 
    #define GAUSS_SMOOTH(format)                       \
    typedef vil_pixel_format_type_of<format>::type T;  \
      vil_image_view<T> result;                        \
      vil_image_view<T> view = image->get_view();      \
      vil_gauss_filter_5tap( view, result, params );   \
      image->put_view( result );
 
    RIL_IMAGE_VIEW_DRIVER_BASICS(image->pixel_format(), GAUSS_SMOOTH);
Comments?
 
Regards,
Gehua Yang