Container for texture. More...
Public Member Functions | |
texture () | |
emtpy constructor | |
void | load_picture (const std::string &filename) |
load texture file | |
void | export_ppm (const std::string &filename) const |
export ppm texture file | |
const unsigned int & | get_Nx () const |
get image width | |
const unsigned int & | get_Ny () const |
get image height | |
const unsigned int & | get_depth () const |
get image depth | |
const std::vector< unsigned char > & | get_data () const |
get internal data | |
Private Member Functions | |
void | load_ppm_picture (const std::string &filename) |
load ppm texture file | |
void | load_png_picture (const std::string &filename) |
load ppm texture file | |
Private Attributes | |
unsigned int | N_x |
internal width | |
unsigned int | N_y |
internal height | |
unsigned int | depth |
internal depth | |
std::vector< unsigned char > | picture |
internal storage of picture data |
Container for texture.
cpe::texture::texture | ( | ) |
emtpy constructor
void cpe::texture::export_ppm | ( | const std::string & | filename | ) | const |
const std::vector< unsigned char > & cpe::texture::get_data | ( | ) | const |
const unsigned int & cpe::texture::get_depth | ( | ) | const |
get image depth
References depth.
const unsigned int & cpe::texture::get_Nx | ( | ) | const |
const unsigned int & cpe::texture::get_Ny | ( | ) | const |
void cpe::texture::load_picture | ( | const std::string & | filename | ) |
load texture file
References load_png_picture(), and load_ppm_picture().
Referenced by cpe::opengl_drawer::generate_texture().
void cpe::texture::load_png_picture | ( | const std::string & | filename | ) | [private] |
void cpe::texture::load_ppm_picture | ( | const std::string & | filename | ) | [private] |
load ppm texture file
References cpe::string_converter::delete_empty(), depth, N_x, N_y, picture, and cpe::string_tokenizer::tokenize().
Referenced by load_picture().
unsigned int cpe::texture::depth [private] |
internal depth
Referenced by get_depth(), load_png_picture(), and load_ppm_picture().
unsigned int cpe::texture::N_x [private] |
internal width
Referenced by export_ppm(), get_Nx(), load_png_picture(), and load_ppm_picture().
unsigned int cpe::texture::N_y [private] |
internal height
Referenced by export_ppm(), get_Ny(), load_png_picture(), and load_ppm_picture().
std::vector<unsigned char> cpe::texture::picture [private] |
internal storage of picture data
Referenced by export_ppm(), get_data(), load_png_picture(), and load_ppm_picture().