]> Creatis software - gdcm.git/commitdiff
In order to avoid confusing user with 'public' methods he is not allowed to use,
authorjpr <jpr>
Sun, 23 Oct 2005 15:09:19 +0000 (15:09 +0000)
committerjpr <jpr>
Sun, 23 Oct 2005 15:09:19 +0000 (15:09 +0000)
- move *all* the methods of PixelReadConvert, PixelWriteConvert to 'private'.
- declare as friend class FileHelper

src/gdcmPixelReadConvert.cxx
src/gdcmPixelReadConvert.h
src/gdcmPixelWriteConvert.cxx
src/gdcmPixelWriteConvert.h

index e941a07f61586ea1ce1f632831b24850098b89e0..1b8db70d519ae2b79ab115b9a98054c7639498b0 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/10/21 17:11:33 $
-  Version:   $Revision: 1.84 $
+  Date:      $Date: 2005/10/23 15:09:19 $
+  Version:   $Revision: 1.85 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -526,17 +526,19 @@ bool PixelReadConvert::ReadAndDecompressJPEGFile( std::ifstream *fp )
 }
 
 /**
- * \brief Build Red/Green/Blue/Alpha LUT from File
- *         when (0028,0004),Photometric Interpretation = [PALETTE COLOR ]
- *          and (0028,1101),(0028,1102),(0028,1102)
- *            - xxx Palette Color Lookup Table Descriptor - are found
- *          and (0028,1201),(0028,1202),(0028,1202)
- *            - xxx Palette Color Lookup Table Data - are found
+ * \brief Build Red/Green/Blue/Alpha LUT from File when :
+ *         - (0028,0004) : Photometric Interpretation == [PALETTE COLOR ]
+ *         and
+ *         - (0028,1101),(0028,1102),(0028,1102)
+ *            xxx Palette Color Lookup Table Descriptor are found
+ *          and 
+ *         - (0028,1201),(0028,1202),(0028,1202)
+ *           xxx Palette Color Lookup Table Data - are found
  * \warning does NOT deal with :
- *   0028 1100 Gray Lookup Table Descriptor (Retired)
- *   0028 1221 Segmented Red Palette Color Lookup Table Data
- *   0028 1222 Segmented Green Palette Color Lookup Table Data
- *   0028 1223 Segmented Blue Palette Color Lookup Table Data
+ *   0028 1100 Gray Lookup Table Descriptor (Retired)
+ *   0028 1221 Segmented Red Palette Color Lookup Table Data
+ *   0028 1222 Segmented Green Palette Color Lookup Table Data
+ *   0028 1223 Segmented Blue Palette Color Lookup Table Data
  *   no known Dicom reader deals with them :-(
  * @return a RGBA Lookup Table
  */
index f82f292db433e7dd7ddef35eae024366c45143a4..4aac9d3d3bdf83a663f2a9f1d87ef216564cf3f2 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelReadConvert.h,v $
   Language:  C++
-  Date:      $Date: 2005/10/20 08:29:50 $
-  Version:   $Revision: 1.25 $
+  Date:      $Date: 2005/10/23 15:09:19 $
+  Version:   $Revision: 1.26 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -40,19 +40,28 @@ typedef void (*VOID_FUNCTION_PUINT8_PFILE_POINTER)(uint8_t *, File *);
  */
 class GDCM_EXPORT PixelReadConvert : public Base
 {
-public:
+friend class FileHelper;
+
+private:
    PixelReadConvert();
    virtual ~PixelReadConvert();
 
    void Print( std::ostream &os = std::cout, std::string const &indent = "" );
 
    // Getter accessors:
+   /// \brief returns pixel area holding RGB Pixels, made from Grey level + LUT
    uint8_t *GetRGB()           { return RGB;     }
+   /// \brief returns pixel area length -RGB Pixels, (from Grey level + LUT)-
    size_t   GetRGBSize()       { return RGBSize; }
+   /// \brief returns pixel area holding native RGB Pixels or Grey level
    uint8_t *GetRaw()           { return Raw;     }
+   /// \brief returns pixel area size -native RGB Pixels or Grey level-
    size_t   GetRawSize()       { return RawSize; }
+   /// \brief returns Red Green Blue Alpha LUT
    uint8_t *GetLutRGBA()       { return LutRGBA; }
+   /// \brief returns Lut Item Number
    int      GetLutItemNumber() { return LutItemNumber; }
+   /// \brief returns Lut Item Size
    int      GetLutItemSize()   { return LutItemSize;   }
    // Predicates:
    bool IsRawRGB();
@@ -63,10 +72,11 @@ public:
    void Squeeze();
    bool BuildRGBImage();
    void BuildLUTRGBA();
-
+/// \brief Allow user to pass his own function to modify pixels 
+///        (e.g; mirror, upsidedown, ...) just after reading
    void SetUserFunction( VOID_FUNCTION_PUINT8_PFILE_POINTER userFunc ) 
                          { UserFunction = userFunc; }
-private:
+
    // Use the fp:
    void ReadAndDecompress12BitsTo16Bits( std::ifstream *fp ) 
                                  throw ( FormatError );
index b4f67961000b0600e0a85cca0e6bec4e2d8f58c3..9258fc143d51e80b2d65e28001956a6e9fee0d51 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/09/21 09:44:59 $
-  Version:   $Revision: 1.10 $
+  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,10 +45,10 @@ PixelWriteConvert::~PixelWriteConvert()
 //-----------------------------------------------------------------------------
 // Public
 /**
- * \brief   SetReadData
+ * \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 size in bytes
+ * @param   size data size, in bytes
  */
 void PixelWriteConvert::SetReadData(uint8_t *data, size_t size)
 {
@@ -57,10 +57,16 @@ void PixelWriteConvert::SetReadData(uint8_t *data, size_t size)
 }
 
 /**
- * \brief   Sets User Data
+ * \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
+ * @param   size size, in bytes.
  */
 void PixelWriteConvert::SetUserData(uint8_t *data, size_t size)
 {
@@ -87,7 +93,7 @@ uint8_t *PixelWriteConvert::GetData()
 
 /**
  * \brief   Get Data Size (UserData or ReadData)
- * @return  size size in bytes
+ * @return  size, in bytes.
  */
 size_t PixelWriteConvert::GetDataSize()
 {
index 7239238ea96944be1934725adc4a7ce8af9b15b8..bbdcad271068e231810a184a0b3afd09b9d1cff4 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: gdcmPixelWriteConvert.h,v $
   Language:  C++
-  Date:      $Date: 2005/01/11 15:15:38 $
-  Version:   $Revision: 1.6 $
+  Date:      $Date: 2005/10/23 15:09:19 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -27,28 +27,37 @@ namespace gdcm
 {
 /**
  * \brief Utility container for gathering the various forms the pixel data
- *        migth take during the user demanded processes.
+ *        migth take during the user requiered processes.
+ * \warning None of the methods may be called by end user (they have no
+ *          meaning outside the class FileHelper)
  */
 class GDCM_EXPORT PixelWriteConvert : public Base
 {
-public:
+friend class FileHelper;
+
+private:
    PixelWriteConvert();
    virtual ~PixelWriteConvert();
 
    // Set/Get of images and their size
-   void SetReadData(uint8_t *data,size_t size);
+   
+   void SetReadData(uint8_t *data, size_t size);
+   /// \brief returns ReadData
    uint8_t *GetReadData() { return ReadData; }
+   /// \brief returns ReadDataSize
    size_t   GetReadDataSize() { return ReadDataSize; }
 
-   void SetUserData(uint8_t *data,size_t size);
+   void SetUserData(uint8_t *data, size_t size);
+   /// \brief returns UserData
    uint8_t *GetUserData() { return UserData; }
+   /// \brief returns UserDataSize
    size_t   GetUserDataSize() { return UserDataSize; }
 
    // Get the used image and its size
    uint8_t *GetData();
    size_t   GetDataSize();
 
-private:
+
 // Variables
    /// Pixel data represented as RGB after LUT color interpretation.
    uint8_t *ReadData;