]> Creatis software - gdcm.git/blob - src/gdcmPixelConvert.h
* CLEANUP_ROUND for gdcmPixelConvert:
[gdcm.git] / src / gdcmPixelConvert.h
1 /*=========================================================================
2                                                                                 
3   Program:   gdcm
4   Module:    $RCSfile: gdcmPixelConvert.h,v $
5   Language:  C++
6   Date:      $Date: 2004/09/29 17:33:17 $
7   Version:   $Revision: 1.1 $
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
20 #ifndef GDCMPIXELCONVERT_H
21 #define GDCMPIXELCONVERTL_H
22
23 #include "gdcmCommon.h"
24
25 /*
26  * \brief Utility container for gathering the various forms the pixel data
27  *        migth take during the user demanded processes.
28  */
29 class GDCM_EXPORT gdcmPixelConvert {
30 friend class gdcmFile;
31    /// Pixel data represented as RGB after color interpretation
32    uint8_t* RGB;
33    size_t   RGBSize;          //aka ImageDataSize
34    /// Pixel data after decompression and bit/byte rearrangement.
35    uint8_t* Uncompressed;
36    size_t   UncompressedSize;
37 public:
38    gdcmPixelConvert();
39    ~gdcmPixelConvert();
40
41    uint8_t* GetRGB() { return RGB; }
42    void     SetRGBSize( size_t size ) { RGBSize = size; }
43    size_t   GetRGBSize() { return RGBSize; }
44    void     AllocateRGB();
45
46    uint8_t* GetUncompressed() { return Uncompressed; }
47    void     SetUncompressedSize( size_t size ) { UncompressedSize = size; }
48    size_t   GetUncompressedSize() { return UncompressedSize; }
49    void     AllocateUncompressed();
50
51    void Squeeze();
52 //////////////////////////////////////////////////////////
53 // In progress
54 bool ReadAndUncompress12Bits( FILE* filePointer,
55                               size_t uncompressedSize,
56                               size_t PixelNumber );
57 bool ReadUncompressed( FILE* filePointer,
58                        size_t uncompressedSize,
59                        size_t expectedSize );
60 bool ConvertGrayAndLutToRGB( uint8_t *lutRGBA );
61 bool ReadAndUncompressRLE8Bits(FILE* fp, size_t uncompressedSize );
62 bool UncompressRLE16BitsFromRLE8Bits( size_t PixelNumber, int NumberOfFrames );
63
64
65
66
67
68 };
69
70 //-----------------------------------------------------------------------------
71 #endif