]> Creatis software - gdcm.git/blob - src/gdcmPixelWriteConvert.cxx
5f97e055c7547f8b4430d97fe3d601892b2482e8
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/07 22:19:48 $
7   Version:   $Revision: 1.4 $
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 //////////////////   TEMPORARY NOTE
20 // look for "fixMem" and convert that to a member of this class
21 // Removing the prefix fixMem and dealing with allocations should do the trick
22 //
23 // grep PixelWriteConvert everywhere and clean up !
24
25 #include "gdcmDebug.h"
26 #include "gdcmPixelWriteConvert.h"
27
28 namespace gdcm
29 {
30 //-----------------------------------------------------------------------------
31 // Constructor / Destructor
32 PixelWriteConvert::PixelWriteConvert() 
33 {
34    ReadData = 0;
35    ReadDataSize = 0;
36
37    UserData = 0;
38    UserDataSize = 0;
39 }
40
41 PixelWriteConvert::~PixelWriteConvert() 
42 {
43 }
44
45 //-----------------------------------------------------------------------------
46 // Public
47 void PixelWriteConvert::SetReadData(uint8_t *data,size_t size)
48 {
49    ReadData = data;
50    ReadDataSize = size;
51 }
52
53 void PixelWriteConvert::SetUserData(uint8_t *data,size_t size)
54 {
55    UserData = data;
56    UserDataSize = size;
57 }
58
59 uint8_t *PixelWriteConvert::GetData()
60 {
61    if(UserData)
62    {
63       return UserData;
64    }
65    else
66    {
67       return ReadData;
68    }
69 }
70
71 size_t PixelWriteConvert::GetDataSize()
72 {
73    if(UserData)
74    {
75       return UserDataSize;
76    }
77    else
78    {
79       return ReadDataSize;
80    }
81 }
82
83 //-----------------------------------------------------------------------------
84 } // end namespace gdcm