]> Creatis software - gdcm.git/blob - src/gdcmPixelWriteConvert.cxx
BUG: Remove my previous hack now this is properly fixed in gdcmBinEntry by JPR
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/02/04 16:51:36 $
7   Version:   $Revision: 1.7 $
8                                                                                 
9   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
10   l'Image). All rights reserved. See Doc/License.txt or
11   http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
12                                                                                 
13      This software is distributed WITHOUT ANY WARRANTY; without even
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15      PURPOSE.  See the above copyright notices for more information.
16                                                                                 
17 =========================================================================*/
18
19 #include "gdcmDebug.h"
20 #include "gdcmPixelWriteConvert.h"
21
22 namespace gdcm
23 {
24 //-----------------------------------------------------------------------------
25 // Constructor / Destructor
26 /**
27  * \brief Constructor
28  */
29 PixelWriteConvert::PixelWriteConvert() 
30 {
31    ReadData     = 0;
32    ReadDataSize = 0;
33
34    UserData     = 0;
35    UserDataSize = 0;
36 }
37
38 /**
39  * \brief Destructor
40  */
41 PixelWriteConvert::~PixelWriteConvert() 
42 {
43 }
44
45 //-----------------------------------------------------------------------------
46 // Public
47 /**
48  * \brief   SetReadData
49  * @param   data data
50  * @param   size size
51  */
52 void PixelWriteConvert::SetReadData(uint8_t *data, size_t size)
53 {
54    ReadData = data;
55    ReadDataSize = size;
56 }
57
58 /**
59  * \brief   Sets User Data
60  * @param   data data
61  * @param   size size
62  */
63 void PixelWriteConvert::SetUserData(uint8_t *data, size_t size)
64 {
65    UserData = data;
66    UserDataSize = size;
67 }
68
69 /**
70  * \brief   Get Data (UserData or ReadData)
71  * @return  data data
72  */
73 uint8_t *PixelWriteConvert::GetData()
74 {
75    if(UserData)
76    {
77       return UserData;
78    }
79    else
80    {
81       return ReadData;
82    }
83 }
84
85 /**
86  * \brief   Get Data Size (UserData or ReadData)
87  * @return  size size
88  */
89 size_t PixelWriteConvert::GetDataSize()
90 {
91    if(UserData)
92    {
93       return UserDataSize;
94    }
95    else
96    {
97       return ReadDataSize;
98    }
99 }
100
101 //-----------------------------------------------------------------------------
102 // Protected
103
104 //-----------------------------------------------------------------------------
105 // Private
106
107 //-----------------------------------------------------------------------------
108 // Print
109
110 //-----------------------------------------------------------------------------
111 } // end namespace gdcm