Commit aa8a6504 authored by schultezub's avatar schultezub
Browse files

added/improved documentation

git-svn-id: https://camplinux.in.tum.de/svn/campvis/trunk@379 bb408c1c-ae56-11e1-83d9-df6b3e0c105e
parent d91e1c95
...@@ -44,18 +44,45 @@ namespace campvis { ...@@ -44,18 +44,45 @@ namespace campvis {
*/ */
struct ImageDataConverter { struct ImageDataConverter {
public: public:
/**
* Tries to convert \a source to \a TO ImageData type.
* \note Caller takes ownership of the created ImageData pointer.
* \tparam TO Target conversion type.
* \param source ImageData source for conversion.
* \return A pointer to the converted ImageData object, 0 if conversion failed.
*/
template<class TO> template<class TO>
static TO* tryConvert(const ImageData* source); static TO* tryConvert(const ImageData* source);
/**
* Converts \a source to \a TO ImageData type.
* \note Caller takes ownership of the created ImageData pointer.
* \note Valid conversions have to be implemented using template specialization.
* \tparam FROM Source conversion type.
* \tparam TO Target conversion type.
* \param source ImageData source for conversion.
* \return A pointer to the converted ImageData object, 0 if conversion failed.
*/
template<class FROM, class TO> template<class FROM, class TO>
static TO* convert(const FROM* source); static TO* convert(const FROM* source);
protected: protected:
/**
* Helper function for creating a GenericImageDataLocal<BASETYPE, NUMCHANNELS> from an ImageDataDisk
* \note Caller takes ownership of the created ImageData pointer.
* \tparam BASETYPE Image element base type
* \tparam NUMCHANNELS Number of channels per image element.
* \param source ImageData source for conversion.
* \return A pointer to the converted GenericImageDataLocal<BASETYPE, NUMCHANNELS> object, 0 if conversion failed.
*/
template<typename BASETYPE, size_t NUMCHANNELS> template<typename BASETYPE, size_t NUMCHANNELS>
static GenericImageDataLocal<BASETYPE, NUMCHANNELS>* convertToGenericLocal(const ImageDataDisk* source); static GenericImageDataLocal<BASETYPE, NUMCHANNELS>* convertToGenericLocal(const ImageDataDisk* source);
static const std::string loggerCat_; static const std::string loggerCat_;
}; };
// ================================================================================================
template<class FROM, class TO> template<class FROM, class TO>
TO* campvis::ImageDataConverter::convert(const FROM* source) { TO* campvis::ImageDataConverter::convert(const FROM* source) {
tgtAssert(false, "Conversion not implemented."); tgtAssert(false, "Conversion not implemented.");
......
...@@ -97,7 +97,8 @@ namespace campvis { ...@@ -97,7 +97,8 @@ namespace campvis {
/** /**
* Downloads the whole image data to local memory. * Downloads the whole image data to local memory.
* \return Pointer to the image data in the local memory. * \note The caller has to take ownership of the returned pointer.
* \return Pointer to the image data in the local memory, to be owned by caller.
*/ */
WeaklyTypedPointer getImageData() const; WeaklyTypedPointer getImageData() const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment