Go to the documentation of this file.00001
00009 #ifndef SingleElementImage_H
00010 #define SingleElementImage_H
00011
00012 #include "BaseImageTemplate.h"
00013
00014 namespace puma2 {
00015
00027 template <class T>
00028 class SingleElementImage : public TBaseImg<T> {
00029 public:
00030 typedef T ElementType;
00031 typedef T PixelType;
00032 static int numberOfChannels() { return 1; }
00033 SingleElementImage(int width=0, int height = 0) : TBaseImg<T>(width, height) {}
00035 SingleElementImage(int width, int height, SingleElementImage* master, int xOffset, int yOffset)
00036 : TBaseImg<T>(width, height, master, xOffset, yOffset) {}
00037 const ElementType sample(int x, int y, int n) const {
00038 assert( n == 0 );
00039 return TBaseImg<T>::c0[y][x];
00040 }
00041 ElementType& sample(int x, int y, int n) {
00042 assert( n == 0 );
00043 return TBaseImg<T>::c0[y][x];
00044 }
00045 };
00046
00047 }
00048
00049 #endif