CMSC23700 Common Code Library
Support code for CS23700 programming projects
Loading...
Searching...
No Matches
tqt::TextureQTree Class Reference

#include <tqt.hpp>

Public Member Functions

 TextureQTree (std::string const &filename, bool flip, bool sRGB)
 constructor for a texture quad tree
 
 ~TextureQTree ()
 
bool isValid () const
 is this a valid TQT?
 
int depth () const
 the depth of the TQT
 
int tileSize () const
 the size of a texture tile measured in pixels (tiles are always square)
 
cs237::Image2DloadImage (int level, int row, int col)
 return the image tile at the specified quadtree node.
 
bool sRGB () const
 are the images sRGB?
 

Static Public Member Functions

static bool isTQTFile (std::string const &filename)
 return true if the file looks like a TQT file of the right version
 

Detailed Description

Manages a disk-based texture-image quadtree and supports loading individual texture images at different levels and locations in the tree.

Constructor & Destructor Documentation

◆ TextureQTree()

tqt::TextureQTree::TextureQTree ( std::string const &  filename,
bool  flip,
bool  sRGB 
)

constructor for a texture quad tree

Parameters
filename
flipshould the image be flipped to match OpenGL conventions
sRGBare the textures in sRGB format?

◆ ~TextureQTree()

tqt::TextureQTree::~TextureQTree ( )

Member Function Documentation

◆ depth()

int tqt::TextureQTree::depth ( ) const
inline

the depth of the TQT

◆ isTQTFile()

static bool tqt::TextureQTree::isTQTFile ( std::string const &  filename)
static

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

◆ isValid()

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

is this a valid TQT?

◆ loadImage()

cs237::Image2D * tqt::TextureQTree::loadImage ( int  level,
int  row,
int  col 
)

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)
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.

◆ sRGB()

bool tqt::TextureQTree::sRGB ( ) const
inline

are the images sRGB?

◆ tileSize()

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: