00001
00002 #ifndef vil1_ip_traits_h_
00003 #define vil1_ip_traits_h_
00004 #ifdef VCL_NEEDS_PRAGMA_INTERFACE
00005 #pragma interface
00006 #endif
00007
00008
00009
00010
00011
00012
00013 struct vil1_ip_traits_null_type {};
00014
00015
00016 template <class T>
00017 struct vil1_ip_traits
00018 {
00019
00020 typedef vil1_ip_traits pixel_type;
00021
00022
00023 typedef vil1_ip_traits row_type;
00024 };
00025
00026 #if VCL_CAN_DO_PARTIAL_SPECIALIZATION
00027
00028 template <class T>
00029 struct vil1_ip_traits<T * *>
00030 {
00031 typedef T pixel_type;
00032 typedef T* row_type;
00033 };
00034
00035 template <class T>
00036 struct vil1_ip_traits<T const* const*>
00037 {
00038 typedef T pixel_type;
00039 typedef T const* row_type;
00040 };
00041
00042 template <class T>
00043 struct vil1_ip_traits<T * const*>
00044 {
00045 typedef T pixel_type;
00046 typedef T const* row_type;
00047 };
00048 #else
00049
00050 #define VIL1_IP_TRAITS_DECLARE(T, RT, PT) \
00051 VCL_DEFINE_SPECIALIZATION struct vil1_ip_traits<T > {\
00052 typedef PT pixel_type;\
00053 typedef RT row_type;\
00054 };
00055
00056 #define VIL1_IP_TRAITS_DECLARE_ALL(T)\
00057 VIL1_IP_TRAITS_DECLARE(T * *, T *, T)\
00058 VIL1_IP_TRAITS_DECLARE(T * const*, T *, T)\
00059 VIL1_IP_TRAITS_DECLARE(T * const* const, T * const, T)\
00060 VIL1_IP_TRAITS_DECLARE(T const* const*, T const*, T)
00061
00062 VIL1_IP_TRAITS_DECLARE_ALL(unsigned char)
00063 VIL1_IP_TRAITS_DECLARE_ALL(short)
00064 VIL1_IP_TRAITS_DECLARE_ALL(int)
00065 VIL1_IP_TRAITS_DECLARE_ALL(float)
00066
00067 #endif // VCL_CAN_DO_PARTIAL_SPECIALIZATION
00068
00069 #endif // vil1_ip_traits_h_