#include <gr_Win32Image.h>
Public Member Functions | |
GR_Win32Image (const char *szName) | |
virtual | ~GR_Win32Image () |
virtual bool | convertToBuffer (UT_ByteBuf **ppBB) const |
virtual bool | convertFromBuffer (const UT_ByteBuf *pBB, const std::string &mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
void | setDIB (BITMAPINFO *pDIB) |
BITMAPINFO * | getDIB (void) const |
virtual GR_Image * | createImageSegment (GR_Graphics *pG, const UT_Rect &rec) |
virtual bool | hasAlpha (void) const |
virtual bool | isTransparentAt (UT_sint32 x, UT_sint32 y) |
Protected Attributes | |
BITMAPINFO * | m_pDIB |
Private Member Functions | |
bool | _convertFromPNG (const UT_ByteBuf *pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
bool | _convertFromJPEG (const UT_ByteBuf *pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
GR_Win32Image::GR_Win32Image | ( | const char * | szName | ) |
References GR_Image::setName().
Referenced by createImageSegment().
GR_Win32Image::~GR_Win32Image | ( | ) | [virtual] |
References m_pDIB.
bool GR_Win32Image::_convertFromJPEG | ( | const UT_ByteBuf * | pBB, | |
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [private] |
References FREEP, m_pDIB, GR_Image::setDisplaySize(), UT_JPEG_getDimensions(), and UT_JPEG_getRGBData().
Referenced by convertFromBuffer().
bool GR_Win32Image::_convertFromPNG | ( | const UT_ByteBuf * | pBB, | |
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [private] |
References _png_read(), _bb::iCurPos, m_pDIB, _bb::pBB, and GR_Image::setDisplaySize().
Referenced by convertFromBuffer().
bool GR_Win32Image::convertFromBuffer | ( | const UT_ByteBuf * | pBB, | |
const std::string & | mimetype, | |||
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [virtual] |
References _convertFromJPEG(), and _convertFromPNG().
Referenced by XAP_Win32Dialog_FileOpenSaveAs::_previewPicture(), and XAP_Win32Dialog_About::runModal().
bool GR_Win32Image::convertToBuffer | ( | UT_ByteBuf ** | ppBB | ) | const [virtual] |
References _png_flush(), _png_write(), m_pDIB, _bb::pBB, UT_ASSERT, UT_ASSERT_HARMLESS, UT_return_val_if_fail, and UT_TODO.
GR_Image * GR_Win32Image::createImageSegment | ( | GR_Graphics * | pG, | |
const UT_Rect & | rec | |||
) | [virtual] |
The idea is to create a new image from the rectangular segment in device units defined by UT_Rect rec. The Image should be deleted by the calling routine.
Implements GR_Image.
References UT_String::c_str(), GR_Image::getDisplayHeight(), GR_Image::getDisplayWidth(), GR_Image::getName(), GR_Win32Image(), UT_Rect::height, UT_Rect::left, m_pDIB, GR_Image::setDisplaySize(), GR_Graphics::tdu(), UT_Rect::top, UT_return_val_if_fail, UT_String_sprintf(), and UT_Rect::width.
BITMAPINFO* GR_Win32Image::getDIB | ( | void | ) | const [inline] |
Referenced by GR_Win32Graphics::drawImage().
bool GR_Win32Image::hasAlpha | ( | void | ) | const [virtual] |
Returns true if there is any transparency in the image.
Implements GR_RasterImage.
References UT_ASSERT_HARMLESS.
Returns true if pixel at point (x,y) in device units is transparent. See gr_UnixImage.cpp for how it's done in GTK.
Implements GR_RasterImage.
References UT_ASSERT_HARMLESS.
void GR_Win32Image::setDIB | ( | BITMAPINFO * | pDIB | ) | [inline] |
References GR_Image::setDisplaySize().
Referenced by GR_Win32Graphics::genImageFromRectangle().
BITMAPINFO* GR_Win32Image::m_pDIB [protected] |
Referenced by _convertFromJPEG(), _convertFromPNG(), convertToBuffer(), createImageSegment(), and ~GR_Win32Image().