]> Creatis software - gdcm.git/blob - src/gdcmPixelWriteConvert.cxx
Coding Style + Doxygenation
[gdcm.git] / src / gdcmPixelWriteConvert.cxx
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmPixelWriteConvert.cxx,v $
5   Language:  C++
6   Date:      $Date: 2005/01/06 20:03:28 $
7   Version:   $Revision: 1.3 $
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 #include <stdio.h>
28
29 namespace gdcm
30 {
31 //-----------------------------------------------------------------------------
32 // Constructor / Destructor
33 PixelWriteConvert::PixelWriteConvert() 
34 {
35    ReadData = 0;
36    ReadDataSize = 0;
37
38    UserData = 0;
39    UserDataSize = 0;
40 }
41
42 PixelWriteConvert::~PixelWriteConvert() 
43 {
44 }
45
46 //-----------------------------------------------------------------------------
47 // Public
48 void PixelWriteConvert::SetReadData(uint8_t *data,size_t size)
49 {
50    ReadData = data;
51    ReadDataSize = size;
52 }
53
54 void PixelWriteConvert::SetUserData(uint8_t *data,size_t size)
55 {
56    UserData = data;
57    UserDataSize = size;
58 }
59
60 uint8_t *PixelWriteConvert::GetData()
61 {
62    if(UserData)
63    {
64       return UserData;
65    }
66    else
67    {
68       return ReadData;
69    }
70 }
71
72 size_t PixelWriteConvert::GetDataSize()
73 {
74    if(UserData)
75    {
76       return UserDataSize;
77    }
78    else
79    {
80       return ReadDataSize;
81    }
82 }
83
84 //-----------------------------------------------------------------------------
85 } // end namespace gdcm