-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 );
-bool UncompressRLE16BitsFromRLE8Bits( size_t PixelNumber, int NumberOfFrames );
+ void GrabInformationsFromHeader( Header* header );
+ bool ReadAndDecompressPixelData( std::ifstream* fp );
+ void Squeeze();
+ bool BuildRGBImage();
+
+private:
+ // Use the fp:
+ bool ReadAndDecompressRLEFragment(
+ uint8_t* subDecompressed,
+ long fragmentSize,
+ long decompressedSegmentSize,
+ std::ifstream* fp );
+ void ReadAndDecompress12BitsTo16Bits( std::ifstream* fp ) throw ( FormatError );
+ bool ReadAndDecompressRLEFile( std::ifstream* fp );
+ bool ReadAndDecompressJPEGFile( std::ifstream* fp );
+ void BuildLUTRGBA( std::ifstream* fp );
+
+ // In place (within Decompressed and with no fp access) decompression
+ // or convertion:
+ void BuildLUTRGBA();
+ bool DecompressRLE16BitsFromRLE8Bits( int NumberOfFrames );
+ void ConvertSwapZone();
+ void ConvertReorderEndianity();
+ bool ConvertReArrangeBits() throw ( FormatError );
+ void ConvertRGBPlanesToRGBPixels();
+ void ConvertYcBcRPlanesToRGBPixels();
+ void ConvertHandleColor();
+
+ void ComputeDecompressedAndRGBSizes();
+ void AllocateRGB();
+ void AllocateDecompressed();
+
+// Variables
+ /// Pixel data represented as RGB after LUT color interpretation.
+ uint8_t* RGB;
+ /// Size of \ref RGB image.
+ size_t RGBSize;
+ /// Pixel data after decompression and bit/byte rearrangement.
+ uint8_t* Decompressed;
+ /// Size of \ref Decompressed image.
+ size_t DecompressedSize;
+ /// \brief Red/Green/Blue/Alpha LookUpTable build out of the
+ /// Red/Green/Blue LUT descriptors (see \ref BuildLUTRGBA ).
+ uint8_t* LutRGBA;