Texture2D Class Reference

#include <Texture2D.h>

Inherits Texture.

Inheritance diagram for Texture2D:

Inheritance graph
[legend]
Collaboration diagram for Texture2D:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Texture2D (int resX, int resY)
 Texture2D (const std::string &filename)
 ~Texture2D ()
RGBAColor texel (float u, float v) const
int resX () const
int resY () const

Private Member Functions

RGBAColor wrappedTexel (int x, int y) const

Private Attributes

ImagemImage
 image class to hold the data
int mResX
int mResY

Detailed Description

A 2 dimensional texture. Supports loading of PNG format

Author:
Alex Busenius

Christian Engels

Definition at line 16 of file Texture2D.h.


Constructor & Destructor Documentation

Texture2D::Texture2D ( int  resX,
int  resY 
) [inline]

Create empy texture object

Definition at line 21 of file Texture2D.h.

References mImage.

Texture2D::Texture2D ( const std::string &  filename  )  [inline]

Create texture and load it from file

Definition at line 31 of file Texture2D.h.

References Image::height(), mImage, mResX, mResY, Image::read(), and Image::width().

Texture2D::~Texture2D (  )  [inline]

Release used data

Definition at line 48 of file Texture2D.h.

References mImage.


Member Function Documentation

RGBAColor Texture2D::texel ( float  u,
float  v 
) const [inline, virtual]

Get texel on certain position. Here the correct wrapping mode will be used. Interpolate texels if required.

Implements Texture.

Definition at line 58 of file Texture2D.h.

References Texture::interpolationMode(), LINEAR, mResX, mResY, NEAREST, and wrappedTexel().

int Texture2D::resX (  )  const [inline, virtual]

get the x resolution for the texture

Implements Texture.

Definition at line 86 of file Texture2D.h.

References mResX.

int Texture2D::resY (  )  const [inline, virtual]

get the y resolution for the texture

Implements Texture.

Definition at line 91 of file Texture2D.h.

References mResY.

RGBAColor Texture2D::wrappedTexel ( int  x,
int  y 
) const [inline, private]

Definition at line 104 of file Texture2D.h.

References mImage, mResX, mResY, Image::pixel(), REPEAT, WRAP, and Texture::wrapMode().

Referenced by texel().


Member Data Documentation

Image* Texture2D::mImage [private]

image class to hold the data

Definition at line 98 of file Texture2D.h.

Referenced by Texture2D(), wrappedTexel(), and ~Texture2D().

int Texture2D::mResX [private]

Definition at line 100 of file Texture2D.h.

Referenced by resX(), texel(), Texture2D(), and wrappedTexel().

int Texture2D::mResY [private]

Definition at line 101 of file Texture2D.h.

Referenced by resY(), texel(), Texture2D(), and wrappedTexel().


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 00:02:31 2008 for Grayfall by  doxygen 1.5.1