#include <FXXPMImage.h>
Public Member Functions | |
FXXPMImage (FXApp *a, const FXchar **pix=NULL, FXuint opts=0, FXint w=1, FXint h=1) | |
virtual bool | savePixels (FXStream &store) const |
virtual bool | loadPixels (FXStream &store) |
virtual | ~FXXPMImage () |
void | setOptions (FXuint opts) |
FXuint | getOptions () const |
virtual void | setData (FXColor *pix, FXuint opts=0) |
virtual void | setData (FXColor *pix, FXuint opts, FXint w, FXint h) |
FXColor * | getData () const |
FXColor | getPixel (FXint x, FXint y) const |
void | setPixel (FXint x, FXint y, FXColor color) |
bool | hasAlpha () const |
virtual void | create () |
virtual void | detach () |
virtual void | destroy () |
virtual void | restore () |
virtual void | render () |
virtual void | release () |
virtual void | resize (FXint w, FXint h) |
virtual void | scale (FXint w, FXint h, FXint quality=0) |
virtual void | mirror (bool horizontal, bool vertical) |
virtual void | rotate (FXint degrees) |
virtual void | crop (FXint x, FXint y, FXint w, FXint h, FXColor color=0) |
virtual void | fill (FXColor color) |
virtual void | fade (FXColor color, FXint factor=255) |
virtual void | xshear (FXint shear, FXColor clr=0) |
virtual void | yshear (FXint shear, FXColor clr=0) |
virtual void | hgradient (FXColor left, FXColor right) |
virtual void | vgradient (FXColor top, FXColor bottom) |
virtual void | gradient (FXColor topleft, FXColor topright, FXColor bottomleft, FXColor bottomright) |
virtual void | blend (FXColor color) |
virtual void | save (FXStream &store) const |
virtual void | load (FXStream &store) |
FXint | getWidth () const |
FXint | getHeight () const |
FXVisual * | getVisual () const |
void | setVisual (FXVisual *vis) |
FXApp * | getApp () const |
FXEventLoop * | getEventLoop () const |
FXID | id () const |
void | setUserData (void *ptr) |
void * | getUserData () const |
virtual long | onDefault (FXObject *, FXSelector, void *) |
const FXchar * | getClassName () const |
bool | isMemberOf (const FXMetaClass *metaclass) const |
virtual long | tryHandle (FXObject *sender, FXSelector sel, void *ptr) |
QTransString | tr (const char *text, const char *hint=0) |
virtual void * | getPythonObject () const |
virtual void | decouplePythonObject () const |
Static Public Attributes | |
static const FXchar * | fileExt |
static const FXchar * | mimeType |
Protected Attributes | |
FXColor * | data |
FXuint | options |
FXVisual * | visual |
FXint | width |
FXint | height |
FXID | xid |
FX::FXXPMImage::FXXPMImage | ( | FXApp * | a, | |
const FXchar ** | pix = NULL , |
|||
FXuint | opts = 0 , |
|||
FXint | w = 1 , |
|||
FXint | h = 1 | |||
) |
Construct image from compiled-in X Pixmap format.
virtual FX::FXXPMImage::~FXXPMImage | ( | ) | [virtual] |
Destroy icon.
virtual bool FX::FXXPMImage::savePixels | ( | FXStream & | store | ) | const [virtual] |
virtual bool FX::FXXPMImage::loadPixels | ( | FXStream & | store | ) | [virtual] |
void FX::FXImage::setOptions | ( | FXuint | opts | ) | [inherited] |
Change options.
FXuint FX::FXImage::getOptions | ( | ) | const [inline, inherited] |
To get to the option flags.
virtual void FX::FXImage::setData | ( | FXColor * | pix, | |
FXuint | opts = 0 | |||
) | [virtual, inherited] |
Populate the image with new pixel data of the same size; it will assume ownership of the pixel data if image IMAGE_OWNED option is passed. The server-side representation of the image, if it exists, is not updated. This can be done by calling render().
virtual void FX::FXImage::setData | ( | FXColor * | pix, | |
FXuint | opts, | |||
FXint | w, | |||
FXint | h | |||
) | [virtual, inherited] |
Populate the image with new pixel data of a new size; it will assume ownership of the pixel data if image IMAGE_OWNED option is passed. The size of the server- side representation of the image, if it exists, is adjusted but the contents are not updated yet. This can be done by calling render().
FXColor* FX::FXImage::getData | ( | ) | const [inline, inherited] |
Return pointer to the pixel data of the image.
FXColor FX::FXImage::getPixel | ( | FXint | x, | |
FXint | y | |||
) | const [inline, inherited] |
Get pixel at x,y.
void FX::FXImage::setPixel | ( | FXint | x, | |
FXint | y, | |||
FXColor | color | |||
) | [inline, inherited] |
Change pixel at x,y.
bool FX::FXImage::hasAlpha | ( | ) | const [inherited] |
Scan the image and return false if fully opaque.
virtual void FX::FXImage::create | ( | ) | [virtual, inherited] |
Create the server side pixmap, then call render() to fill it with the pixel data from the client-side buffer. After the server-side image has been created, the client-side pixel buffer will be deleted unless IMAGE_KEEP has been specified. If the pixel buffer is not owned, i.e. the flag IMAGE_OWNED is not set, the pixel buffer will not be deleted, however the pixel buffer will be set to NULL.
Reimplemented from FX::FXId.
Reimplemented in FX::FXIcon.
virtual void FX::FXImage::detach | ( | ) | [virtual, inherited] |
Detach the server side pixmap from the Image. Afterwards, the Image is left as if it never had a server-side resources.
Reimplemented from FX::FXId.
Reimplemented in FX::FXIcon.
virtual void FX::FXImage::destroy | ( | ) | [virtual, inherited] |
Destroy the server-side pixmap. The client-side pixel buffer is not affected.
Reimplemented from FX::FXId.
Reimplemented in FX::FXIcon.
virtual void FX::FXImage::restore | ( | ) | [virtual, inherited] |
Retrieves pixels from the server-side image. For example, to make screen snapshots, or to retrieve an image after it has been drawn into by various means.
virtual void FX::FXImage::render | ( | ) | [virtual, inherited] |
Render the server-side representation of the image from client-side pixels. Normally, IMAGE_DITHER is used which causes the server-side representation to be rendered using a 16x16 ordered dither if necessary; however if IMAGE_NEAREST is used a faster (but uglier-looking), nearest neighbor algorithm is used.
Reimplemented in FX::FXIcon.
virtual void FX::FXImage::release | ( | ) | [virtual, inherited] |
Release the client-side pixels buffer, free it if it was owned. If it is not owned, the image just forgets about the buffer.
virtual void FX::FXImage::resize | ( | FXint | w, | |
FXint | h | |||
) | [virtual, inherited] |
Resize both client-side and server-side representations (if any) to the given width and height. The new representations typically contain garbage after this operation and need to be re-filled.
Reimplemented from FX::FXDrawable.
Reimplemented in FX::FXIcon.
virtual void FX::FXImage::scale | ( | FXint | w, | |
FXint | h, | |||
FXint | quality = 0 | |||
) | [virtual, inherited] |
Rescale pixels image to the specified width and height; this calls resize() to adjust the client and server side representations.
virtual void FX::FXImage::mirror | ( | bool | horizontal, | |
bool | vertical | |||
) | [virtual, inherited] |
Mirror image horizontally and/or vertically.
virtual void FX::FXImage::rotate | ( | FXint | degrees | ) | [virtual, inherited] |
Rotate image by degrees ccw; this calls resize() to adjust the client and server side representations if necessary.
virtual void FX::FXImage::crop | ( | FXint | x, | |
FXint | y, | |||
FXint | w, | |||
FXint | h, | |||
FXColor | color = 0 | |||
) | [virtual, inherited] |
Crop image to given rectangle; this calls resize() to adjust the client and server side representations. The new image may be smaller or larger than the old one; blank areas are filled with color. There must be at least one pixel of overlap between the old and the new image.
virtual void FX::FXImage::fill | ( | FXColor | color | ) | [virtual, inherited] |
Fill image with uniform color.
virtual void FX::FXImage::fade | ( | FXColor | color, | |
FXint | factor = 255 | |||
) | [virtual, inherited] |
Fade image to uniform color.
virtual void FX::FXImage::xshear | ( | FXint | shear, | |
FXColor | clr = 0 | |||
) | [virtual, inherited] |
Shear image horizontally; the number of pixels is equal to the shear parameter times 256. The area outside the image is filled with transparent black, unless another color is specified.
virtual void FX::FXImage::yshear | ( | FXint | shear, | |
FXColor | clr = 0 | |||
) | [virtual, inherited] |
Shear image vertically; the number of pixels is equal to the shear parameter times 256. The area outside the image is filled with transparent black, unless another color is specified.
virtual void FX::FXImage::hgradient | ( | FXColor | left, | |
FXColor | right | |||
) | [virtual, inherited] |
Fill horizontal gradient.
virtual void FX::FXImage::vgradient | ( | FXColor | top, | |
FXColor | bottom | |||
) | [virtual, inherited] |
Fill vertical gradient.
virtual void FX::FXImage::gradient | ( | FXColor | topleft, | |
FXColor | topright, | |||
FXColor | bottomleft, | |||
FXColor | bottomright | |||
) | [virtual, inherited] |
Fill with gradient.
virtual void FX::FXImage::blend | ( | FXColor | color | ) | [virtual, inherited] |
Blend image over uniform color.
virtual void FX::FXImage::save | ( | FXStream & | store | ) | const [virtual, inherited] |
virtual void FX::FXImage::load | ( | FXStream & | store | ) | [virtual, inherited] |
FXint FX::FXDrawable::getWidth | ( | ) | const [inline, inherited] |
Width of drawable.
FXint FX::FXDrawable::getHeight | ( | ) | const [inline, inherited] |
Height of drawable.
FXVisual* FX::FXDrawable::getVisual | ( | ) | const [inline, inherited] |
Get the visual.
void FX::FXDrawable::setVisual | ( | FXVisual * | vis | ) | [inherited] |
Change visual.
FXApp* FX::FXId::getApp | ( | ) | const [inline, inherited] |
Get application.
FXEventLoop* FX::FXId::getEventLoop | ( | ) | const [inline, inherited] |
Get event loop which owns this.
FXID FX::FXId::id | ( | ) | const [inline, inherited] |
Get XID handle.
void FX::FXId::setUserData | ( | void * | ptr | ) | [inline, inherited] |
Set user data pointer.
void* FX::FXId::getUserData | ( | ) | const [inline, inherited] |
Get user data pointer.
virtual long FX::FXObject::onDefault | ( | FXObject * | , | |
FXSelector | , | |||
void * | ||||
) | [virtual, inherited] |
Called for unhandled messages.
Reimplemented in FX::FXDelegator, FX::FXGLViewer, FX::FXMDIChild, and FX::FXMDIClient.
const FXchar* FX::FXObject::getClassName | ( | ) | const [inherited] |
Get class name of some object.
bool FX::FXObject::isMemberOf | ( | const FXMetaClass * | metaclass | ) | const [inherited] |
Check if object is member of metaclass.
virtual long FX::FXObject::tryHandle | ( | FXObject * | sender, | |
FXSelector | sel, | |||
void * | ptr | |||
) | [virtual, inherited] |
Try handle message safely.
QTransString FX::FXObject::tr | ( | const char * | text, | |
const char * | hint = 0 | |||
) | [inherited] |
Returns a human translated version of the text to the locale language (warning: uses a virtual method call, so can't use before construction)
virtual void* FX::FXObject::getPythonObject | ( | ) | const [inline, virtual, inherited] |
Returns the python object representing this instance (if created in python).
virtual void FX::FXObject::decouplePythonObject | ( | ) | const [inline, virtual, inherited] |
Causes decoupling of python object from this object (deletes self).