Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Attributes | List of all members
BIAS::BresenhamCircle Class Reference

Scans a circle using Bresenham's integer arithmetic algorithm. More...

#include <Base/ImageUtils/BresenhamCircle.hh>

Public Member Functions

 BresenhamCircle ()
 Default constructor. More...
 
 BresenhamCircle (int center[2], int radius)
 Constructor. More...
 
bool GetNext (int next[2])
 Returns the coordinate of the next point on the circle. More...
 
void Init (int center[2], int radius)
 Initialises this BresenhamCircle with new center and radius. More...
 
 ~BresenhamCircle ()
 Destructor. More...
 

Protected Attributes

int center_ [2]
 
int count_
 
int current_ [2]
 
int d_
 
int deltaE_
 
int deltaSE_
 
bool initialized_
 
int radius_
 

Detailed Description

Scans a circle using Bresenham's integer arithmetic algorithm.

Author
fw, clean-up + refactoring by rwulff 02/2010
Examples:
ExampleBresenham.cpp.

Definition at line 43 of file BresenhamCircle.hh.

Constructor & Destructor Documentation

BIAS::BresenhamCircle::BresenhamCircle ( )
inline

Default constructor.

You have to call Init() by yourself before calling GetNext().

Definition at line 51 of file BresenhamCircle.hh.

BIAS::BresenhamCircle::BresenhamCircle ( int  center[2],
int  radius 
)
inline

Constructor.

Parameters
centerthe center for this BresenhamCircle
radiusthe radius for this BresenhamCircle

Definition at line 64 of file BresenhamCircle.hh.

References Init().

BIAS::BresenhamCircle::~BresenhamCircle ( )
inline

Destructor.

Definition at line 71 of file BresenhamCircle.hh.

Member Function Documentation

bool BIAS::BresenhamCircle::GetNext ( int  next[2])
inline

Returns the coordinate of the next point on the circle.

Can be called in a while loop:

int nextCoords[2]; while (bresCirc.GetNext(nextCoords)){ // draw nextCoords in image }

Parameters
nextthe returned coordinate of the next point on the circle
Returns
true if there are still points left on the circle or false if the circle is finished
Examples:
ExampleBresenham.cpp.

Definition at line 125 of file BresenhamCircle.hh.

References center_, count_, current_, d_, deltaE_, deltaSE_, and initialized_.

Referenced by BIAS::ImageDraw< StorageType >::CircleCenter(), BIAS::CylindricalRectification< InputStorageType, OutputStorageType >::DetermineCylindricCameraBoundriesSpherical_(), and BIAS::ColorHistogram< StorageType >::GenerateCircleHist().

void BIAS::BresenhamCircle::Init ( int  center[2],
int  radius 
)
inline

Initialises this BresenhamCircle with new center and radius.

Parameters
centerthe new center for this BresenhamCircle
radiusthe new radius for this BresenhamCircle

Definition at line 84 of file BresenhamCircle.hh.

References center_, count_, current_, d_, deltaE_, deltaSE_, initialized_, and radius_.

Referenced by BresenhamCircle(), and BIAS::ImageDraw< StorageType >::CircleCenter().

Member Data Documentation

int BIAS::BresenhamCircle::center_[2]
protected

Definition at line 203 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::count_
protected

Definition at line 209 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::current_[2]
protected

Definition at line 205 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::d_
protected

Definition at line 206 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::deltaE_
protected

Definition at line 207 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::deltaSE_
protected

Definition at line 208 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

bool BIAS::BresenhamCircle::initialized_
protected

Definition at line 212 of file BresenhamCircle.hh.

Referenced by GetNext(), and Init().

int BIAS::BresenhamCircle::radius_
protected

Definition at line 204 of file BresenhamCircle.hh.

Referenced by Init().


The documentation for this class was generated from the following file: