ScalarImage.hpp

00001 // This file is part of the imaging2 class library.
00002 //
00003 // University of Innsbruck, Infmath Imaging, 2009.
00004 // http://infmath.uibk.ac.at
00005 //
00006 // All rights reserved.
00007 
00008 
00009 #ifndef IMAGE_SCALARIMAGE_H
00010 #define IMAGE_SCALARIMAGE_H
00011 
00012 #include <image/ImageInterface.hpp>
00013 
00014 namespace imaging
00015 {
00016 
00022   template <std::size_t N, class DATA_t>
00023   class ScalarImage : public ImageInterface<N, DATA_t>
00024   {
00025   public:
00026     static const std::size_t dimension = N;
00027     typedef DATA_t data_t;
00028 
00029   private:
00030     ublas::fixed_vector<size_t, dimension> _size;
00031     data_t _value;
00032 
00033   public:
00035     ScalarImage(const ublas::fixed_vector<size_t, dimension> & size, data_t value) :
00036       _size(size), _value(value) {}
00037       
00039     ScalarImage(const ScalarImage<dimension, data_t> & source) :
00040       _size(source._size), _value(source._value) {}
00041     
00042     const DATA_t & operator[](const ublas::fixed_vector<size_t, dimension> &) const { return _value; }
00043     
00044     const ublas::fixed_vector<size_t, dimension> & size() const { return _size; }
00045   };
00046 
00047 
00048 }
00049 
00050 #endif

Generated on Tue Feb 10 10:01:30 2009 for imaging2 by  doxygen 1.5.5