Home · All Namespaces · All Classes · Functions · Coding Style · Plugins · File Structure

StelTexture Class Reference

Base texture class. More...

#include <StelTexture.hpp>

List of all members.

Signals

void loadingProcessFinished (bool error)

Public Member Functions

virtual ~StelTexture ()
bool bind ()
bool canBind () const
bool getAverageLuminance (float &lum)
bool getDimensions (int &width, int &height)
const Vec2dgetCoordinates () const
const QString & getErrorMessage () const
const QString & getFullPath () const
bool isLoading () const


Detailed Description

Base texture class.

For creating an instance, use StelTextureMgr::createTexture() and StelTextureMgr::createTextureThread()

See also:
StelTextureSP

Constructor & Destructor Documentation

virtual StelTexture::~StelTexture (  )  [virtual]

Destructor.


Member Function Documentation

bool StelTexture::bind (  ) 

Bind the texture so that it can be used for openGL drawing (calls glBindTexture).

If the texture is lazyly loaded, this starts the loading and return false immediately.

Returns:
true if the binding successfully occured, false if the texture is not yet loaded.

bool StelTexture::canBind (  )  const [inline]

Return whether the texture can be binded, i.e. it is fully loaded.

bool StelTexture::getAverageLuminance ( float &  lum  ) 

Get the average texture luminance.

Parameters:
lum 0 is black, 1 is white
Returns:
true if the returned luminance is known, false if not. In this later case, the value of num is undefined.

bool StelTexture::getDimensions ( int &  width,
int &  height 
)

Return the width and heigth of the texture in pixels.

const Vec2d* StelTexture::getCoordinates (  )  const [inline]

Return the position of the 4 corners of the texture in texture coordinates.

const QString& StelTexture::getErrorMessage (  )  const [inline]

Get the error message which caused the texture loading to fail.

Returns:
the human friendly error message or empty string if no errors occured

const QString& StelTexture::getFullPath (  )  const [inline]

Return the full path to the image file.

If the texture was downloaded from a remote location, this function return the full URL.

bool StelTexture::isLoading (  )  const [inline]

Return whether the image is currently being loaded.

void StelTexture::loadingProcessFinished ( bool  error  )  [signal]

Emitted when the texture is ready to be bind(), i.e.

when downloaded, imageLoading and glLoading is over or when an error occured and the texture will never be available In case of error, you can query what the problem was by calling getErrorMessage()

Parameters:
error is equal to true if an error occured while loading the texture


Generated on Mon Feb 2 17:23:48 2009 for Stellarium by  doxygen 1.5.5