#ifndef BMP_FORMAT_WRAPPER_H #define BMP_FORMAT_WRAPPER_H namespace fw { class BMPFormatWrapper : public Singleton<BMPFormatWrapper> { public: BMPFormatWrapper(); virtual ~BMPFormatWrapper(); struct BMPImageFile { size_t iWidth; size_t iHeight; uint8* outBuffer; }; bool LoadImageFile(const std::string& sFileName, BMPImageFile* outData, LoadMode iLoadMode); bool WriteImage(const std::string& sFileName, uint32 iWidth, uint32 iHeight, const uchar* pImageBuffer, fw::size_t32 iRowPitch); Dimension2D GetBitmapDimension(const std::string& sImageFileName); Dimension2D GetBitmapDimension(const FileBuffer* pBMPImageBuffer); void FillBMP_DIBSection(char* pBufferBMPFile, BYTE* lpBitmapBits, Dimension2D imageSize); private: void LoadBMPHeaders(const std::string& sImageFileName, BITMAPFILEHEADER& bmpHeader, BITMAPINFOHEADER& bmpInfo); void LoadBMPHeaders(const FileBuffer* pBMPImageBuffer, BITMAPFILEHEADER& bmpHeader, BITMAPINFOHEADER& bmpInfo); }; } #endif