]> Creatis software - gdcm.git/blobdiff - src/gdcmPixelWriteConvert.cxx
Reverse order sorting now works, even with user supplied function.
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
index a4f8cec9072a94114db333ec351f4976b0b2a17e..e5f8ae9d0192f831e44d7ec81f266f16755b631b 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2004/12/03 11:55:38 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2005/06/24 10:55:59 $
+  Version:   $Revision: 1.9 $
                                                                                 
   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"
-#include <stdio.h>
 
 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   SetReadData
+ * @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::SetReadData(uint8_t *data, size_t size)
 {
    ReadData = data;
    ReadDataSize = size;
 }
 
-void PixelWriteConvert::SetUserData(uint8_t* data,size_t size)
+/**
+ * \brief   Sets User Data
+ * @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 data data (uint8_t is for prototyping. if your data is not uint8_t
+ *                     just cast the returned pointer)
+ */
+uint8_t *PixelWriteConvert::GetData()
+{
+   if ( UserData )
+   {
+      return UserData;
+   }
+   else
+   {
+      return ReadData;
+   }
+}
+
+/**
+ * \brief   Get Data Size (UserData or ReadData)
+ * @return  size size in bytes
+ */
+size_t PixelWriteConvert::GetDataSize()
+{
+   if ( UserData )
+   {
+      return UserDataSize;
+   }
+   else
+   {
+      return ReadDataSize;
+   }
+}
+
 //-----------------------------------------------------------------------------
-} // end namespace gdcm
+// Protected
+
+//-----------------------------------------------------------------------------
+// Private
 
-// NOTES on File internal calls
-// User
-// ---> GetImageData
-//     ---> GetImageDataIntoVector
-//        |---> GetImageDataIntoVectorRaw
-//        | lut intervention
-// User
-// ---> GetImageDataRaw
-//     ---> GetImageDataIntoVectorRaw
+//-----------------------------------------------------------------------------
+// Print
+
+//-----------------------------------------------------------------------------
+} // end namespace gdcm