ImageAccessorInterface.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_IMAGEACCESSORINTERFACE_H
00010 #define IMAGE_IMAGEACCESSORINTERFACE_H
00011 
00012 #include <image/ImageInterface.hpp>
00013 
00014 namespace imaging
00015 {
00016 
00034   template <class image_t, class DATA_t>
00035   class ImageAccessorInterface : public ImageInterface<image_t::dimension, DATA_t>
00036   {
00037   protected:
00039     image_t & _image_reference;
00040 
00041   public:
00042     static const size_t dimension = image_t::dimension;
00043     typedef DATA_t data_t;
00044 
00047     ImageAccessorInterface(image_t & image) : _image_reference(image) {}
00048 
00049     const ublas::fixed_vector<size_t, dimension> & size() const { return _image_reference.size(); }
00050     
00052     bool empty() const
00053     {
00054       for(size_t i = 0; i < dimension; ++i)
00055         if (size()(i) == 0)
00056           return true;
00057       
00058       return false;
00059     }
00060   };
00061 
00062 }
00063 
00064 #endif

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