Program: gdcm
Module: $RCSfile: gdcmPixelConvert.h,v $
Language: C++
- Date: $Date: 2004/10/08 16:27:20 $
- Version: $Revision: 1.3 $
+ Date: $Date: 2004/10/12 04:35:47 $
+ Version: $Revision: 1.6 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
#include "gdcmCommon.h"
#include "gdcmRLEFramesInfo.h"
+#include "gdcmJPEGFragmentsInfo.h"
+#include "gdcmException.h"
+
+namespace gdcm
+{
/*
* \brief Utility container for gathering the various forms the pixel data
* migth take during the user demanded processes.
*/
-class GDCM_EXPORT gdcmPixelConvert {
-friend class gdcmFile;
+class GDCM_EXPORT PixelConvert {
+friend class File;
/// Pixel data represented as RGB after color interpretation
uint8_t* RGB;
size_t RGBSize; //aka ImageDataSize
uint8_t* Uncompressed;
size_t UncompressedSize;
public:
- gdcmPixelConvert();
- ~gdcmPixelConvert();
+ PixelConvert();
+ ~PixelConvert();
uint8_t* GetRGB() { return RGB; }
void SetRGBSize( size_t size ) { RGBSize = size; }
void Squeeze();
//////////////////////////////////////////////////////////
// In progress
-bool ReadAndUncompress12Bits( FILE* filePointer,
- size_t uncompressedSize,
- size_t PixelNumber );
-bool ReadUncompressed( FILE* filePointer,
- size_t uncompressedSize,
- size_t expectedSize );
-bool ConvertGrayAndLutToRGB( uint8_t *lutRGBA );
-bool ReadAndUncompressRLE8Bits(FILE* fp, size_t uncompressedSize );
-static bool UncompressRLE16BitsFromRLE8Bits(
- int XSize,
- int YSize,
- int NumberOfFrames,
- uint8_t* fixMemUncompressed );
-static bool ReadAndUncompressRLEFragment(
- uint8_t* decodedZone,
- long fragmentSize,
- long uncompressedSegmentSize,
- FILE* fp );
-static bool gdcm_read_RLE_file ( void* image_buffer,
- int XSize,
- int YSize,
- int ZSize,
- int BitsAllocated,
- gdcmRLEFramesInfo* RLEInfo,
- FILE* fp );
-
+ static bool UncompressRLE16BitsFromRLE8Bits(
+ int XSize,
+ int YSize,
+ int NumberOfFrames,
+ uint8_t* fixMemUncompressed );
+ static bool ReadAndUncompressRLEFragment(
+ uint8_t* decodedZone,
+ long fragmentSize,
+ long uncompressedSegmentSize,
+ FILE* fp );
+ static bool ReadAndDecompressRLEFile(
+ void* image_buffer,
+ int XSize,
+ int YSize,
+ int ZSize,
+ int BitsAllocated,
+ RLEFramesInfo* RLEInfo,
+ FILE* fp );
+ static void ConvertDecompress12BitsTo16Bits(
+ uint8_t* pixelZone,
+ int sizeX,
+ int sizeY,
+ FILE* filePtr) throw ( FormatError );
+ static void SwapZone(void* im, int swap, int lgr, int nb);
+ static void ConvertReorderEndianity(
+ uint8_t* pixelZone,
+ size_t imageDataSize,
+ int numberBitsStored,
+ int numberBitsAllocated,
+ int swapCode,
+ bool signedPixel );
+ static bool ReadAndDecompressJPEGFile(
+ uint8_t* destination,
+ int XSize,
+ int YSize,
+ int BitsAllocated,
+ int BitsStored,
+ int SamplesPerPixel,
+ int PixelSize,
+ bool isJPEG2000,
+ bool isJPEGLossless,
+ JPEGFragmentsInfo* JPEGInfo,
+ FILE* fp );
+ static bool PixelConvert::ConvertReArrangeBits(
+ uint8_t* pixelZone,
+ size_t imageDataSize,
+ int numberBitsStored,
+ int numberBitsAllocated,
+ int highBitPosition ) throw ( FormatError );
-
};
-
+} // end namespace gdcm
//-----------------------------------------------------------------------------
#endif