X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmFile.h;h=8491fb5297529cbed7b169a95621856092e1790e;hb=2d43f5c8ae2004242af2297ceb2926d81675548f;hp=5ef9efeae7b060a8e1743fc435b3fe19b2a66539;hpb=1d69b92978803204089d270599133917d944c651;p=gdcm.git diff --git a/src/gdcmFile.h b/src/gdcmFile.h index 5ef9efea..8491fb52 100644 --- a/src/gdcmFile.h +++ b/src/gdcmFile.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFile.h,v $ Language: C++ - Date: $Date: 2004/10/12 04:35:46 $ - Version: $Revision: 1.60 $ + Date: $Date: 2004/10/28 03:10:58 $ + Version: $Revision: 1.68 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,10 +21,10 @@ #include "gdcmCommon.h" #include "gdcmHeader.h" +#include "gdcmPixelConvert.h" namespace gdcm { - //----------------------------------------------------------------------------- /* * In addition to Dicom header exploration, this class is designed @@ -34,7 +34,7 @@ namespace gdcm class GDCM_EXPORT File { public: - File( Header *header ); + File( Header* header ); File( std::string const& filename ); virtual ~File(); @@ -42,28 +42,22 @@ public: /// Accessor to \ref Header Header* GetHeader() { return HeaderInternal; } - int ComputeDecompressedPixelDataSizeFromHeader(); - - void ConvertRGBPlanesToRGBPixels( uint8_t* source, uint8_t* destination ); - void ConvertYcBcRPlanesToRGBPixels( uint8_t* source, uint8_t* destination ); - /// Accessor to \ref ImageDataSize - size_t GetImageDataSize(){ return ImageDataSize; }; + size_t GetImageDataSize() { return ImageDataSize; }; /// Accessor to \ref ImageDataSizeRaw - size_t GetImageDataSizeRaw(){ return ImageDataSizeRaw; }; + size_t GetImageDataSizeRaw() { return ImageDataSizeRaw; }; + + /// Accessor to \ref PixelConverter + PixelConvert* GetPixelConverter() { return PixelConverter; }; uint8_t* GetImageData(); size_t GetImageDataIntoVector(void* destination, size_t maxSize); uint8_t* GetImageDataRaw(); - size_t GetImageDataIntoVectorRaw(void* destination, size_t maxSize); // see also Header::SetImageDataSize ?!? bool SetImageData (uint8_t* data, size_t expectedSize); - /// \todo When the caller is aware we simply point to the data: - /// int SetImageDataNoCopy (void* Data, size_t ExpectedSize); - // Write pixels of ONE image on hard drive // No test is made on processor "endianity" // The user must call his reader correctly @@ -72,16 +66,13 @@ public: bool WriteDcmExplVR(std::string const& fileName); bool WriteAcr (std::string const& fileName); - // Don't look any longer for the code : - // It's in file gdcmParsePixels.cxx - bool ParsePixelData(); - virtual bool SetEntryByNumber(std::string const& content, uint16_t group, uint16_t element) { HeaderInternal->SetEntryByNumber(content,group,element); return true; } + uint8_t* GetLutRGBA(); protected: bool WriteBase(std::string const& fileName, FileType type); @@ -89,25 +80,16 @@ protected: private: void Initialise(); - bool ReadPixelData(void* destination); - - // For JPEG 8 Bits, body in file gdcmJpeg.cxx - bool gdcm_write_JPEG_file (FILE* fp, void* image_buffer, - int image_width, int image_heigh, - int quality); - - // For JPEG 12 Bits, body in file gdcmJpeg12.cxx - bool gdcm_write_JPEG_file12 (FILE* fp, void* image_buffer, - int image_width, int image_height, - int quality); - void SaveInitialValues(); // will belong to the future PixelData class void RestoreInitialValues(); // will belong to the future PixelData class void DeleteInitialValues(); // will belong to the future PixelData class + uint8_t* GetDecompressed(); + int ComputeDecompressedPixelDataSizeFromHeader(); +private: // members variables: - /// \brief Header to use to load the file + /// Header to use to load the file Header *HeaderInternal; /// \brief Whether the underlying \ref Header was loaded by @@ -115,10 +97,13 @@ private: /// the destructor is in charge of deletion. bool SelfHeader; - /// wether already parsed + /// Wether already parsed or not bool Parsed; -// + /// Utility pixel converter + PixelConvert* PixelConverter; + +/// FIXME // --------------- Will be moved to a PixelData class //