]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelWriteConvert.cxx
Debug vs Warning
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
index 34c5fcdbaa0914b71a296d771bf12e2bfaa1aa47..9258fc143d51e80b2d65e28001956a6e9fee0d51 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/04 16:51:36 $
-  Version:   $Revision: 1.7 $
+  Date:      $Date: 2005/10/23 15:09:19 $
+  Version:   $Revision: 1.11 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -45,9 +45,10 @@ PixelWriteConvert::~PixelWriteConvert()
 //-----------------------------------------------------------------------------
 // Public
 /**
- * \brief   SetReadData
- * @param   data data
- * @param   size size
+ * \brief   sets Read Data (and size)
+ * @param   data data (uint8_t is for prototyping. if your data is not uint8_t
+ *                     just cast the pointer for calling the method)
+ * @param   size data size, in bytes
  */
 void PixelWriteConvert::SetReadData(uint8_t *data, size_t size)
 {
@@ -56,9 +57,16 @@ void PixelWriteConvert::SetReadData(uint8_t *data, size_t size)
 }
 
 /**
- * \brief   Sets User Data
- * @param   data data
- * @param   size size
+ * \brief   Sets the internal pointer to the caller's inData
+ *          image representation, BUT WITHOUT COPYING THE DATA.
+ *          - 'image' Pixels are presented as C-like 2D arrays : line per line.
+ *          - 'volume'Pixels are presented as C-like 3D arrays : plane per plane 
+ * \warning Since the pixels are not copied, it is the caller's responsability
+ *          not to deallocate its data before gdcm uses them (e.g. with
+ *          the Write() method )
+ * @param   data data (uint8_t is for prototyping. if your data is not uint8_t
+ *                     just cast the pointer for calling the method)
+ * @param   size size, in bytes.
  */
 void PixelWriteConvert::SetUserData(uint8_t *data, size_t size)
 {
@@ -68,11 +76,12 @@ void PixelWriteConvert::SetUserData(uint8_t *data, size_t size)
 
 /**
  * \brief   Get Data (UserData or ReadData)
- * @return  data data
+ * @return  data (uint8_t is for prototyping. if your data is 
+ *                    *not* uint8_t, just cast the returned pointer)
  */
 uint8_t *PixelWriteConvert::GetData()
 {
-   if(UserData)
+   if ( UserData )
    {
       return UserData;
    }
@@ -84,11 +93,11 @@ uint8_t *PixelWriteConvert::GetData()
 
 /**
  * \brief   Get Data Size (UserData or ReadData)
- * @return  size size
+ * @return  size, in bytes.
  */
 size_t PixelWriteConvert::GetDataSize()
 {
-   if(UserData)
+   if ( UserData )
    {
       return UserDataSize;
    }