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)
 Constructs a scanline through the two points.

 BresenhamLineScan (const Vector2< double > &direction)
 Constructs a scanline with the given direction.

 BresenhamLineScan (const double &direction)
 Constructs a scanline with the given direction.

 BresenhamLineScan (const Vector2< int > &start, const double &direction, const CameraInfo &cameraInfo)
 Constructs a scanline with the given direction starting at start and ending at the image boundary.

 BresenhamLineScan (const Vector2< int > &start, const Vector2< double > &direction, const CameraInfo &cameraInfo)
 Constructs a scanline with the given direction starting at start and ending at the image boundary.

void init ()
 Resets the error counter.

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


Public Attributes

int numberOfPixels
 In conjuction with certain constructors (see above), this value can be used as a termination criterion for the scan.


Private Member Functions

void setup (const Vector2< int > &diff)
 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
 

Constructs a scanline through the two points.

numberOfPixels can be used.

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

Definition at line 46 of file BresenhamLineScan.cpp.

References setup().

Here is the call graph for this function:

BresenhamLineScan::BresenhamLineScan const Vector2< double > &  direction  ) 
 

Constructs a scanline with the given direction.

Parameters:
direction The direction vector of the scanline.

Definition at line 51 of file BresenhamLineScan.cpp.

References setup(), Vector2< double >::x, and Vector2< double >::y.

Here is the call graph for this function:

BresenhamLineScan::BresenhamLineScan const double &  direction  ) 
 

Constructs a scanline with the given direction.

Parameters:
direction The direction (angle) of the line, expressed in radians.

Definition at line 57 of file BresenhamLineScan.cpp.

References setup().

Here is the call graph for this function:

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

Constructs a scanline with the given direction starting at start and ending at the image boundary.

numberOfPixels can be used.

Parameters:
start The start point of the line.
direction The direction (angle) of the line, expressed in radians.
cameraInfo The cameraInfo object of the camera that captured the image.

Definition at line 90 of file BresenhamLineScan.cpp.

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

Here is the call graph for this function:

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

Constructs a scanline with the given direction starting at start and ending at the image boundary.

numberOfPixels can be used.

Parameters:
start The start point of the ray
direction The vector pointing in the direction of scanning. Must not be a null vector.
cameraInfo The cameraInfo object of the camera that captured the image.
Author:
Tobias Oberlies

Definition at line 63 of file BresenhamLineScan.cpp.

References delta, Geometry::getIntersectionPointsOfLineAndRectangle(), CameraInfo::resolutionHeight, CameraInfo::resolutionWidth, setup(), Vector2< V >::x, and Vector2< V >::y.

Here is the call graph for this function:


Member Function Documentation

void BresenhamLineScan::init  )  [inline]
 

Resets the error counter.

Definition at line 67 of file BresenhamLineScan.h.

References baseError, and error.

Referenced by VLCBallSpecialist::addBallPercept(), GT2005BallSpecialist::addBallPercept(), VLCGoalRecognizer::detectEdge(), GT2005GoalRecognizer::detectEdge(), VLCGoalRecognizer::detectEdgeTwice(), GT2005GoalRecognizer::detectEdgeTwice(), VLCGoalRecognizer::detectGreenBelowGoalpost(), GT2005GoalRecognizer::detectGreenBelowGoalpost(), SlamBeaconDetector::findSpecial(), VLCBeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForBeaconPart(), GT2005BeaconDetector::scanForBeaconPart(), VLCBeaconDetector::scanForPink(), SlamBeaconDetector::scanForPink(), and GT2005BeaconDetector::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 77 of file BresenhamLineScan.h.

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

Referenced by VLCBallSpecialist::addBallPercept(), GT2005BallSpecialist::addBallPercept(), SlamFlagLocator::addFlagDirection(), GT2005PlayerSpecialist::checkForWhiteLineBetweenBlue(), GT2005PlayerSpecialist::checkForWhiteLineBetweenRed(), GT2005PlayerSpecialist::detectBlueRobots(), VLCGoalRecognizer::detectEdge(), GT2005GoalRecognizer::detectEdge(), VLCGoalRecognizer::detectGreenBelowGoalpost(), GT2005GoalRecognizer::detectGreenBelowGoalpost(), GT2005PlayerSpecialist::detectRedRobots(), VLCLineFinder_DeterministicApproach::doVerificationScan(), SlamBorderFinder::doVerificationScan(), GT2005LineFinder_DeterministicApproach::doVerificationScan(), VLCLineFinder_DeterministicApproach::doVerificationScanForCircle(), GT2005LineFinder_DeterministicApproach::doVerificationScanForCircle(), SlamBeaconDetector::findSpecial(), VLCRobotSpecialist::generateColorspace(), GT2005RobotSpecialist::generateColorspace(), VLCRobotSpecialist::noColorPixelsBetween(), GT2005RobotSpecialist::noColorPixelsBetween(), VLCRobotSpecialist::scan(), GT2005RobotSpecialist::scan(), VLCGoalRecognizer::scanAlongLine(), GT2005GoalRecognizer::scanAlongLine(), VLCBeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForBeaconPart(), GT2005BeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForFlagCharacterization(), VLCBeaconDetector::scanForPink(), SlamBeaconDetector::scanForPink(), and GT2005BeaconDetector::scanForPink().

void BresenhamLineScan::setup const Vector2< int > &  diff  )  [private]
 

Computes the Bresenham parameters.

Definition at line 13 of file BresenhamLineScan.cpp.

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

Referenced by BresenhamLineScan().


Member Data Documentation

int BresenhamLineScan::numberOfPixels
 

In conjuction with certain constructors (see above), this value can be used as a termination criterion for the scan.

In those cases, getNext can be called numberOfPixels times without leaving the image boundaries.

Definition at line 93 of file BresenhamLineScan.h.

Referenced by VLCBallSpecialist::addBallPercept(), GT2005BallSpecialist::addBallPercept(), SlamFlagLocator::addFlagDirection(), VLCGoalRecognizer::detectFreePartOfGoal(), GT2005GoalRecognizer::detectFreePartOfGoal(), VLCLineFinder_DeterministicApproach::doVerificationScanForCircle(), GT2005LineFinder_DeterministicApproach::doVerificationScanForCircle(), VLCRobotSpecialist::generateColorspace(), GT2005RobotSpecialist::generateColorspace(), VLCRobotSpecialist::noColorPixelsBetween(), GT2005RobotSpecialist::noColorPixelsBetween(), VLCRobotSpecialist::scan(), GT2005RobotSpecialist::scan(), VLCBeaconDetector::scanForBeaconPart(), SlamBeaconDetector::scanForBeaconPart(), GT2005BeaconDetector::scanForBeaconPart(), VLCBeaconDetector::scanForPink(), SlamBeaconDetector::scanForPink(), and GT2005BeaconDetector::scanForPink().

bool BresenhamLineScan::alongX [private]
 

Increase x-values, if true.

Definition at line 98 of file BresenhamLineScan.h.

Referenced by setup().

int BresenhamLineScan::delta [private]
 

The error per step.

Definition at line 100 of file BresenhamLineScan.h.

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

int BresenhamLineScan::baseError [private]
 

The initial error value.

Definition at line 102 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 104 of file BresenhamLineScan.h.

Referenced by getNext(), and setup().

Vector2<int> BresenhamLineScan::standardOffset [private]
 

The standard offset per step.

Definition at line 106 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 108 of file BresenhamLineScan.h.

Referenced by getNext(), and setup().

int BresenhamLineScan::error [private]
 

The current error counter.

Definition at line 110 of file BresenhamLineScan.h.

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


The documentation for this class was generated from the following files:
Generated on Mon Mar 20 22:11:22 2006 for GT2005 by doxygen 1.3.6