2.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

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 {
*/
struct ImageDataConverter {
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>
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>
static TO* convert(const FROM* source);
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>
static GenericImageDataLocal<BASETYPE, NUMCHANNELS>* convertToGenericLocal(const ImageDataDisk* source);
static const std::string loggerCat_;
};
// ================================================================================================
template<class FROM, class TO>
TO* campvis::ImageDataConverter::convert(const FROM* source) {
tgtAssert(false, "Conversion not implemented.");
......
......@@ -97,7 +97,8 @@ namespace campvis {
/**
* 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;
......
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