GClasses

GClasses::GRegionAjacencyGraph Class Reference

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

#include <GRegion.h>

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

List of all members.

Public Member Functions

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

Protected Attributes

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

Detailed Description

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


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]
std::vector<GRegion*> GClasses::GRegionAjacencyGraph::m_regions [protected]