ImgDirtyRegion Class Reference

ImgDirtyRegion Class Reference

#include <image.h>

Class Description

Implement a somewhat smarter image region that a simple rectangle.

This is implemented as a byte mask each byte of which covers a region of the image. Should that byte be 1, that region has been altered. We will use one dirty region per texture tile. It can compute a list of ImgTile s that will cover all the dirty parts of an image.

Definition at line 1080 of file image.h.

Public Member Functions

 ImgDirtyRegion ()
 
 ~ImgDirtyRegion ()
 
void AddToDirtyRegion (const ImgTile &dirtyTile)
 add a imgTile to the dirty region If you are partway through iterating the tiles, this will reset that iteration. More...
 
void ClearDirtyRegion ()
 clear the dirty region – resets it completely. More...
 
int numTiles ()
 get the number of tiles in the region More...
 
ImgTile Tile (int i)
 return the i'th tile in the region (no bounds checking performed) More...
 
ImgTile GetTotalBounds () const
 return the total bounds of the dirty region as one rectangle. More...
 
bool isEmpty () const
 return true if the region is empty More...
 
void Union (const ImgDirtyRegion &other)
 union another region into this one. More...
 
void DumpToLog ()
 
ImgDirtyRegionoperator= (const ImgDirtyRegion &cOther)
 

Constructor & Destructor Documentation

ImgDirtyRegion ( )
inline

Definition at line 1113 of file image.h.

1113 { m_DirtyTiles = 0; ClearDirtyRegion(); }
void ClearDirtyRegion()
clear the dirty region – resets it completely.
Definition: image.h:1121
~ImgDirtyRegion ( )
inline

Definition at line 1114 of file image.h.

1114 { ClearDirtyTiles(); }

Member Function Documentation

void AddToDirtyRegion ( const ImgTile dirtyTile)

add a imgTile to the dirty region If you are partway through iterating the tiles, this will reset that iteration.

void ClearDirtyRegion ( )
inline

clear the dirty region – resets it completely.

Definition at line 1121 of file image.h.

1122  {
1123  ClearDirtyTiles();
1124  memset(m_DirtyChunks, 0, DIRTY_REGION_XY_SIZE * DIRTY_REGION_XY_SIZE);
1125  m_ChunksSet = 0;
1126  m_DirtyTotalChunks.setEmpty();
1127  m_InTileCount = 0;
1128  }
#define DIRTY_REGION_XY_SIZE
Definition: image.h:1071
void setEmpty()
Definition: image.h:1013
int numTiles ( )
inline

get the number of tiles in the region

Definition at line 1131 of file image.h.

1132  {
1133  if (!m_DirtyTiles) ComputeDirtyTiles();
1134  return m_NumTiles;
1135  }
ImgTile Tile ( int  i)
inline

return the i'th tile in the region (no bounds checking performed)

Definition at line 1138 of file image.h.

1139  {
1140  return m_DirtyTiles[i];
1141  }
ImgTile GetTotalBounds ( ) const
inline

return the total bounds of the dirty region as one rectangle.

Definition at line 1144 of file image.h.

1145  {
1146  return m_DirtyTotalChunks;
1147  }
bool isEmpty ( ) const
inline

return true if the region is empty

Definition at line 1150 of file image.h.

1150 { return m_DirtyTotalChunks.isEmpty(); }
bool isEmpty() const
return true of this tile is empty
Definition: image.h:1011
void Union ( const ImgDirtyRegion other)

union another region into this one.

void DumpToLog ( )
ImgDirtyRegion& operator= ( const ImgDirtyRegion cOther)

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