CMSC23700 Common Code Library
Support code for CS23700 programming projects
TQT::TextureQTree Class Reference

Manages a disk-based texture quadtree. More...

#include <tqt.hxx>

Public Member Functions

 TextureQTree (const char *filename)
 
 ~TextureQTree ()
 
bool isValid () const
 is this a valid TQT? More...
 
int Depth () const
 the depth of the TQT More...
 
int TileSize () const
 the size of a texture tile measured in pixels (tiles are always square) More...
 
cs237::image2dLoadImage (int level, int row, int col, bool flip=true)
 

Static Public Member Functions

static bool isTQTFile (const char *filename)
 return true if the file looks like a TQT file of the right version More...
 

Detailed Description

Manages a disk-based texture quadtree.

Constructor & Destructor Documentation

TQT::TextureQTree::TextureQTree ( const char *  filename)
TQT::TextureQTree::~TextureQTree ( )

Member Function Documentation

int TQT::TextureQTree::Depth ( ) const
inline

the depth of the TQT

static bool TQT::TextureQTree::isTQTFile ( const char *  filename)
static

return true if the file looks like a TQT file of the right version

bool TQT::TextureQTree::isValid ( ) const
inline

is this a valid TQT?

cs237::image2d* TQT::TextureQTree::LoadImage ( int  level,
int  row,
int  col,
bool  flip = true 
)

return the image tile at the specified quadtree node.

Parameters
[in]levelthe level of the node in the tree (root = 0)
[in]rowthe row of the node on its level (north == 0)
[in]colthe column of the node on its level (west == 0)
[in]flipshould the image be flipped to match OpenGL (default true)
Returns
a pointer to the image; nullptr is returned if there is an error. It is the caller's responsibility to manage the image's storage.
int TQT::TextureQTree::TileSize ( ) const
inline

the size of a texture tile measured in pixels (tiles are always square)


The documentation for this class was generated from the following file: