]> Creatis software - gdcm.git/blob - src/gdcmPixelWriteConvert.cxx
Some normalizations :
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/23 10:12:34 $
7   Version:   $Revision: 1.5 $
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 Construcror
28 PixelWriteConvert::PixelWriteConvert() 
29 {
30    ReadData = 0;
31    ReadDataSize = 0;
32
33    UserData = 0;
34    UserDataSize = 0;
35 }
36
37 /// \brief Destructor
38 PixelWriteConvert::~PixelWriteConvert() 
39 {
40 }
41
42 //-----------------------------------------------------------------------------
43 // Public
44
45 /**
46  * \brief   SetReadData
47  * @param   data data
48  * @param   size size
49  */
50 void PixelWriteConvert::SetReadData(uint8_t *data,size_t size)
51 {
52    ReadData = data;
53    ReadDataSize = size;
54 }
55
56 /**
57  * \brief   SetUserData
58  * @param   data data
59  * @param   size size
60  */
61 void PixelWriteConvert::SetUserData(uint8_t *data,size_t size)
62 {
63    UserData = data;
64    UserDataSize = size;
65 }
66
67 /**
68  * \brief   GetData
69  * @return  data 
70  */
71 uint8_t *PixelWriteConvert::GetData()
72 {
73    if(UserData)
74    {
75       return UserData;
76    }
77    else
78    {
79       return ReadData;
80    }
81 }
82
83 /**
84  * \brief   GetDataSize
85  * @return  size 
86  */
87 size_t PixelWriteConvert::GetDataSize()
88 {
89    if(UserData)
90    {
91       return UserDataSize;
92    }
93    else
94    {
95       return ReadDataSize;
96    }
97 }
98
99 //-----------------------------------------------------------------------------
100 } // end namespace gdcm