#include <unatima.hpp>
Public Types | |
typedef int(* | Reader )(class UNatDisp *, const char *fpath, UNatIma *&natima) |
type of File or Data Reader functions; returns UFilestat and natima (which can be null). | |
typedef int(* | Writer )(class UNatDisp *, const char *fpath, const UNatIma *natima) |
type of File or Data Writer functions; returns UFilestat. | |
Public Member Functions | |
UNatIma (UNatDisp *, UX_Image xima, UX_Image ximashape) | |
constructor | |
u_dim | getWidth () const |
u_dim | getHeight () const |
const UX_Image | getXImage () const |
const UX_Image | getXImageShape () const |
bool | isRealized () const |
bool | isShaped () const |
UNatIma * | createScaledImage (float xscale, float yscale) |
UNatIma * | createScaledImage (UNatDisp *to_nd, float xscale, float yscale) |
creates a scaled copy of this image | |
Static Public Member Functions | |
static int | readImage (UNatDisp *, const char *filename, const char *filetype, UNatIma *&natima) |
creates a NatIma from an image file | |
static UX_Image | createEmptyImage (UNatDisp *, u_dim width, u_dim height, u_dim depth) |
creates an empty XImage | |
static UX_Image | createScaledImage (UNatDisp *to_nd, UNatDisp *from_nd, UX_Image from_ima, float xscale, float yscale) |
creates a scaled copy of an XImage | |
static bool | blendImages (UNatDisp *, UX_Image xima1, UX_Image xima2, float alpha) |
static bool | blendImage (UNatDisp *, UX_Image xima1, UX_Color pixel2, float alpha) |
image blending: the resulting XImage is stored in xima1 | |
static unsigned long * | allocXColors (UNatDisp *nd, const XColor *colors, int colorCount) |
allocates the xcolors and returns the conversion table (which must be deleted[] after use). | |
static int | xpmFileReader (UNatDisp *, const char *fpath, UNatIma *&natima) |
static int | xpmDataReader (UNatDisp *, const char *xpm_data, UNatIma *&natima) |
static int | gifFileReader (UNatDisp *, const char *fpath, UNatIma *&natima) |
static int | jpegFileReader (UNatDisp *, const char *fpath, UNatIma *&natima) |
the avaibility of these readers depends on the compilation and linking options of the Ubit lib | |
Static Public Attributes | |
static const char *const | GIF = "gif" |
static const char *const | JPG = "jpg" |
static const char *const | XPM = "xpm" |
static const char *const | XPM_DATA = "[XPM DATA]" |
can have a "transparent background" (i.e. be shaped) (!! mais seul XPM Reader lit images transp !!) NB:
|
constructor Note:
|
|
image blending: the resulting XImage is stored in xima1 returns false if images or natdisp are not compatibles note that a trueColor Visual is requested for blending images |
|
creates an empty XImage Notes:
|
|
creates a scaled copy of an XImage args:
|
|
creates a scaled copy of this image the second variant makes it possible to create the new image on a different UNatDisp. |
|
creates a NatIma from an image file 'filetype' can be null or any of the constants: UNatIma::GIF, JPEG, XPM or XPM_DATA. If 'filetype' is null, the type is deduced from the filename suffix. This fct returns 'natima' and the UFilestat loading status. |