Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

UIma Class Reference

Image Object. More...

#include <uima.hpp>

Inheritance diagram for UIma:

UElem UBrick UPix List of all members.

Public Member Functions

 UIma (const UStr &filename)
 UIma (const char *filename=null)
 UIma (const char **xpm_data, u_modes=0)
 creates an emty image and specifies its file name (or XPM data)

virtual void set (const UStr &filename)
virtual void set (const char *filename)
virtual void set (const char **xpm_data)
 specifies the file name of an image (or XPM data)

virtual int load ()
virtual int readFile (const UStr &filename)
virtual int readFile (const char *filename)
virtual int readData (const char **xpm_data)
 loads an image in memory

void copy (const UIma &ima2)
 copies image content from ima2

void copyResized (const UIma &ima2, u_dim width, u_dim height)
 copies image content from ima2 and rescales to size: width x height

void copyRescaled (const UIma &, float xscale, float yscale)
 copies image content from ima2 and rescales according to scaling factors

const char * getNameChars () const
 returns the image name (if any, null otherwise)

int getStatus () const
bool isLoaded () const
 returns the loading status of this image (see UFilestat)

bool isRealized () const
 returns true if the image has been loaded and realized (see: realize()).

bool isShaped () const
bool isTransparent () const
 return true if the image background is shaped (so called "transparent").

virtual u_dim getHeight () const
virtual u_dim getWidth () const
 returns the image size (unknown if the image has not been loaded!).

virtual void update ()
 update parents' views.

int realize (class UDisp &disp, bool force_reload=true) const
 [impl] allocates physical resources and loads the image in memory

std::list< class UNatIma * > & getNatImas () const
 [impl] returns internal implementation.


Friends

UImauima (const UStr &filename)
UImauima (const char *filename)
UImauima (const char **xpm_data)
 creator shortcuts (see UIma::UIma() constructors for details)


Detailed Description

Image Object.

Notes:


Constructor & Destructor Documentation

UIma::UIma const char **  xpm_data,
u_modes  = 0
 

creates an emty image and specifies its file name (or XPM data)

details:

  • the image is not loaded immediately. It will be loaded when the image becomes visible on the screen (as a consequence, images that are not shown are never loaded)
  • use the load() or readFile() functions if you want to load the image in memory immediately.
  • 'xpm_data' is not copied internally and must not be freed see also:
  • class UIma for supported file formats and the syntax of file names
  • getStatus() : returns the loading status (see UFilestat)


Member Function Documentation

void UIma::copy const UIma ima2  ) 
 

copies image content from ima2

No action performed is ima2 is not realized (ie. not loaded)

void UIma::copyRescaled const UIma ,
float  xscale,
float  yscale
 

copies image content from ima2 and rescales according to scaling factors

see: copy(const UIma&) for details

void UIma::copyResized const UIma ima2,
u_dim  width,
u_dim  height
 

copies image content from ima2 and rescales to size: width x height

see: copy(const UIma&) for details

int UIma::readData const char **  xpm_data  )  [virtual]
 

loads an image in memory

details:

  • the display is updated if the image is already visible.
  • the loading status (see UFilestat) is returned
  • load() loads the image previously specified by set() or the constructor
  • use the set() function for postoned loading
  • 'xpm_data' is not copied internally and must not be freed see also:
  • class UIma for supported file formats and the syntax of file names
  • getStatus() : returns the loading status (see UFilestat) note:
  • this function is equivalent to: set() + realize() + update()

int UIma::realize class UDisp disp,
bool  force_reload = true
const
 

[impl] allocates physical resources and loads the image in memory

this function is automatically called when this image is displayed for the first time: there no need to call it in client code. details:

  • returns the loading status (see UFilestat)
  • the 'disp' arg. can be the UAppli
  • the 'force_reload' arg. specifies if the file must be reloaded: #- if false, previously loaded files are not reloaded #- if true files are always reloaded

void UIma::set const char **  xpm_data  )  [virtual]
 

specifies the file name of an image (or XPM data)

details:

  • the image is not loaded immediately. It will be loaded when the image becomes visible on the screen (as a consequence, images that are not shown are never loaded)
  • use the load() or readFile() functions if you want to load the image in memory immediately.
  • 'xpm_data' is not copied internally and must not be freed see also:
  • class UIma for supported file formats and the syntax of file names
  • getStatus() : returns the loading status (see UFilestat)


The documentation for this class was generated from the following files:
Generated on Sat Feb 21 23:28:22 2004 for Ubit[Eric.Lecolinet@enst.fr] by doxygen 1.3.5