ubit
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ubit::UHardIma Class Referenceabstract

[Impl] image implementation (encapsulates system resources). More...

#include <uhardima.hpp>

Public Member Functions

virtual int read (const UStr &filename, const char *filetype=null, int max_w=0, int max_h=0)
 reads and init an image from a file. More...
 
virtual int readFromData (const char **xpm_data, int max_w=0, int max_h=0)
 reads and init an image from compiled XPM data.
 
virtual void setRaster (int width, int height, int alpha_hint)=0
 inits the raster with this size (previous data is destroyed if any). More...
 
virtual UHardImacreateScaledClone (float xscale, float yscale, UDisp *=0)=0
 creates a scaled copy of this image.
 
virtual int getWidth () const
 
virtual int getHeight () const
 
virtual int getBpp () const
 
virtual int getTransparency () const
 0 (opaque), 1(bitmask) or >1(alpha channel).
 
UDispgetDisp () const
 
virtual float getScale () const =0
 
virtual bool isRealized () const =0
 

Protected Member Functions

UHardImaoperator= (const UHardIma &)
 

Protected Attributes

UDispdisp
 
int width
 
int height
 
unsigned char bpp
 
unsigned char transparency
 

Friends

class UIma
 
class UGraphCtxX11
 
class UGraphCtxGDK
 

Detailed Description

[Impl] image implementation (encapsulates system resources).

Member Function Documentation

§ read()

int UHardIma::read ( const UStr filename,
const char *  filetype = null,
int  max_w = 0,
int  max_h = 0 
)
virtual

reads and init an image from a file.

the filetype can be one of "gif" "jpeg" "xpm" or null in which case the type is deduced from the filename suffix. returns the UFileStat.

§ setRaster()

virtual void ubit::UHardIma::setRaster ( int  width,
int  height,
int  alpha_hint 
)
pure virtual

inits the raster with this size (previous data is destroyed if any).

the pixel raster is created if width AND height are > 0. It is null otherwise. The previous pixel raster is always destroyed, if any.

'alpha_hint' specifies if the buffer has an alpha channel. it can be 0 (no alpha) or 1 (bitmask) for X11 and 8 (8 alpha bits) for GL.


The documentation for this class was generated from the following files: