MultiChannelImageT.cpp 840 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "core/image/MultiChannelImageT.h"
  2. using namespace NICE;
  3. #define SET_FUNCS_MACRO(MYTYPE) \
  4. template <> \
  5. int MultiChannelImageT<MYTYPE>::getPixelInt(int x, int y, int channel) const \
  6. { \
  7. return (int)get(x,y,channel); \
  8. } \
  9. \
  10. template<>\
  11. double MultiChannelImageT<MYTYPE>::getPixelFloat(int x, int y, int channel) const\
  12. {\
  13. return (double)get(x,y,channel);\
  14. }\
  15. template<>\
  16. void MultiChannelImageT<MYTYPE>::setPixelInt(int x, int y, int channel, int pixel)\
  17. {\
  18. set(x,y,(MYTYPE)pixel,channel);\
  19. }\
  20. \
  21. template<>\
  22. void MultiChannelImageT<MYTYPE>::setPixelFloat(int x, int y, int channel, double pixel)\
  23. {\
  24. set(x,y,(MYTYPE)pixel,channel);\
  25. }
  26. SET_FUNCS_MACRO ( int )
  27. SET_FUNCS_MACRO ( long int )
  28. SET_FUNCS_MACRO ( double )
  29. SET_FUNCS_MACRO ( float )
  30. SET_FUNCS_MACRO ( unsigned int )