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. More...
#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. | |
~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. | |
Protected Member Functions | |
bool | look () |
void | leap () |
Protected Attributes | |
GImage * | m_pImage |
unsigned int | m_nRegion |
int | m_x |
int | m_y |
int | m_endX |
int | m_endY |
int | m_direction |
bool | m_bOddPass |
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.
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 | ( | ) |
void GClasses::GRegionBorderIterator::leap | ( | ) | [protected] |
bool GClasses::GRegionBorderIterator::look | ( | ) | [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.
bool GClasses::GRegionBorderIterator::m_bOddPass [protected] |
int GClasses::GRegionBorderIterator::m_direction [protected] |
int GClasses::GRegionBorderIterator::m_endX [protected] |
int GClasses::GRegionBorderIterator::m_endY [protected] |
unsigned int GClasses::GRegionBorderIterator::m_nRegion [protected] |
GImage* GClasses::GRegionBorderIterator::m_pImage [protected] |
int GClasses::GRegionBorderIterator::m_x [protected] |
int GClasses::GRegionBorderIterator::m_y [protected] |