#include <ie_impGraphic_GdkPixbuf.h>
Public Member Functions | |
| IE_ImpGraphic_GdkPixbuf () | |
| virtual | ~IE_ImpGraphic_GdkPixbuf () |
| virtual UT_Error | importGraphic (UT_ByteBuf *pBB, FG_Graphic **ppfg) |
Private Member Functions | |
| GdkPixbuf * | pixbufForByteBuf (UT_ByteBuf *pBB, std::string &mimetype) |
| void | _createPNGFromPixbuf (GdkPixbuf *pixbuf) |
| UT_Error | _png_write (GdkPixbuf *pixbuf) |
| needed for the stejmp context | |
| GdkPixbuf * | _loadXPM (UT_ByteBuf *pBB) |
| UT_Error | Initialize_PNG (void) |
Private Attributes | |
| png_structp | m_pPNG |
| png_infop | m_pPNGInfo |
| UT_ByteBuf * | m_pPngBB |
| bool | m_bIsXPM |
| IE_ImpGraphic_GdkPixbuf::IE_ImpGraphic_GdkPixbuf | ( | ) |
| IE_ImpGraphic_GdkPixbuf::~IE_ImpGraphic_GdkPixbuf | ( | ) | [virtual] |
| void IE_ImpGraphic_GdkPixbuf::_createPNGFromPixbuf | ( | GdkPixbuf * | pixbuf | ) | [private] |
This method fills the m_pPNG byte buffer with a PNG representation of of the supplied gdk-pixbuf. This can be saved in the PT as a data-item and recreated. ppBB is a pointer to a pointer of a byte buffer. It's the callers job to delete it.
References m_pPNG, m_pPNGInfo, and UT_DEBUGMSG.
Referenced by _png_write().
| GdkPixbuf * IE_ImpGraphic_GdkPixbuf::_loadXPM | ( | UT_ByteBuf * | pBB | ) | [private] |
Massage the byte buffer into an array of strings that can be loaded by gdk-pixbuf
References UT_GenericVector< T >::addItem(), DELETEP, FREEP, UT_GenericVector< T >::getItemCount(), UT_ByteBuf::getLength(), UT_GenericVector< T >::getNthItem(), UT_ByteBuf::getPointer(), and UT_calloc().
Referenced by pixbufForByteBuf().
| UT_Error IE_ImpGraphic_GdkPixbuf::_png_write | ( | GdkPixbuf * | pixbuf | ) | [private] |
needed for the stejmp context
References _createPNGFromPixbuf(), DELETEP, m_pPNG, m_pPngBB, and m_pPNGInfo.
Referenced by importGraphic().
| UT_Error IE_ImpGraphic_GdkPixbuf::importGraphic | ( | UT_ByteBuf * | pBB, | |
| FG_Graphic ** | ppfg | |||
| ) | [virtual] |
Convert an image data buffer into PNG image buffer.
Reimplemented from IE_ImpGraphic.
References _png_write(), DELETEP, Initialize_PNG(), m_pPngBB, pixbufForByteBuf(), FG_GraphicRaster::setRaster_JPEG(), FG_GraphicRaster::setRaster_PNG(), UT_DEBUGMSG, and UT_OK.
| UT_Error IE_ImpGraphic_GdkPixbuf::Initialize_PNG | ( | void | ) | [private] |
References _write_png(), m_pPNG, m_pPngBB, and m_pPNGInfo.
Referenced by importGraphic().
| GdkPixbuf * IE_ImpGraphic_GdkPixbuf::pixbufForByteBuf | ( | UT_ByteBuf * | pBB, | |
| std::string & | mimetype | |||
| ) | [private] |
References _loadXPM(), gchar, UT_ByteBuf::getLength(), UT_ByteBuf::getPointer(), mime_types, UT_ASSERT, and UT_DEBUGMSG.
Referenced by importGraphic().
bool IE_ImpGraphic_GdkPixbuf::m_bIsXPM [private] |
png_structp IE_ImpGraphic_GdkPixbuf::m_pPNG [private] |
Referenced by _createPNGFromPixbuf(), _png_write(), and Initialize_PNG().
UT_ByteBuf* IE_ImpGraphic_GdkPixbuf::m_pPngBB [private] |
Referenced by _png_write(), importGraphic(), and Initialize_PNG().
png_infop IE_ImpGraphic_GdkPixbuf::m_pPNGInfo [private] |
Referenced by _createPNGFromPixbuf(), _png_write(), and Initialize_PNG().
1.7.1