8#ifndef META_OCEAN_CV_BRESENHAM_H
9#define META_OCEAN_CV_BRESENHAM_H
69 Bresenham(
const int x0,
const int y0,
const int x1,
const int y1);
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);
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.
static void circlePixels(const int centerX, const int centerY, const unsigned int radius, PixelPositionsI &pixels)
Determines the pixels on the circumference of a circle using the midpoint circle algorithm.
int updateX_
Horizontal update value.
Definition Bresenham.h:167
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...
static size_t numberCirclePixels(const unsigned int radius)
Determines the number of pixels on the circumference of a circle.
Orientation orientation_
Orientation parameter.
Definition Bresenham.h:161
bool isValid() const
Returns whether this object holds a valid line.
Definition Bresenham.h:178
int control_
Control parameter.
Definition Bresenham.h:164
Bresenham()=default
Creates an invalid object.
Orientation orientation() const
Returns the current orientation of the bresenham line.
Definition Bresenham.h:173
Orientation
Definition of different line orientations.
Definition Bresenham.h:34
@ ORIENTATION_7
Line orientation with range (315, 360] degree.
Definition Bresenham.h:52
@ 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:170
std::vector< PixelPositionI > PixelPositionsI
Definition of a vector holding pixel positions (with positive and negative coordinate values).
Definition PixelPosition.h:53
std::vector< PixelPosition > PixelPositions
Definition of a vector holding pixel positions (with positive coordinate values).
Definition PixelPosition.h:46
PixelPositionT< unsigned int > PixelPosition
Definition of the default PixelPosition object with a data type allowing only positive coordinate val...
Definition PixelPosition.h:32
LineT2< Scalar > Line2
Definition of the Line2 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Line2.h:28
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15