libcvd
Public Member Functions | List of all members
CVD::Brezenham8 Class Reference

Class to implement the Bresenham line-drawing algorithm. More...

#include <brezenham.h>

Public Member Functions

 Brezenham8 (TooN::Vector< 2 > dir)
 Construct a line-drawing object. More...
 
ImageRef step ()
 Returns the next image co-ordinate along the line.
 
ImageRef sideways ()
 Which compass position most orthogonal to the line's direction? At each pixel given by step() you are guaranteed to be able to walk in the direction given by sideways and not walk on the line. More...
 

Detailed Description

Class to implement the Bresenham line-drawing algorithm.

This object does not draw directly into an image, it simply outputs the set of image co-ordinates that should be visited to draw a line in a certain direction. Pixels are generated in a 8-connected sense (i.e. diagonal steps are possible). See also Brezenham.

Constructor & Destructor Documentation

◆ Brezenham8()

CVD::Brezenham8::Brezenham8 ( TooN::Vector< 2 >  dir)

Construct a line-drawing object.

Parameters
dirThe (x,y) direction of the line

Member Function Documentation

◆ sideways()

ImageRef CVD::Brezenham8::sideways ( )
inline

Which compass position most orthogonal to the line's direction? At each pixel given by step() you are guaranteed to be able to walk in the direction given by sideways and not walk on the line.


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