Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GR_WIN32IMAGE_H
00021 #define GR_WIN32IMAGE_H
00022
00023 #include "gr_Image.h"
00024
00025
00026 typedef struct tagBITMAPINFO BITMAPINFO;
00027
00028
00029 class ABI_EXPORT GR_Win32Image : public GR_RasterImage
00030 {
00031 public:
00032 GR_Win32Image(const char* szName);
00033 virtual ~GR_Win32Image();
00034
00035 virtual bool convertToBuffer(UT_ByteBuf** ppBB) const;
00036 virtual bool convertFromBuffer(const UT_ByteBuf* pBB, const std::string& mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00037
00038 void setDIB(BITMAPINFO *pDIB) { m_pDIB = pDIB; if (m_pDIB) setDisplaySize(m_pDIB->bmiHeader.biWidth,m_pDIB->bmiHeader.biHeight); }
00039 inline BITMAPINFO* getDIB(void) const { return m_pDIB; }
00040
00041 virtual GR_Image * createImageSegment(GR_Graphics * pG, const UT_Rect & rec);
00042 virtual bool hasAlpha (void) const;
00043 virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y);
00044
00045 protected:
00046 BITMAPINFO* m_pDIB;
00047
00048 private:
00049 bool _convertFromPNG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00050 bool _convertFromJPEG(const UT_ByteBuf* pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00051 };
00052
00053 #endif