GClasses
GClasses::GRegionAjacencyGraph Class Reference

Detailed Description

The base class for region ajacency graphs. These are useful for breaking down an image into patches of similar color.

#include <GRegion.h>

Inheritance diagram for GClasses::GRegionAjacencyGraph:
GClasses::G2DRegionGraph

Public Member Functions

 GRegionAjacencyGraph ()
 
virtual ~GRegionAjacencyGraph ()
 
size_t addRegion ()
 Creates a new region and returns the region number. More...
 
void ajacency (size_t nEdge, size_t *pRegion1, size_t *pRegion2)
 Returns the two regions that are ajacent. More...
 
size_t ajacencyCount ()
 Returns the number of ajacencies. More...
 
bool areNeighbors (size_t nRegion1, size_t nRegion2)
 Returns true if the two specified regions are neighbors. More...
 
void averageColor (size_t nRegion, float *pRed, float *pGreen, float *pBlue)
 Returns the average pixel color in the specified region. More...
 
void makeNeighbors (size_t nRegion1, size_t nRegion2)
 Makes the two specified regions neighbors (if they aren't already neighbors) More...
 
size_t regionCount ()
 Returns the number of regions so far. More...
 

Protected Attributes

std::vector< GRegionEdge * > m_neighbors
 
GHeapm_pHeap
 
std::vector< GRegion * > m_regions
 

Constructor & Destructor Documentation

GClasses::GRegionAjacencyGraph::GRegionAjacencyGraph ( )
virtual GClasses::GRegionAjacencyGraph::~GRegionAjacencyGraph ( )
virtual

Member Function Documentation

size_t GClasses::GRegionAjacencyGraph::addRegion ( )

Creates a new region and returns the region number.

void GClasses::GRegionAjacencyGraph::ajacency ( size_t  nEdge,
size_t *  pRegion1,
size_t *  pRegion2 
)

Returns the two regions that are ajacent.

size_t GClasses::GRegionAjacencyGraph::ajacencyCount ( )

Returns the number of ajacencies.

bool GClasses::GRegionAjacencyGraph::areNeighbors ( size_t  nRegion1,
size_t  nRegion2 
)

Returns true if the two specified regions are neighbors.

void GClasses::GRegionAjacencyGraph::averageColor ( size_t  nRegion,
float *  pRed,
float *  pGreen,
float *  pBlue 
)

Returns the average pixel color in the specified region.

void GClasses::GRegionAjacencyGraph::makeNeighbors ( size_t  nRegion1,
size_t  nRegion2 
)

Makes the two specified regions neighbors (if they aren't already neighbors)

size_t GClasses::GRegionAjacencyGraph::regionCount ( )

Returns the number of regions so far.

Member Data Documentation

std::vector<GRegionEdge*> GClasses::GRegionAjacencyGraph::m_neighbors
protected
GHeap* GClasses::GRegionAjacencyGraph::m_pHeap
protected
std::vector<GRegion*> GClasses::GRegionAjacencyGraph::m_regions
protected