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.
#include <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. |
|
| void | ClearDirtyRegion () |
| clear the dirty region -- resets it
completely. |
|
| int | numTiles () |
| get the number of tiles in the region
|
|
| ImgTile | Tile (int i) |
| return the i'th tile in the region (no
bounds checking performed) |
|
| ImgTile | GetTotalBounds () const |
| return the total bounds of the dirty region
as one rectangle. |
|
| bool | isEmpty () const |
| return true if the region is empty |
|
| void | Union (const ImgDirtyRegion &other) |
| union another region into this one. |
|
| void | DumpToLog () |
| ImgDirtyRegion & | operator= (const ImgDirtyRegion &cOther) |
| ImgDirtyRegion | ( | ) | [inline] |
Definition at line 1113 of file image.h.
{ m_DirtyTiles = 0; ClearDirtyRegion(); }
| ~ImgDirtyRegion | ( | ) | [inline] |
| 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.
{
ClearDirtyTiles();
memset(m_DirtyChunks, 0, DIRTY_REGION_XY_SIZE * DIRTY_REGION_XY_SIZE);
m_ChunksSet = 0;
m_DirtyTotalChunks.setEmpty();
m_InTileCount = 0;
}
| int numTiles | ( | ) | [inline] |
| ImgTile Tile | ( | int | i | ) | [inline] |
| ImgTile GetTotalBounds | ( | ) | const [inline] |
| bool isEmpty | ( | ) | const [inline] |
| void Union | ( | const ImgDirtyRegion & | other | ) |
union another region into this one.
| void DumpToLog | ( | ) |
| ImgDirtyRegion& operator= | ( | const ImgDirtyRegion & | cOther | ) |