GClasses
|
Iterates the border of a 2D region by running around the border and reporting the coordinates of each interior border pixel and the direction to the edge. It goes in a counter-clockwise direction.
#include <GRegion.h>
Public Member Functions | |
GRegionBorderIterator (GImage *pImage, int nSampleX, int nSampleY) | |
The point (nSampleX, nSampleY) should be somewhere in the region The image pImage should be a region mask, such that all points in the same region have exactly the same pixel value. More... | |
~GRegionBorderIterator () | |
bool | next (int *pX, int *pY, int *pDirection) |
If it returns false, the current values are invalid and it's done. If it returns true, pX and pY will hold the coordinates of an interior border pixel. pDirection will be the direction to the edge. 0=right, 1=up, 2=left, 3=down. More... | |
Protected Member Functions | |
void | leap () |
bool | look () |
Protected Attributes | |
bool | m_bOddPass |
int | m_direction |
int | m_endX |
int | m_endY |
unsigned int | m_nRegion |
GImage * | m_pImage |
int | m_x |
int | m_y |
GClasses::GRegionBorderIterator::GRegionBorderIterator | ( | GImage * | pImage, |
int | nSampleX, | ||
int | nSampleY | ||
) |
The point (nSampleX, nSampleY) should be somewhere in the region The image pImage should be a region mask, such that all points in the same region have exactly the same pixel value.
GClasses::GRegionBorderIterator::~GRegionBorderIterator | ( | ) |
|
protected |
|
protected |
bool GClasses::GRegionBorderIterator::next | ( | int * | pX, |
int * | pY, | ||
int * | pDirection | ||
) |
If it returns false, the current values are invalid and it's done. If it returns true, pX and pY will hold the coordinates of an interior border pixel. pDirection will be the direction to the edge. 0=right, 1=up, 2=left, 3=down.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |