OpenGL texture.
More...
#include <easy3d/renderer/texture.h>
|
enum | WrapMode { CLAMP_TO_EDGE
, REPEAT
} |
|
enum | FilterMode { NEAREST
, LINEAR
} |
|
|
unsigned int | id () const |
|
const std::string & | name () const |
|
void | bind (int unit=0) const |
|
void | release () const |
|
int | width () const |
|
int | height () const |
|
int | channels () const |
|
WrapMode | wrap_mode () const |
|
FilterMode | filter_mode () const |
|
|
static Texture * | create (const std::string &image_file, WrapMode wrap=CLAMP_TO_EDGE, FilterMode filter=LINEAR) |
|
static Texture * | create (const std::vector< unsigned char > &rgb_data, int width, int height, int comp, WrapMode wrap=CLAMP_TO_EDGE, FilterMode filter=LINEAR) |
|
◆ create() [1/2]
Texture * create |
( |
const std::string & |
image_file, |
|
|
WrapMode |
wrap = CLAMP_TO_EDGE , |
|
|
FilterMode |
filter = LINEAR |
|
) |
| |
|
static |
Creates a texture from an image file. @image_file The full path to the image file.
- Returns
- The created texture.
◆ create() [2/2]
Texture * create |
( |
const std::vector< unsigned char > & |
rgb_data, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
comp, |
|
|
WrapMode |
wrap = CLAMP_TO_EDGE , |
|
|
FilterMode |
filter = LINEAR |
|
) |
| |
|
static |
Creates a texture from the given image data.
- Parameters
-
rgb_data | The image data. |
width | The width (i.e., number of columns) of the image. |
height | The rows (i.e., number of rows) of the image. |
comp | The number of components for each pixel (e.g., 3 for RGB) |
- Returns
- The created texture.
The documentation for this class was generated from the following files:
- /Users/lnan/Documents/Projects/Easy3D/easy3d/renderer/texture.h
- /Users/lnan/Documents/Projects/Easy3D/easy3d/renderer/texture.cpp