BresenhamLineScan Class Reference

#include <BresenhamLineScan.h>

List of all members.

Public Member Functions

 BresenhamLineScan (const Vector2< int > &start, const Vector2< int > &end)
 BresenhamLineScan (const Vector2< double > &direction, const CameraInfo &cameraInfo)
 BresenhamLineScan (const double &direction, const CameraInfo &cameraInfo)
 BresenhamLineScan (const Vector2< int > &start, const double &direction, const CameraInfo &cameraInfo)
void init ()
void getNext (Vector2< int > &pos)

Public Attributes

int numberOfPixels

Private Member Functions

void setup (const Vector2< int > &start, const Vector2< int > &end)

Private Attributes

bool alongX
int delta
int baseError
int resetError
Vector2< int > standardOffset
Vector2< int > correctionOffset
int error


Detailed Description

Definition at line 20 of file BresenhamLineScan.h.


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().

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().

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().

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().


Member Function Documentation

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(), ScanningGrid::prepareHorizontalScanline(), ScanningGrid::prepareVerticalScanline(), and GT2004BeaconDetector::scanForBeaconPart().

void BresenhamLineScan::init (  )  [inline]

initializes the error counter

Definition at line 50 of file BresenhamLineScan.h.

References baseError, and error.

Referenced by ScanningGrid::prepareHorizontalScanline(), ScanningGrid::prepareVerticalScanline(), 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 abs(), alongX, baseError, correctionOffset, delta, numberOfPixels, resetError, standardOffset, Vector2< V >::x, and Vector2< V >::y.

Referenced by BresenhamLineScan().


Member Data Documentation

bool BresenhamLineScan::alongX [private]

Increase x-values, if true

Definition at line 79 of file BresenhamLineScan.h.

Referenced by setup().

int BresenhamLineScan::baseError [private]

The initial error value

Definition at line 83 of file BresenhamLineScan.h.

Referenced by init(), 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::delta [private]

The error per step

Definition at line 81 of file BresenhamLineScan.h.

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

int BresenhamLineScan::error [private]

The current error counter

Definition at line 91 of file BresenhamLineScan.h.

Referenced by getNext(), and init().

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 ScanningGrid::prepareHorizontalScanline(), ScanningGrid::prepareVerticalScanline(), GT2004BeaconDetector::scanForBeaconPart(), GT2004BeaconDetector::scanForPink(), 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().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:19:34 2006 for DT2005.panorama by  doxygen 1.4.7