#include <Texture2D.h>
Inherits Texture.
Inheritance diagram for Texture2D:
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 | |
Image * | mImage |
image class to hold the data | |
int | mResX |
int | mResY |
Definition at line 16 of file Texture2D.h.
Texture2D::Texture2D | ( | int | resX, | |
int | resY | |||
) | [inline] |
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] |
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().
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().