• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

gr_Win32Image.h

Go to the documentation of this file.
00001 /* AbiWord
00002  * Copyright (C) 1998 AbiSource, Inc.
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017  * 02110-1301 USA.
00018  */
00019 
00020 #ifndef GR_WIN32IMAGE_H
00021 #define GR_WIN32IMAGE_H
00022 
00023 #include "gr_Image.h"
00024 
00025 // fwd. decl.
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 /* GR_WIN32IMAGE_H */

Generated on Sun Feb 14 2021 for AbiWord by  doxygen 1.7.1