Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

BresenhamLineScan Class Reference

#include <BresenhamLineScan.h>

Collaboration diagram for BresenhamLineScan:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BresenhamLineScan (const Vector2< int > &start, const Vector2< int > &end)
 Constructor: Computes parameters for a line.

 BresenhamLineScan (const Vector2< double > &direction, const CameraInfo &cameraInfo)
 Constructor: Computes parameters for a line.

 BresenhamLineScan (const double &direction, const CameraInfo &cameraInfo)
 Constructor: Computes parameters for a line.

 BresenhamLineScan (const Vector2< int > &start, const double &direction, const CameraInfo &cameraInfo)
 Constructor: Computes parameters for a line, numberOfPixels can be used as a termination condition to prevent scans outside of the image space.

void init ()
 initializes the error counter

void getNext (Vector2< int > &pos)
 Increments the coordinates to the next point on the line.


Public Attributes

int numberOfPixels
 The numberOfPixels, can be used as a termination condition for the scan, but only if the first constructor has been used (the other 2 constructors are in fact meant for infinite/unbounded scans, so it doesn't make sense).


Private Member Functions

void setup (const Vector2< int > &start, const Vector2< int > &end)
 Computes the Bresenham parameters.


Private Attributes

bool alongX
 Increase x-values, if true.

int delta
 The error per step.

int baseError
 The initial error value.

int resetError
 Resets the error to a value less than zero.

Vector2< int > standardOffset
 The standard offset per step.

Vector2< int > correctionOffset
 The additional offset, if the error is above zero.

int error
 The current error counter.


Constructor & Destructor Documentation

BresenhamLineScan::BresenhamLineScan const Vector2< int > &  start,
const Vector2< int > &  end
 

Constructor: Computes parameters for a line.

Parameters:
start The start point of the line
end The end point of the line

Definition at line 45 of file BresenhamLineScan.cpp.

References setup().

Here is the call graph for this function:

BresenhamLineScan::BresenhamLineScan const Vector2< double > &  direction,
const CameraInfo cameraInfo
 

Constructor: Computes parameters for a line.

Parameters:
direction The direction vector of the line
cameraInfo Contains image related parameters

Definition at line 81 of file BresenhamLineScan.cpp.

References Geometry::getIntersectionPointsOfLineAndRectangle(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and setup().

Here is the call graph for this function:

BresenhamLineScan::BresenhamLineScan const double &  direction,
const CameraInfo cameraInfo
 

Constructor: Computes parameters for a line.

Parameters:
direction The direction (angle) of the line, expressed in radians
cameraInfo Contains image related parameters

Definition at line 50 of file BresenhamLineScan.cpp.

References Geometry::getIntersectionPointsOfLineAndRectangle(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and setup().

Here is the call graph for this function:

BresenhamLineScan::BresenhamLineScan const Vector2< int > &  start,
const double &  direction,
const CameraInfo cameraInfo
 

Constructor: Computes parameters for a line, numberOfPixels can be used as a termination condition to prevent scans outside of the image space.

Parameters:
start The start point of the line
direction The direction (angle) of the line, expressed in radians
cameraInfo Contains image related parameters

Definition at line 63 of file BresenhamLineScan.cpp.

References delta, Geometry::getIntersectionPointsOfLineAndRectangle(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, and setup().

Here is the call graph for this function:


Member Function Documentation

void BresenhamLineScan::init  )  [inline]
 

initializes the error counter

Definition at line 50 of file BresenhamLineScan.h.

References baseError, and error.

Referenced by GT2004BallSpecialist::addBallPercept(), GT2004BeaconDetector::scanForBeaconPart(), and GT2004BeaconDetector::scanForPink().

void BresenhamLineScan::getNext Vector2< int > &  pos  )  [inline]
 

Increments the coordinates to the next point on the line.

Parameters:
pos The position of the current pixel on the line, which is incremented by the Bresenham algorithm

Definition at line 59 of file BresenhamLineScan.h.

References correctionOffset, delta, error, resetError, and standardOffset.

Referenced by GT2004BallSpecialist::addBallPercept(), GT2004BeaconDetector::scanForBeaconPart(), and GT2004BeaconDetector::scanForPink().

void BresenhamLineScan::setup const Vector2< int > &  start,
const Vector2< int > &  end
[private]
 

Computes the Bresenham parameters.

Definition at line 13 of file BresenhamLineScan.cpp.

References alongX, baseError, correctionOffset, delta, resetError, standardOffset, Vector2< int >::x, Vector2< V >::x, Vector2< int >::y, and Vector2< V >::y.

Referenced by BresenhamLineScan().


Member Data Documentation

int BresenhamLineScan::numberOfPixels
 

The numberOfPixels, can be used as a termination condition for the scan, but only if the first constructor has been used (the other 2 constructors are in fact meant for infinite/unbounded scans, so it doesn't make sense).

Definition at line 74 of file BresenhamLineScan.h.

Referenced by GT2004BallSpecialist::addBallPercept(), GT2004BeaconDetector::scanForBeaconPart(), and GT2004BeaconDetector::scanForPink().

bool BresenhamLineScan::alongX [private]
 

Increase x-values, if true.

Definition at line 79 of file BresenhamLineScan.h.

Referenced by setup().

int BresenhamLineScan::delta [private]
 

The error per step.

Definition at line 81 of file BresenhamLineScan.h.

Referenced by BresenhamLineScan(), getNext(), and setup().

int BresenhamLineScan::baseError [private]
 

The initial error value.

Definition at line 83 of file BresenhamLineScan.h.

Referenced by init(), and setup().

int BresenhamLineScan::resetError [private]
 

Resets the error to a value less than zero.

Definition at line 85 of file BresenhamLineScan.h.

Referenced by getNext(), and setup().

Vector2<int> BresenhamLineScan::standardOffset [private]
 

The standard offset per step.

Definition at line 87 of file BresenhamLineScan.h.

Referenced by getNext(), and setup().

Vector2<int> BresenhamLineScan::correctionOffset [private]
 

The additional offset, if the error is above zero.

Definition at line 89 of file BresenhamLineScan.h.

Referenced by getNext(), and setup().

int BresenhamLineScan::error [private]
 

The current error counter.

Definition at line 91 of file BresenhamLineScan.h.

Referenced by getNext(), and init().


The documentation for this class was generated from the following files:
Generated on Thu Sep 23 20:04:46 2004 for GT2004 by doxygen 1.3.6