#include <gr_CocoaImage.h>
Public Member Functions | |
GR_CocoaImage (const char *pszName) | |
virtual | ~GR_CocoaImage () |
virtual bool | convertToBuffer (UT_ConstByteBufPtr &ppBB) const |
virtual bool | convertFromBuffer (const UT_ConstByteBufPtr &pBB, const std::string &mimetype, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
virtual bool | hasAlpha (void) const |
virtual bool | isTransparentAt (UT_sint32 x, UT_sint32 y) |
virtual GRType | getType () const |
virtual bool | render (GR_Graphics *pGR, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
virtual void | cairoSetSource (cairo_t *) |
void | setSurface (cairo_surface_t *) |
Static Public Member Functions | |
static NSImage * | imageFromPNG (NSData *data, UT_uint32 &image_width, UT_uint32 &image_height) |
Protected Member Functions | |
virtual GR_CairoRasterImage * | makeSubimage (const std::string &n, UT_sint32 x, UT_sint32 y, UT_sint32 w, UT_sint32 h) const |
Private Member Functions | |
bool | _convertPNGFromBuffer (const UT_ByteBuf *pBB, UT_sint32 iDisplayWidth, UT_sint32 iDisplayHeight) |
Private Attributes | |
cairo_surface_t * | m_surface |
GRType | m_grtype |
GR_CocoaImage::GR_CocoaImage | ( | const char * | pszName | ) |
References GR_Image::setName().
Referenced by makeSubimage().
GR_CocoaImage::~GR_CocoaImage | ( | ) | [virtual] |
References m_surface.
bool GR_CocoaImage::_convertPNGFromBuffer | ( | const UT_ByteBuf * | pBB, | |
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [private] |
void GR_CocoaImage::cairoSetSource | ( | cairo_t * | cr | ) | [virtual] |
Implements GR_CairoRasterImage.
References GR_Image::getDisplayHeight(), GR_Image::getDisplayWidth(), m_surface, and UT_return_if_fail.
bool GR_CocoaImage::convertFromBuffer | ( | const UT_ConstByteBufPtr & | pBB, | |
const std::string & | mimetype, | |||
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [virtual] |
Implements GR_Image.
References _UT_ByteBuf_PNG_read(), m_grtype, m_surface, and GR_Image::setDisplaySize().
bool GR_CocoaImage::convertToBuffer | ( | UT_ConstByteBufPtr & | ppBB | ) | const [virtual] |
virtual GRType GR_CocoaImage::getType | ( | void | ) | const [inline, virtual] |
Reimplemented from GR_RasterImage.
References m_grtype.
bool GR_CocoaImage::hasAlpha | ( | void | ) | const [virtual] |
Returns true if there is any transparency in the image.
Implements GR_RasterImage.
References m_surface.
static NSImage* GR_CocoaImage::imageFromPNG | ( | NSData * | data, | |
UT_uint32 & | image_width, | |||
UT_uint32 & | image_height | |||
) | [static] |
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.
GR_CairoRasterImage * GR_CocoaImage::makeSubimage | ( | const std::string & | n, | |
UT_sint32 | x, | |||
UT_sint32 | y, | |||
UT_sint32 | w, | |||
UT_sint32 | h | |||
) | const [protected, virtual] |
Implements GR_CairoRasterImage.
References GR_CocoaImage(), m_surface, and setSurface().
bool GR_CocoaImage::render | ( | GR_Graphics * | pGR, | |
UT_sint32 | iDisplayWidth, | |||
UT_sint32 | iDisplayHeight | |||
) | [virtual] |
Reimplemented from GR_Image.
References UT_DEBUGMSG.
void GR_CocoaImage::setSurface | ( | cairo_surface_t * | surface | ) |
References m_surface.
Referenced by makeSubimage().
GRType GR_CocoaImage::m_grtype [private] |
Referenced by convertFromBuffer(), and getType().
cairo_surface_t* GR_CocoaImage::m_surface [private] |
Referenced by cairoSetSource(), convertFromBuffer(), hasAlpha(), makeSubimage(), setSurface(), and ~GR_CocoaImage().