8#ifndef META_OCEAN_CV_ADVANCED_PIXEL_LINE_H
9#define META_OCEAN_CV_ADVANCED_PIXEL_LINE_H
87 inline PixelLineT(
const T& x0,
const T& y0,
const T& x1,
const T& y1);
159 explicit inline operator bool()
const;
259 const float t = float(
int(y) - SignedType(
lineP0.y())) / float(SignedType(
lineP1.y()) - SignedType(
lineP0.y()));
260 x =
lineP0.x() + T(
float((SignedType(
lineP1.x()) - SignedType(
lineP0.x()))) * t + 0.5f);
279 const SignedType vx0 = SignedType(
lineP1.x()) - SignedType(
lineP0.x());
280 const SignedType vy0 = SignedType(
lineP1.y()) - SignedType(
lineP0.y());
282 const SignedType vx1 = SignedType(line.
lineP1.x()) - SignedType(line.
lineP0.x());
283 const SignedType vy1 = SignedType(line.
lineP1.y()) - SignedType(line.
lineP0.y());
285 return vx0 * vy1 - vx1 * vy0;
297 return !(*
this == line);
This class implements a 2D line with pixel precision.
Definition PixelLine.h:65
bool isHorizontal() const
Returns whether this line is horizontal.
Definition PixelLine.h:215
bool isVertical() const
Returns whether this line is vertical.
Definition PixelLine.h:222
unsigned int lineMinY
Definition PixelLine.h:170
PixelPositionT< unsigned int > lineP0
Definition PixelLine.h:164
PixelLineT()
Creates an invalid line object.
Definition PixelLine.h:177
PixelPositionT< unsigned int > lineP1
Definition PixelLine.h:167
bool operator!=(const PixelLineT< T > &line) const
Returns whether two line objects are not equal.
Definition PixelLine.h:295
unsigned int lineMaxY
Definition PixelLine.h:173
PixelLineT(const PixelPositionT< T > &p0, const PixelPositionT< T > &p1)
Creates a new line object by two given end points.
Definition PixelLine.h:183
SignedTyper< T >::Type operator*(const PixelLineT< T > &line) const
Multiplies two line objects and returns the scalar product.
Definition PixelLine.h:273
bool isValid() const
Returns whether this line holds two valid end points.
Definition PixelLine.h:267
const PixelPositionT< unsigned int > & p0() const
bool isPoint() const
Returns whether this line is a point.
Definition PixelLine.h:229
PixelLineT(const T &x0, const T &y0, const T &x1, const T &y1)
Creates a new line object by two given end points.
Definition PixelLine.h:193
const PixelPositionT< unsigned int > & p1() const
bool operator==(const PixelLineT< T > &line) const
Returns whether two line objects are equal.
Definition PixelLine.h:289
bool horizontalIntersection(const T y, T &x) const
Calculates the intersection between this line and a horizontal scan line.
Definition PixelLine.h:236
This class implements a 2D pixel position with pixel precision.
Definition PixelPosition.h:63
T Type
Definition of the signed data type, if existing.
Definition DataType.h:294
PixelLineT< int > PixelLineI
Definition of a PixelLine object with a data type allowing positive and negative coordinate values.
Definition PixelLine.h:41
std::vector< PixelLineI > PixelLinesI
Definition of a vector holding pixel lines (with positive and negative coordinate values).
Definition PixelLine.h:55
PixelLineT< unsigned int > PixelLine
Definition of the default PixelLine object with a data type allowing only positive coordinate values.
Definition PixelLine.h:34
std::vector< PixelLine > PixelLines
Definition of a vector holding pixel lines (with positive coordinate values).
Definition PixelLine.h:48
Namespace of the CV Advanced library.
Definition Advanced.h:20
Namespace of the CV library.
Definition Advanced.h:17
The namespace covering the entire Ocean framework.
Definition Accessor.h:15