Provides support for caching of large images. More...
#include <vgui_cache_wizard.h>
Public Types | |
typedef vcl_vector< GLuint > | image_cache_quadrants |
Each image consists of MxN quadrants. M,N is to be determined on runtime. | |
typedef vcl_pair< vil1_image, image_cache_quadrants * > | wizard_image |
typedef vcl_pair< int, int > | dimension |
Public Member Functions | |
int | load_image (vil1_image) |
Loads an image into the memory. | |
bool | get_section (int id, int x, int y, int width, int height, image_cache_quadrants *quadrants, dimension *pos, dimension *size) |
Get the texture names for the current viewport. | |
void | TexImage2D_Brownie (vil1_image img) |
int | get_quadrant_width () const |
Get the image quadrant width. | |
int | get_quadrant_height () const |
Get the image quadrant height. | |
vgui_cache_wizard (int quadrant_width, int quadrant_height) | |
Constructor - set the image quadrant size here. | |
~vgui_cache_wizard () | |
Destructor. | |
Static Public Member Functions | |
static vgui_cache_wizard * | Instance () |
Get the class instance. | |
Private Attributes | |
vcl_vector< wizard_image * > | images_ |
Hold a vector of images that have been loaded. | |
vcl_vector< dimension * > | dimensions_ |
Dimensions of images in quadrants units. | |
int | quadrant_width_ |
int | quadrant_height_ |
unsigned int | max_texture_num_ |
Maximum number of textures(limited by memory size - driver dependent, as some drivers will do their one caching so that the number of textures is only limited by the size of virtual memory. | |
GLuint * | texture_names_ |
vcl_list< GLuint > | cache_queue_ |
Cache queue. |
Provides support for caching of large images.
Definition at line 29 of file vgui_cache_wizard.h.
typedef vcl_pair<int,int> vgui_cache_wizard::dimension |
Definition at line 35 of file vgui_cache_wizard.h.
typedef vcl_vector<GLuint> vgui_cache_wizard::image_cache_quadrants |
Each image consists of MxN quadrants. M,N is to be determined on runtime.
Definition at line 33 of file vgui_cache_wizard.h.
typedef vcl_pair<vil1_image,image_cache_quadrants *> vgui_cache_wizard::wizard_image |
Definition at line 34 of file vgui_cache_wizard.h.
vgui_cache_wizard::vgui_cache_wizard | ( | int | quadrant_width, |
int | quadrant_height | ||
) |
Constructor - set the image quadrant size here.
Constructor.
Set the image quadrant width/height. Do use sensible values(i.e. powers of two) otherwise the cache wizard won't work.
Get the maximum texture size. Note that this function returns the worst case scenario i.e. assumes the texture is 4bpp... So we are on the safe ground
Definition at line 34 of file vgui_cache_wizard.cxx.
vgui_cache_wizard::~vgui_cache_wizard | ( | ) |
Destructor.
Definition at line 65 of file vgui_cache_wizard.cxx.
int vgui_cache_wizard::get_quadrant_height | ( | ) | const [inline] |
Get the image quadrant height.
Definition at line 51 of file vgui_cache_wizard.h.
int vgui_cache_wizard::get_quadrant_width | ( | ) | const [inline] |
Get the image quadrant width.
Definition at line 48 of file vgui_cache_wizard.h.
bool vgui_cache_wizard::get_section | ( | int | id, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
image_cache_quadrants * | quadrants, | ||
dimension * | pos, | ||
dimension * | size | ||
) |
Get the texture names for the current viewport.
Returns the texture names associated with the specified image region.
Definition at line 107 of file vgui_cache_wizard.cxx.
vgui_cache_wizard * vgui_cache_wizard::Instance | ( | ) | [static] |
Get the class instance.
Definition at line 74 of file vgui_cache_wizard.cxx.
int vgui_cache_wizard::load_image | ( | vil1_image | img | ) |
Loads an image into the memory.
Loads an image.
Definition at line 81 of file vgui_cache_wizard.cxx.
void vgui_cache_wizard::TexImage2D_Brownie | ( | vil1_image | img | ) |
Definition at line 232 of file vgui_cache_wizard.cxx.
vcl_list<GLuint> vgui_cache_wizard::cache_queue_ [private] |
Cache queue.
Definition at line 84 of file vgui_cache_wizard.h.
vcl_vector<dimension *> vgui_cache_wizard::dimensions_ [private] |
Dimensions of images in quadrants units.
Definition at line 68 of file vgui_cache_wizard.h.
vcl_vector<wizard_image *> vgui_cache_wizard::images_ [private] |
Hold a vector of images that have been loaded.
Definition at line 65 of file vgui_cache_wizard.h.
unsigned int vgui_cache_wizard::max_texture_num_ [private] |
Maximum number of textures(limited by memory size - driver dependent, as some drivers will do their one caching so that the number of textures is only limited by the size of virtual memory.
Definition at line 79 of file vgui_cache_wizard.h.
int vgui_cache_wizard::quadrant_height_ [private] |
Definition at line 73 of file vgui_cache_wizard.h.
int vgui_cache_wizard::quadrant_width_ [private] |
Definition at line 71 of file vgui_cache_wizard.h.
GLuint* vgui_cache_wizard::texture_names_ [private] |
Definition at line 81 of file vgui_cache_wizard.h.