imagedata.h 2.89 KB
 schultezub committed Jul 07, 2012 1 2 ``````#ifndef IMAGEDATA_H__ #define IMAGEDATA_H__ `````` schultezub committed Jul 06, 2012 3 `````` `````` schultezub committed Jul 07, 2012 4 5 ``````#include "core/datastructures/abstractdata.h" #include "core/datastructures/imagemappinginformation.h" `````` schultezub committed Jul 06, 2012 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 ``````#include "tgt/vector.h" namespace TUMVis { /** * Stores basic information about one (semantic) image of arbitrary dimension. * Different representations (e.g. local memory, OpenGL texture, OpenCL buffer) are * to be defined by inheritance. * * \todo */ class ImageData : public AbstractData { public: ImageData(size_t dimensionality, const tgt::svec3& size); virtual ~ImageData(); /** * Dimensionality of this image. * \return _dimensionality */ size_t getDimensionality() const; /** * Size of this image (number of elements per dimension). * \return _size */ const tgt::svec3& getSize() const; `````` schultezub committed Jul 15, 2012 35 36 37 38 39 40 `````` /** * Returns the number of elements (= tgt::hmul(getSize())). * \return _numElements */ size_t getNumElements() const; `````` schultezub committed Jul 06, 2012 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 `````` /** * Mapping information of this image * \return _mappingInformation */ const ImageMappingInformation& getMappingInformation() const; /** * Mapping information of this image * \return _mappingInformation */ ImageMappingInformation& getMappingInformation(); /** * Returns the subimage of this image given by \a llf and \a urb. * TODO: Check whether it is necessary to adjust image mapping! * * \param llf Lower-Left-Front coordinates of subimage * \param urb Upper-Right-Back coordinates of subimage * \return An image containing the subimage of this with the given coordinates. */ `````` schultezub committed Jul 07, 2012 61 `````` virtual ImageData* getSubImage(const tgt::svec3& llf, const tgt::svec3& urb) const = 0; `````` schultezub committed Jul 06, 2012 62 `````` `````` schultezub committed Jul 07, 2012 63 `````` protected: `````` schultezub committed Jul 15, 2012 64 65 66 67 68 69 70 71 72 `````` /** * Transforms a vector based position to the corresponding array index. * \note Caution, this method might return wrong results for non-continuous storage. * In this case you should provide an appropriate overload. * \param position Vector based image coordinates * \return Array index when image is stored continuously. */ size_t positionToIndex(const tgt::svec3& position) const; `````` schultezub committed Jul 06, 2012 73 74 `````` size_t _dimensionality; ///< Dimensionality of this image tgt::svec3 _size; ///< Size of this image (number of elements per dimension) `````` schultezub committed Jul 15, 2012 75 `````` size_t _numElements; ///< number of elements (= tgt::hmul(size)) `````` schultezub committed Jul 06, 2012 76 77 78 79 80 81 82 `````` ImageMappingInformation _mappingInformation; ///< Mapping information of this image static const std::string loggerCat_; }; } `````` schultezub committed Jul 07, 2012 83 ``#endif // IMAGEDATA_H__``