Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

TEXTUREgl Class Reference

#include <texturegl.H>

Inheritance diagram for TEXTUREgl:

Inheritance graph
[legend]
Collaboration diagram for TEXTUREgl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TEXTUREgl (Cstr_ptr &file="", GLenum target=GL_TEXTURE_2D)
 TEXTUREgl (CBBOX2D &bb, CVIEWptr &v)
 TEXTUREgl (GLenum target, GLenum unit=GL_TEXTURE0)
virtual ~TEXTUREgl ()
mlib::Point2i get_size () const
virtual int load_image ()
virtual int set_image (unsigned char *data, int w, int h, uint bpp=3)
void set_texture (Cstr_ptr &filename)
GLuint get_tex_id () const
bool is_valid () const
virtual bool load_texture (unsigned char **copy=0)
virtual void apply_texture (const mlib::Wtransf *xf=0)
void copy_texture (CBBOX2D &bb, CVIEWptr &v)
void set_format (GLenum format)
GLenum format () const
void set_tex_unit (GLenum unit)
GLenum get_tex_unit () const
void set_tex_fn (GLint fn)
GLint tex_fn () const
void set_wrap_r (GLint wrapr)
GLint wrap_r () const
void set_wrap_s (GLint wraps)
GLint wrap_s () const
void set_wrap_t (GLint wrapt)
GLint wrap_t () const
void set_min_filter (GLint minfilt)
void set_max_filter (GLint maxfilt)
bool mipmap () const
void set_mipmap (bool mipmap)
void set_save_img (bool b=1)
const GLenum target () const
void declare_texture ()
Cstr_ptr & file () const
const Imageimage () const
Imageimage ()
bool load_attempt_failed () const
void expand_image ()
virtual void apply_texture (mlib::CWtransf *xf=0)=0
void set_expand_image (bool expand)
virtual int dimension () const
void Own () const
void Free () const
int Lock ()
void Unlock ()
int Unique () const

Protected Member Functions

GLenum bpp_to_format () const
void free_dl ()
void init_settings ()
void expand_power2 (int width, int height)

Protected Attributes

GLuint _dl
bool _dl_valid
GLenum _format
GLenum _tex_unit
bool _save_img
bool _mipmap
GLint _min_filter
GLint _max_filter
GLint _wrap_r
GLint _wrap_s
GLint _wrap_t
GLint _tex_fn
const GLenum _target
str_ptr _file
Image _img
mlib::Wtransf _scale
bool _image_not_available
bool _expand_image

Detailed Description

Definition at line 18 of file texturegl.H.


Constructor & Destructor Documentation

TEXTUREgl::TEXTUREgl Cstr_ptr &  file = "",
GLenum  target = GL_TEXTURE_2D
 

Definition at line 35 of file texturegl.C.

References init_settings(), and set_mipmap().

TEXTUREgl::TEXTUREgl CBBOX2D &  bb,
CVIEWptr &  v
 

Definition at line 55 of file texturegl.C.

References copy_texture(), init_settings(), and set_mipmap().

TEXTUREgl::TEXTUREgl GLenum  target,
GLenum  unit = GL_TEXTURE0
 

Definition at line 16 of file texturegl.C.

References init_settings().

virtual TEXTUREgl::~TEXTUREgl  )  [inline, virtual]
 

Definition at line 25 of file texturegl.H.

References free_dl().


Member Function Documentation

virtual void TEXTURE::apply_texture mlib::CWtransf xf = 0  )  [pure virtual, inherited]
 

virtual void TEXTUREgl::apply_texture const mlib::Wtransf xf = 0  )  [virtual]
 

GLenum TEXTUREgl::bpp_to_format  )  const [inline, protected]
 

Definition at line 90 of file texturegl.H.

References TEXTURE::_img, Image::bpp(), GL_LUMINANCE, GL_LUMINANCE_ALPHA, GL_RGB, and GL_RGBA.

Referenced by load_image(), and set_image().

void TEXTUREgl::copy_texture CBBOX2D &  bb,
CVIEWptr &  v
 

Definition at line 331 of file texturegl.C.

References TEXTURE::_img, _save_img, _target, Image::clear(), declare_texture(), getPower2Size(), GL_BACK, GL_RGB, GL_TEXTURE_2D, glCopyTexImage2D(), glReadBuffer(), and int().

Referenced by TEXTUREgl().

void TEXTUREgl::declare_texture  ) 
 

Definition at line 172 of file texturegl.C.

References _dl, _dl_valid, TEXTURE::_file, _target, _tex_unit, debug, err_adv(), glActiveTexture, glBindTexture(), and glGenTextures().

Referenced by copy_texture(), and load_texture().

virtual int TEXTURE::dimension  )  const [inline, virtual, inherited]
 

Definition at line 58 of file texture.H.

void TEXTURE::expand_image  )  [inherited]
 

Resizes an image to the least powers of 2 greater than width and height.

Definition at line 44 of file texture.C.

References TEXTURE::_expand_image, TEXTURE::_img, TEXTURE::_scale, debug, Image::empty(), err_adv(), Image::expand_power2(), Image::height(), mlib::Mat4< Wtransf, Wpt, Wvec, Wline, Wquat >::scaling(), and Image::width().

Referenced by TEXTURE::load_image(), and TEXTURE::set_image().

void TEXTURE::expand_power2 int  width,
int  height
[protected, inherited]
 

Definition at line 64 of file texture.C.

References TEXTURE::_img, Image::bpp(), Image::expand_power2(), and Image::resize().

Cstr_ptr& TEXTURE::file  )  const [inline, inherited]
 

Definition at line 32 of file texture.H.

References TEXTURE::_file.

GLenum TEXTUREgl::format  )  const [inline]
 

Definition at line 49 of file texturegl.H.

References _format.

Referenced by load_texture().

void REFcounter::Free  )  const [inline, inherited]
 

Definition at line 76 of file ref.H.

References REFcounter::_mutex, REFcounter::_u, and REF_ME.

void TEXTUREgl::free_dl  )  [protected]
 

Definition at line 154 of file texturegl.C.

References _dl, _dl_valid, TEXTURE::_file, debug, err_adv(), and glDeleteTextures().

Referenced by load_image(), set_image(), set_texture(), and ~TEXTUREgl().

mlib::Point2i TEXTUREgl::get_size  )  const [inline]
 

Definition at line 27 of file texturegl.H.

References TEXTURE::_img, and Image::dims().

GLuint TEXTUREgl::get_tex_id  )  const [inline]
 

Definition at line 36 of file texturegl.H.

References _dl.

GLenum TEXTUREgl::get_tex_unit  )  const [inline]
 

Definition at line 52 of file texturegl.H.

References _tex_unit.

Image& TEXTURE::image  )  [inline, inherited]
 

Definition at line 34 of file texture.H.

References TEXTURE::_img.

const Image& TEXTURE::image  )  const [inline, inherited]
 

Definition at line 33 of file texture.H.

References TEXTURE::_img.

void TEXTUREgl::init_settings  )  [protected]
 

Definition at line 365 of file texturegl.C.

References _max_filter, _min_filter, _tex_fn, _wrap_r, _wrap_s, _wrap_t, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_MODULATE, and GL_REPEAT.

Referenced by TEXTUREgl().

bool TEXTUREgl::is_valid  )  const [inline]
 

Definition at line 37 of file texturegl.H.

References _dl_valid.

Referenced by load_texture().

bool TEXTURE::load_attempt_failed  )  const [inline, inherited]
 

Definition at line 36 of file texture.H.

References TEXTURE::_image_not_available.

int TEXTUREgl::load_image  )  [virtual]
 

Reimplemented from TEXTURE.

Definition at line 96 of file texturegl.C.

References TEXTURE::_file, _format, bpp_to_format(), debug, err_adv(), free_dl(), and TEXTURE::load_image().

Referenced by load_texture().

bool TEXTUREgl::load_texture unsigned char **  copy = 0  )  [virtual]
 

Implements TEXTURE.

Definition at line 197 of file texturegl.C.

References _dl, _dl_valid, TEXTURE::_file, TEXTURE::_img, _mipmap, _save_img, _target, Image::bpp(), Image::copy(), Image::data(), debug, declare_texture(), Image::empty(), err_adv(), format(), Image::freedata(), GL_TEXTURE_2D, GL_UNSIGNED_BYTE, glTexImage1D(), glTexImage2D(), Image::height(), is_valid(), load_image(), and Image::width().

int REFcounter::Lock  )  [inline, inherited]
 

Definition at line 105 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

Referenced by REFlock::REFlock().

bool TEXTUREgl::mipmap  )  const [inline]
 

Definition at line 67 of file texturegl.H.

References _mipmap.

void REFcounter::Own  )  const [inline, inherited]
 

Definition at line 59 of file ref.H.

References REFcounter::_mutex, REFcounter::_u, and REF_ME.

void TEXTURE::set_expand_image bool  expand  )  [inline, inherited]
 

Definition at line 55 of file texture.H.

References TEXTURE::_expand_image.

Referenced by set_mipmap().

void TEXTUREgl::set_format GLenum  format  )  [inline]
 

Definition at line 48 of file texturegl.H.

References _format.

int TEXTUREgl::set_image unsigned char *  data,
int  w,
int  h,
uint  bpp = 3
[virtual]
 

Reimplemented from TEXTURE.

Definition at line 113 of file texturegl.C.

References TEXTURE::_file, _format, bpp_to_format(), debug, err_adv(), free_dl(), and TEXTURE::set_image().

void TEXTUREgl::set_max_filter GLint  maxfilt  )  [inline]
 

Definition at line 65 of file texturegl.H.

References _max_filter.

void TEXTUREgl::set_min_filter GLint  minfilt  )  [inline]
 

Definition at line 64 of file texturegl.H.

References _min_filter.

void TEXTUREgl::set_mipmap bool  mipmap  ) 
 

Definition at line 76 of file texturegl.C.

References _dl_valid, _max_filter, _min_filter, _mipmap, GL_LINEAR, GL_LINEAR_MIPMAP_LINEAR, GL_NEAREST, and TEXTURE::set_expand_image().

Referenced by TEXTUREgl().

void TEXTUREgl::set_save_img bool  b = 1  )  [inline]
 

Definition at line 70 of file texturegl.H.

References _save_img.

void TEXTUREgl::set_tex_fn GLint  fn  )  [inline]
 

Definition at line 54 of file texturegl.H.

References _tex_fn.

void TEXTUREgl::set_tex_unit GLenum  unit  )  [inline]
 

Definition at line 51 of file texturegl.H.

References _tex_unit.

void TEXTUREgl::set_texture Cstr_ptr &  filename  ) 
 

Definition at line 123 of file texturegl.C.

References TEXTURE::_file, TEXTURE::_image_not_available, debug, and free_dl().

void TEXTUREgl::set_wrap_r GLint  wrapr  )  [inline]
 

Definition at line 57 of file texturegl.H.

References _wrap_s.

void TEXTUREgl::set_wrap_s GLint  wraps  )  [inline]
 

Definition at line 59 of file texturegl.H.

References _wrap_s.

void TEXTUREgl::set_wrap_t GLint  wrapt  )  [inline]
 

Definition at line 61 of file texturegl.H.

References _wrap_t.

const GLenum TEXTUREgl::target  )  const [inline]
 

Definition at line 71 of file texturegl.H.

References _target.

GLint TEXTUREgl::tex_fn  )  const [inline]
 

Definition at line 55 of file texturegl.H.

References _tex_fn.

int REFcounter::Unique  )  const [inline, inherited]
 

Definition at line 115 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

void REFcounter::Unlock  )  [inline, inherited]
 

Definition at line 111 of file ref.H.

References REFcounter::_mutex, and REFcounter::_u.

Referenced by REFlock::~REFlock().

GLint TEXTUREgl::wrap_r  )  const [inline]
 

Definition at line 58 of file texturegl.H.

References _wrap_r.

GLint TEXTUREgl::wrap_s  )  const [inline]
 

Definition at line 60 of file texturegl.H.

References _wrap_s.

GLint TEXTUREgl::wrap_t  )  const [inline]
 

Definition at line 62 of file texturegl.H.

References _wrap_t.


Member Data Documentation

GLuint TEXTUREgl::_dl [protected]
 

Definition at line 76 of file texturegl.H.

Referenced by declare_texture(), free_dl(), get_tex_id(), and load_texture().

bool TEXTUREgl::_dl_valid [protected]
 

Definition at line 77 of file texturegl.H.

Referenced by declare_texture(), free_dl(), is_valid(), load_texture(), and set_mipmap().

bool TEXTURE::_expand_image [protected, inherited]
 

Definition at line 65 of file texture.H.

Referenced by TEXTURE::expand_image(), and TEXTURE::set_expand_image().

str_ptr TEXTURE::_file [protected, inherited]
 

Definition at line 61 of file texture.H.

Referenced by declare_texture(), TEXTURE::file(), free_dl(), load_image(), TEXTURE::load_image(), load_texture(), set_image(), and set_texture().

GLenum TEXTUREgl::_format [protected]
 

Definition at line 78 of file texturegl.H.

Referenced by format(), load_image(), set_format(), and set_image().

bool TEXTURE::_image_not_available [protected, inherited]
 

Definition at line 64 of file texture.H.

Referenced by TEXTURE::load_attempt_failed(), TEXTURE::load_image(), and set_texture().

Image TEXTURE::_img [protected, inherited]
 

Definition at line 62 of file texture.H.

Referenced by bpp_to_format(), copy_texture(), TEXTURE::expand_image(), TEXTURE::expand_power2(), get_size(), TEXTURE::image(), TEXTURE::load_image(), load_texture(), and TEXTURE::set_image().

GLint TEXTUREgl::_max_filter [protected]
 

Definition at line 83 of file texturegl.H.

Referenced by init_settings(), set_max_filter(), and set_mipmap().

GLint TEXTUREgl::_min_filter [protected]
 

Definition at line 82 of file texturegl.H.

Referenced by init_settings(), set_min_filter(), and set_mipmap().

bool TEXTUREgl::_mipmap [protected]
 

Definition at line 81 of file texturegl.H.

Referenced by load_texture(), mipmap(), and set_mipmap().

bool TEXTUREgl::_save_img [protected]
 

Definition at line 80 of file texturegl.H.

Referenced by copy_texture(), load_texture(), and set_save_img().

mlib::Wtransf TEXTURE::_scale [protected, inherited]
 

Definition at line 63 of file texture.H.

Referenced by TEXTURE::expand_image().

const GLenum TEXTUREgl::_target [protected]
 

Definition at line 88 of file texturegl.H.

Referenced by copy_texture(), declare_texture(), load_texture(), and target().

GLint TEXTUREgl::_tex_fn [protected]
 

Definition at line 87 of file texturegl.H.

Referenced by init_settings(), set_tex_fn(), and tex_fn().

GLenum TEXTUREgl::_tex_unit [protected]
 

Definition at line 79 of file texturegl.H.

Referenced by declare_texture(), get_tex_unit(), and set_tex_unit().

GLint TEXTUREgl::_wrap_r [protected]
 

Definition at line 84 of file texturegl.H.

Referenced by init_settings(), and wrap_r().

GLint TEXTUREgl::_wrap_s [protected]
 

Definition at line 85 of file texturegl.H.

Referenced by init_settings(), set_wrap_r(), set_wrap_s(), and wrap_s().

GLint TEXTUREgl::_wrap_t [protected]
 

Definition at line 86 of file texturegl.H.

Referenced by init_settings(), set_wrap_t(), and wrap_t().


The documentation for this class was generated from the following files:
Generated on Mon Sep 18 11:47:36 2006 for jot by  doxygen 1.4.4