X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.cxx;h=2b09d36d2aadcc76671dde736a5fadac633d794f;hb=208af9d6c03679fd7eb2045badc0f5ee8e263aff;hp=0284a5c2dbe48f746144e6e4eea24177d7f65dfe;hpb=ec7826d8a6e9f1bfb58ab5c6ec45702a5b3fa30d;p=gdcm.git diff --git a/src/gdcmFile.cxx b/src/gdcmFile.cxx index 0284a5c2..2b09d36d 100644 --- a/src/gdcmFile.cxx +++ b/src/gdcmFile.cxx @@ -3,6 +3,7 @@ #include "gdcmFile.h" #include "gdcmUtil.h" #include "iddcmjpeg.h" +using namespace std; ///////////////////////////////////////////////////////////////// /** @@ -34,8 +35,6 @@ gdcmFile::gdcmFile(const char * filename) SetPixelDataSizeFromHeader(); } - -///////////////////////////////////////////////////////////////// /** * \ingroup gdcmFile * \brief calcule la longueur (in bytes) A ALLOUER pour recevoir les @@ -46,7 +45,6 @@ gdcmFile::gdcmFile(const char * filename) * * @return longueur a allouer */ - void gdcmFile::SetPixelDataSizeFromHeader(void) { int nb; string str_nb; @@ -63,13 +61,14 @@ void gdcmFile::SetPixelDataSizeFromHeader(void) { /** * \ingroup gdcmFile - * \brief Accessor + * \brief Returns the size (in bytes) of required memory to hold + * the pixel data represented in this file. + * @return The size of pixel data in bytes. */ size_t gdcmFile::GetImageDataSize(void) { return (lgrTotale); } - /** * \ingroup gdcmFile * \brief Read pixel data from disk (optionaly decompressing) into the @@ -135,12 +134,11 @@ bool gdcmFile::ReadPixelData(void* destination) { } -///////////////////////////////////////////////////////////////// /** * \ingroup gdcmFile * \brief Allocates necessary memory, copies the pixel data - * (image[s]/volume[s]) to newly allocated zone and return a - * pointer to it: + * (image[s]/volume[s]) to newly allocated zone. + * @return Pointer to newly allocated pixel data. */ void * gdcmFile::GetImageData (void) { PixelData = (void *) malloc(lgrTotale); @@ -148,16 +146,17 @@ void * gdcmFile::GetImageData (void) { return(PixelData); } -///////////////////////////////////////////////////////////////// /** - * \ingroup gdcmFile - * \brief amene en mémoire dans une zone précisee par l'utilisateur - * les Pixels d'une image - * - * @param destination - * @param MaxSize - * - * @return The number of bytes actually copied. + * \ingroup gdcmFile + * \brief Copies at most MaxSize bytes of pixel data to caller's + * memory space. + * @param destination Address (in caller's memory space) at which the + * pixel data should be copied + * @param MaxSize Maximum number of bytes to be copied. When MaxSize + * is not sufficient to hold the pixel data the copy is not + * executed (i.e. no partial copy). + * @return On success, the number of bytes actually copied. Zero on + * failure e.g. MaxSize is lower than necessary. */ size_t gdcmFile::GetImageDataIntoVector (void* destination, size_t MaxSize) {