GClasses

GClasses::GRegionAreaIterator Class Reference

Iterates over all the pixels in an image that have the same color and are transitively adjacent. In other words, if you were to flood-fill a the specified point, this returns all the pixels that would be changed. More...

#include <GRegion.h>

List of all members.

Public Member Functions

 GRegionAreaIterator (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.
 ~GRegionAreaIterator ()
bool next (int *pX, int *pY)
 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 a pixel in the region.

Protected Attributes

unsigned int m_nRegion
int m_left
int m_right
int m_top
int m_bottom
int m_x
int m_y
GImagem_pImage

Detailed Description

Iterates over all the pixels in an image that have the same color and are transitively adjacent. In other words, if you were to flood-fill a the specified point, this returns all the pixels that would be changed.


Constructor & Destructor Documentation

GClasses::GRegionAreaIterator::GRegionAreaIterator ( 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::GRegionAreaIterator::~GRegionAreaIterator ( )

Member Function Documentation

bool GClasses::GRegionAreaIterator::next ( int *  pX,
int *  pY 
)

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 a pixel in the region.


Member Data Documentation

unsigned int GClasses::GRegionAreaIterator::m_nRegion [protected]