]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelWriteConvert.cxx
Avoid warnings on C/C++ syle comments
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
index 5f97e055c7547f8b4430d97fe3d601892b2482e8..9258fc143d51e80b2d65e28001956a6e9fee0d51 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/01/07 22:19:48 $
-  Version:   $Revision: 1.4 $
+  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
                                                                                 
 =========================================================================*/
 
-//////////////////   TEMPORARY NOTE
-// look for "fixMem" and convert that to a member of this class
-// Removing the prefix fixMem and dealing with allocations should do the trick
-//
-// grep PixelWriteConvert everywhere and clean up !
-
 #include "gdcmDebug.h"
 #include "gdcmPixelWriteConvert.h"
 
@@ -29,36 +23,65 @@ namespace gdcm
 {
 //-----------------------------------------------------------------------------
 // Constructor / Destructor
+/**
+ * \brief Constructor
+ */
 PixelWriteConvert::PixelWriteConvert() 
 {
-   ReadData = 0;
+   ReadData     = 0;
    ReadDataSize = 0;
 
-   UserData = 0;
+   UserData     = 0;
    UserDataSize = 0;
 }
 
+/**
+ * \brief Destructor
+ */
 PixelWriteConvert::~PixelWriteConvert() 
 {
 }
 
 //-----------------------------------------------------------------------------
 // Public
-void PixelWriteConvert::SetReadData(uint8_t *data,size_t 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)
 {
    ReadData = data;
    ReadDataSize = size;
 }
 
-void PixelWriteConvert::SetUserData(uint8_t *data,size_t 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)
 {
    UserData = data;
    UserDataSize = size;
 }
 
+/**
+ * \brief   Get Data (UserData or ReadData)
+ * @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;
    }
@@ -68,9 +91,13 @@ uint8_t *PixelWriteConvert::GetData()
    }
 }
 
+/**
+ * \brief   Get Data Size (UserData or ReadData)
+ * @return  size, in bytes.
+ */
 size_t PixelWriteConvert::GetDataSize()
 {
-   if(UserData)
+   if ( UserData )
    {
       return UserDataSize;
    }
@@ -80,5 +107,14 @@ size_t PixelWriteConvert::GetDataSize()
    }
 }
 
+//-----------------------------------------------------------------------------
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
+
+//-----------------------------------------------------------------------------
+// Print
+
 //-----------------------------------------------------------------------------
 } // end namespace gdcm