8 #ifndef META_OCEAN_CV_BRESENHAM_H
9 #define META_OCEAN_CV_BRESENHAM_H
36 ORIENTATION_INVALID = 0u,
69 Bresenham(
const int x0,
const int y0,
const int x1,
const int y1);
82 inline bool isValid()
const;
104 static bool borderIntersection(
const Line2& line,
const int leftBorder,
const int topBorder,
const int rightBorder,
const int bottomBorder,
int& x0,
int& y0,
int& x1,
int& y1);
131 static unsigned int numberLinePixels(
const int x0,
const int y0,
const int x1,
const int y1);
157 orientation_(ORIENTATION_INVALID)
This class implements bresenham line algorithms.
Definition: Bresenham.h:27
static bool borderIntersection(const Line2 &line, const Scalar leftBorder, const Scalar topBorder, const Scalar rightBorder, const Scalar bottomBorder, Scalar &x0, Scalar &y0, Scalar &x1, Scalar &y1)
Computes the sub-pixel-precise border intersection (the begin and end position) of a sub-pixel-precis...
static void intermediatePixels(const PixelPosition &position0, const PixelPosition &position1, PixelPositions &pixels)
Determines the intermediate pixels between two given pixels.
int updateX_
Horizontal update value.
Definition: Bresenham.h:150
void findNext(int &x, int &y)
Applies one Bresenham step to find the next pixel.
static unsigned int numberLinePixels(const int x0, const int y0, const int x1, const int y1)
Determines the number of pixels necessary for a line between two given points.
Bresenham(const int x0, const int y0, const int x1, const int y1)
Creates a new Bresenham line.
static bool borderIntersection(const Line2 &line, const int leftBorder, const int topBorder, const int rightBorder, const int bottomBorder, int &x0, int &y0, int &x1, int &y1)
Computes the pixel-precise border intersection (the begin and end position) of a sub-pixel-precise 2D...
Orientation orientation_
Orientation parameter.
Definition: Bresenham.h:144
bool isValid() const
Returns whether this object holds a valid line.
Definition: Bresenham.h:162
int control_
Control parameter.
Definition: Bresenham.h:147
Bresenham()
Creates an invalid object.
Definition: Bresenham.h:156
Orientation orientation() const
Returns the current orientation of the bresenham line.
Definition: Bresenham.h:167
Orientation
Definition of different line orientations.
Definition: Bresenham.h:34
@ ORIENTATION_1
Line orientation with range (45, 90] degree.
Definition: Bresenham.h:40
@ ORIENTATION_3
Line orientation with range [135, 180] degree.
Definition: Bresenham.h:44
@ ORIENTATION_0
Line orientation with range [0, 45] degree.
Definition: Bresenham.h:38
@ ORIENTATION_4
Line orientation with range [180, 225] degree.
Definition: Bresenham.h:46
@ ORIENTATION_2
Line orientation with range [90, 135) degree.
Definition: Bresenham.h:42
@ ORIENTATION_6
Line orientation with range (270, 315] degree.
Definition: Bresenham.h:50
@ ORIENTATION_INVALID
Invalid orientation.
Definition: Bresenham.h:36
@ ORIENTATION_5
Line orientation with range (225, 270] degree.
Definition: Bresenham.h:48
int updateXY_
Horizontal and vertical update value.
Definition: Bresenham.h:153
This class implements an infinite line in 2D space.
Definition: Line2.h:83
std::vector< PixelPosition > PixelPositions
Definition of a vector holding pixel positions (with positive coordinate values).
Definition: PixelPosition.h:48
float Scalar
Definition of a scalar type.
Definition: Math.h:128
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15