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_UNIXGNOMEIMAGE_H
00021 #define GR_UNIXGNOMEIMAGE_H
00022
00023 #include "ut_compiler.h"
00024
00025 ABI_W_NO_CONST_QUAL
00026 #include <gdk-pixbuf/gdk-pixbuf.h>
00027 ABI_W_POP
00028
00029 #include "gr_CairoGraphics.h"
00030
00031 class ABI_EXPORT GR_UnixImage : public GR_CairoRasterImage
00032 {
00033 public:
00034 GR_UnixImage(const char* pszName);
00035 GR_UnixImage(const char* pszName, GdkPixbuf * pPixbif);
00036 GR_UnixImage(const char* pszName, GRType imageType);
00037 virtual ~GR_UnixImage();
00038
00039 virtual bool convertToBuffer(UT_ConstByteBufPtr & ppBB) const;
00040 virtual bool convertFromBuffer(const UT_ConstByteBufPtr& pBB,
00041 const std::string & mimetype,
00042 UT_sint32 iDisplayWidth,
00043 UT_sint32 iDisplayHeight);
00044 bool saveToPNG(const char * szFile);
00045 virtual bool hasAlpha (void) const;
00046 virtual UT_sint32 rowStride (void) const;
00047 virtual GR_Image::GRType getType(void) const;
00048 GdkPixbuf * getData(void) const { return m_image; }
00049 void setData(GdkPixbuf *data)
00050 { m_image = data;}
00051 virtual void scaleImageTo(GR_Graphics * pG, const UT_Rect & rec);
00052 virtual bool isTransparentAt(UT_sint32 x, UT_sint32 y);
00053 void scale (UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight);
00054 virtual void cairoSetSource(cairo_t *);
00055 protected:
00056 virtual GR_UnixImage *makeSubimage(const std::string & n,
00057 UT_sint32 x, UT_sint32 y,
00058 UT_sint32 w, UT_sint32 h) const;
00059 private:
00060 GdkPixbuf * m_image;
00061 GR_Image::GRType m_ImageType;
00062 };
00063
00064 #endif