ImgDirtyRegion Class Reference


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

#include <image.h>

List of all members.

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)

Constructor & Destructor Documentation

ImgDirtyRegion ( ) [inline]

Definition at line 1113 of file image.h.

{ m_DirtyTiles = 0; ClearDirtyRegion(); }
~ImgDirtyRegion ( ) [inline]

Definition at line 1114 of file image.h.

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

    {
        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]

get the number of tiles in the region

Definition at line 1131 of file image.h.

    {
        if (!m_DirtyTiles) ComputeDirtyTiles();
        return m_NumTiles;
    }
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.

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

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

Definition at line 1144 of file image.h.

    {
        return m_DirtyTotalChunks; 
    }
bool isEmpty ( ) const [inline]

return true if the region is empty

Definition at line 1150 of file image.h.

{ return m_DirtyTotalChunks.isEmpty(); }
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:

ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion
ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion ImgDirtyRegion