00001 /*========================================================================= 00002 00003 Program: gdcm 00004 Module: $RCSfile: gdcmPixelWriteConvert.cxx,v $ 00005 Language: C++ 00006 Date: $Date: 2005/02/04 16:51:36 $ 00007 Version: $Revision: 1.7 $ 00008 00009 Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de 00010 l'Image). All rights reserved. See Doc/License.txt or 00011 http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details. 00012 00013 This software is distributed WITHOUT ANY WARRANTY; without even 00014 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00015 PURPOSE. See the above copyright notices for more information. 00016 00017 =========================================================================*/ 00018 00019 #include "gdcmDebug.h" 00020 #include "gdcmPixelWriteConvert.h" 00021 00022 namespace gdcm 00023 { 00024 //----------------------------------------------------------------------------- 00025 // Constructor / Destructor 00029 PixelWriteConvert::PixelWriteConvert() 00030 { 00031 ReadData = 0; 00032 ReadDataSize = 0; 00033 00034 UserData = 0; 00035 UserDataSize = 0; 00036 } 00037 00041 PixelWriteConvert::~PixelWriteConvert() 00042 { 00043 } 00044 00045 //----------------------------------------------------------------------------- 00046 // Public 00052 void PixelWriteConvert::SetReadData(uint8_t *data, size_t size) 00053 { 00054 ReadData = data; 00055 ReadDataSize = size; 00056 } 00057 00063 void PixelWriteConvert::SetUserData(uint8_t *data, size_t size) 00064 { 00065 UserData = data; 00066 UserDataSize = size; 00067 } 00068 00073 uint8_t *PixelWriteConvert::GetData() 00074 { 00075 if(UserData) 00076 { 00077 return UserData; 00078 } 00079 else 00080 { 00081 return ReadData; 00082 } 00083 } 00084 00089 size_t PixelWriteConvert::GetDataSize() 00090 { 00091 if(UserData) 00092 { 00093 return UserDataSize; 00094 } 00095 else 00096 { 00097 return ReadDataSize; 00098 } 00099 } 00100 00101 //----------------------------------------------------------------------------- 00102 // Protected 00103 00104 //----------------------------------------------------------------------------- 00105 // Private 00106 00107 //----------------------------------------------------------------------------- 00108 // Print 00109 00110 //----------------------------------------------------------------------------- 00111 } // end namespace gdcm